bugs 0018150 and 0018159
authorcavaliet
Thu, 21 Nov 2013 19:23:40 +0100
changeset 196 c0cd36df74a0
parent 195 0b189e9c7b68
child 197 27f7e1083627
bugs 0018150 and 0018159
src/jocondelab/static/jocondelab/css/front-notice.css
src/jocondelab/static/jocondelab/js/front-timeline.js
src/jocondelab/templates/jocondelab/front_describe.html
--- a/src/jocondelab/static/jocondelab/css/front-notice.css	Thu Nov 21 18:55:22 2013 +0100
+++ b/src/jocondelab/static/jocondelab/css/front-notice.css	Thu Nov 21 19:23:40 2013 +0100
@@ -11,11 +11,11 @@
 }
 
 .describe-mode .notice-images {
-    float: none; margin: 15px 0; text-align: center; width: 100%;
+    float: left; margin: 15px 0; text-align: center; width: 67%;
 }
 
 .describe-mode .notice-images li {
-    margin: 0; display: block; max-width: 100%; box-shadow: none; background: transparent;
+    margin: 0; display: block; width: 100%; box-shadow: none; background: transparent;
 }
 
 .describe-mode .notice-images li:nth-child(n+2) {
@@ -37,6 +37,9 @@
 .notice-colright-wrapper {
     float: right; width: 67%; margin-top: 10px;
 }
+.describe-mode .notice-colright-wrapper {
+    float: right; width: 33%; margin-top: 10px;
+} 
 
 .notice-colright {
     margin-left: 20px;
--- a/src/jocondelab/static/jocondelab/js/front-timeline.js	Thu Nov 21 18:55:22 2013 +0100
+++ b/src/jocondelab/static/jocondelab/js/front-timeline.js	Thu Nov 21 19:23:40 2013 +0100
@@ -224,6 +224,7 @@
         ctx.textAlign = 'center';
         ctx.font = 'bold 14px Arial,Helvetica';
         ctx.fillStyle = "#000000";
+        var lastX = -40;
         for (var y = wLineDist * Math.ceil(fromYear/wLineDist); y <= toYear; y += wLineDist ) {
             var x = yrToX(y),
                 isPrimary = !((y/wLineDist) % 2);
@@ -232,9 +233,11 @@
             ctx.moveTo(x, cHeight*3/14);
             ctx.lineTo(x, cHeight - cHeight/14);
             ctx.stroke();
-            if (isPrimary && (y!=startYear)) {
+            // 40 is a bit arbitrary but avoids overlap
+            if (isPrimary && (y!=startYear) && (x>(lastX+40))) {
                 ctx.fillText(y || 1, x, cHeight - 4);
                 ctx.fillText(y || 1, x, cHeight*4/21);
+                lastX = x;
             }
         }
         /* Now displaying the different terms that we will show on the timeline */
--- a/src/jocondelab/templates/jocondelab/front_describe.html	Thu Nov 21 18:55:22 2013 +0100
+++ b/src/jocondelab/templates/jocondelab/front_describe.html	Thu Nov 21 19:23:40 2013 +0100
@@ -19,7 +19,9 @@
     </form>
     {% endblock %}
     {% block images %}{{block.super}}{% endblock %}
+    <div class="notice-colright-wrapper">
     {% block datasheet %}{{block.super}}{% endblock %}
     {% block datasheet_title %}{% endblock %}
+    </div>
 </div>
 {% endblock %}