lesson activity icons
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 8 Feb 2013 08:34:11 +0000 (09:34 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 8 Feb 2013 08:34:11 +0000 (09:34 +0100)
catalogue/management/commands/importlessons.py
catalogue/models.py
catalogue/static/catalogue/css/lesson.css
catalogue/static/catalogue/css/lesson.scss
edumed/static/img/icons/activity-kind.png [new file with mode: 0644]
edumed/static/img/icons/activity-time.png [new file with mode: 0644]
edumed/static/img/icons/activity-tools.png [new file with mode: 0644]

index 43823bb..1eefc46 100755 (executable)
@@ -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
index 0c3a54c..ee0222c 100644 (file)
@@ -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:
index 6ba748e..de122b8 100644 (file)
@@ -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; }
index 543ee8f..1378c20 100755 (executable)
@@ -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 (file)
index 0000000..d8b7dd7
Binary files /dev/null and b/edumed/static/img/icons/activity-kind.png differ
diff --git a/edumed/static/img/icons/activity-time.png b/edumed/static/img/icons/activity-time.png
new file mode 100644 (file)
index 0000000..1de3451
Binary files /dev/null and b/edumed/static/img/icons/activity-time.png differ
diff --git a/edumed/static/img/icons/activity-tools.png b/edumed/static/img/icons/activity-tools.png
new file mode 100644 (file)
index 0000000..b468872
Binary files /dev/null and b/edumed/static/img/icons/activity-tools.png differ