From 656ceadd4ab204cb994817d604ef968845fd6964 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 8 Feb 2013 09:34:11 +0100 Subject: [PATCH] lesson activity icons --- .../management/commands/importlessons.py | 6 +- catalogue/models.py | 2 +- catalogue/static/catalogue/css/lesson.css | 43 ++++++++---- catalogue/static/catalogue/css/lesson.scss | 65 +++++++++++++----- edumed/static/img/icons/activity-kind.png | Bin 0 -> 521 bytes edumed/static/img/icons/activity-time.png | Bin 0 -> 676 bytes edumed/static/img/icons/activity-tools.png | Bin 0 -> 588 bytes 7 files changed, 83 insertions(+), 33 deletions(-) create mode 100644 edumed/static/img/icons/activity-kind.png create mode 100644 edumed/static/img/icons/activity-time.png create mode 100644 edumed/static/img/icons/activity-tools.png diff --git a/catalogue/management/commands/importlessons.py b/catalogue/management/commands/importlessons.py index 43823bb..1eefc46 100755 --- a/catalogue/management/commands/importlessons.py +++ b/catalogue/management/commands/importlessons.py @@ -77,7 +77,7 @@ class Command(BaseCommand): self.import_book(file_path, options) files_imported += 1 transaction.commit() - except Section.IncompleteError: + except Section.IncompleteError, e: if file_name not in postponed or postponed[file_name] < files_imported: # Push it back into the queue, maybe the missing lessons will show up. if verbose > 0: @@ -88,8 +88,8 @@ class Command(BaseCommand): # We're in a loop, nothing's being imported - some lesson is really missing. raise e except BaseException, e: - import trackback - trackback.print_exc() + import traceback + traceback.print_exc() files_skipped += 1 # Print results diff --git a/catalogue/models.py b/catalogue/models.py index 0c3a54c..ee0222c 100644 --- a/catalogue/models.py +++ b/catalogue/models.py @@ -35,7 +35,7 @@ class Section(models.Model): lessons = [Lesson.objects.get(slug=part.slug) for part in wldoc.book_info.parts] except Lesson.DoesNotExist, e: - raise cls.IncompleteError(e) + raise cls.IncompleteError(part.slug) slug = wldoc.book_info.url.slug try: diff --git a/catalogue/static/catalogue/css/lesson.css b/catalogue/static/catalogue/css/lesson.css index 6ba748e..de122b8 100644 --- a/catalogue/static/catalogue/css/lesson.css +++ b/catalogue/static/catalogue/css/lesson.css @@ -188,27 +188,44 @@ em.person { @media print { #menu { display: none; } } +.activity { + clear: both; } + .activity .text { - max-width: 350px; + width: 27.5em; margin-right: 20px; float: left; } .activity .description p:first-child { margin-top: 0; } -.activity .info { - margin: 1.5em 0 0; - max-width: 130px; - float: right; } - -.activity .info p { - margin-bottom: 1em; } - .activity { - clear: both; } - -.activity .info { - font-size: 10pt; } + margin-top: 2em; } + .activity .act_counter { + float: left; + margin-right: .5em; + font-size: 2em; } + .activity .info { + float: right; + width: 8.438em; } + .activity .info .infobox { + padding: 1em 0; + border-top: 1px solid #c9ccce; } + .activity .info .infobox h1 { + text-transform: uppercase; + font-weight: bold; + margin: 0 0 0.5em -2.188em; + padding-left: 2.188em; + line-height: 24px; + font-size: 1em; } + .activity .info .infobox p { + margin: 0; } + .activity .info .time h1 { + background: url(/static/img/icons/activity-time.png) 0 0 no-repeat; } + .activity .info .kind h1 { + background: url(/static/img/icons/activity-kind.png) 0 0 no-repeat; } + .activity .info .materials h1 { + background: url(/static/img/icons/activity-tools.png) 0 0 no-repeat; } .clearboth { clear: both; } diff --git a/catalogue/static/catalogue/css/lesson.scss b/catalogue/static/catalogue/css/lesson.scss index 543ee8f..1378c20 100755 --- a/catalogue/static/catalogue/css/lesson.scss +++ b/catalogue/static/catalogue/css/lesson.scss @@ -1,3 +1,5 @@ +$px: .0625em; + /* =================================================== */ /* = Common elements: headings, paragraphs and lines = */ /* =================================================== */ @@ -225,34 +227,65 @@ em.person { #menu {display: none;} } + + +.activity { + clear:both; +} + .activity .text { - max-width:350px; - margin-right:20px; - float: left; + width: 440*$px; + margin-right: 20px; + float: left; } .activity .description p:first-child { margin-top: 0; } -.activity .info { - margin: 1.5em 0 0; - max-width: 130px; - float:right; -} - -.activity .info p { - margin-bottom: 1em; -} .activity { - clear:both; + margin-top: 2em; + + .act_counter { + float: left; + margin-right: .5em; + font-size: 2em; + } + + .info { + float: right; + width: 135*$px; + + .infobox { + padding: 1em 0; + border-top: 1px solid #c9ccce; + h1 { + text-transform: uppercase; + font-weight: bold; + margin: 0 0 .5em -35*$px; + padding-left: 35*$px; + line-height: 24px; + font-size: 1em; + } + p { + margin: 0; + } + + } + .time h1 { + background: url(/static/img/icons/activity-time.png) 0 0 no-repeat; + } + .kind h1 { + background: url(/static/img/icons/activity-kind.png) 0 0 no-repeat; + } + .materials h1 { + background: url(/static/img/icons/activity-tools.png) 0 0 no-repeat; + } + } } -.activity .info { - font-size: 10pt; -} .clearboth { clear: both; diff --git a/edumed/static/img/icons/activity-kind.png b/edumed/static/img/icons/activity-kind.png new file mode 100644 index 0000000000000000000000000000000000000000..d8b7dd765f6bae331055c8b3e9112f22528bc672 GIT binary patch literal 521 zcmV+k0`~ohP)P000;W1^@s654Bdt00006VoOIv05$+R z06sszi?jd$010qNS#tmY3ljhU3ljkVnw%H_000McNliru-2w#+0UpI<^F;sv02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00D7HL_t(Y$L*Cda>76iMIR;y zAT`4fZs5v=iyhijNlrkxLFm#2PC#w|oFGn_%FGs9Y!e^B3`3C$A0dsFc!)hPu%U{& zmDl>xm-H7dV2vtg6st$z4(J1|BV#Rr1&~;yi&~HQ? z@MtB#yUYII%UD5Q&l;Vd+NZ0U;L{Sf^K$^|WaUNx3Tgh3e-rx#CJvI3$B=L#00000 LNkvXXu0mjf4Li~4 literal 0 HcmV?d00001 diff --git a/edumed/static/img/icons/activity-time.png b/edumed/static/img/icons/activity-time.png new file mode 100644 index 0000000000000000000000000000000000000000..1de3451fc7e4827d1362cdfbdf47ade540732a51 GIT binary patch literal 676 zcmV;V0$crwP)P000;W1^@s654Bdt00006VoOIv05$+R z06sszi?jd$010qNS#tmY3ljhU3ljkVnw%H_000McNliru-2w#+0W*NRuP^`r02y>e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00In2L_t(Y$E{X7ZreZ<9MO%_ z(X}9mzJbyZ0Skh>I{;zFu?D~zz&C5kx(n-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