editor: bring back summary view, this time in a main bar
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Tue, 27 May 2014 14:39:30 +0000 (16:39 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 28 May 2014 12:45:59 +0000 (14:45 +0200)
src/editor/modules/mainBar/mainBar.js
src/editor/modules/mainBar/mainBar.less
src/editor/modules/mainBar/template.html
src/editor/modules/rng/documentSummary.html
src/editor/modules/rng/documentSummary.js
src/editor/modules/rng/rng.js

index 256111f..e5cf522 100644 (file)
@@ -40,6 +40,9 @@ return function(sandbox) {
                 trigger.data('originalContent', trigger.html());
                 trigger.text(disabledText);
             }
+        },
+        setSummaryView: function(summaryView) {
+            view.find('.bottom').prepend(summaryView);
         }
     };
 
index 8fb99a5..7a2e49b 100644 (file)
         border-style: solid;
         margin: 0 5px 0 0;
         padding: 0 5px 0 0;
-        &:last-child {
-            margin-right: 0;
-            padding-right: 0;
-        }
+
     }
 
     ul {
         list-style-type: none;
+        display: inline-block;
+        color: #8F8A8A;
+        margin: 0;
+        &:last-child {
+            li:last-child {
+                margin-right: 0;
+                padding-right: 0;
+            }
+        }
     }
 
     .top {
index 5320525..59f0708 100644 (file)
@@ -3,8 +3,10 @@
         <%= userName %> (<a href="/"><%= gettext('Exit') %></a>)
     </div>
     <div style="clear:both;"></div>
-    <ul class="bottom">
-        <li><a href="#" data-cmd="drop-draft" data-disabled-text="<%= gettext('no draft exists') %>"><%= gettext('drop a working draft') %></a></li>
-        <li><button class="btn btn-mini btn-info" data-cmd="save"><%= gettext('Save') %></button></li>
-    </ul>
+    <div class="bottom">
+        <ul>
+            <li><a href="#" data-cmd="drop-draft" data-disabled-text="<%= gettext('no draft exists') %>"><%= gettext('drop a working draft') %></a></li>
+            <li><button class="btn btn-mini btn-info" data-cmd="save"><%= gettext('Save') %></button></li>
+        </ul>
+    </div>
 </div>
\ No newline at end of file
index 95c7552..8d5fcbd 100644 (file)
@@ -1,14 +1,6 @@
-<div>
-    <h1 class="title"><%= title %></h1>
-    <table>
-        <% properties.forEach(function(propertyDesc) { %>
-            <tr>
-                <td><%= propertyDesc.label %></td>
-                <td><%= propertyValues[propertyDesc.name] %></td>
-        <% }); %>
-        <tr>
-            <td><%= gettext('Draft Saved') %></td>
-            <td class="draft"></td>
-        </tr>
-    </table>
-</div>
\ No newline at end of file
+<li><%= gettext('Draft Saved') %>: <span class="draft"></span></li>
+<% properties.forEach(function(propertyDesc) { %>
+    <li>
+        <%= propertyDesc.label %>: <%= propertyValues[propertyDesc.name] %>
+    </li>
+<% }); %>
index fe593c3..8e6927d 100644 (file)
@@ -8,7 +8,7 @@ var $ = require('libs/jquery'),
 
 
 var view = {
-    dom: $('<div class="documentSummary"></div>'),
+    dom: $('<ul></ul>'),
     init: function(config, doc) {
         this.config = config;
         this.doc = doc;
index 3274067..8fb27ed 100644 (file)
@@ -84,7 +84,7 @@ return function(sandbox) {
             documentSummary.init(sandbox.getConfig().documentSummaryView, wlxmlDocument);
             documentSummary.render();
             documentSummary.setDraftField(usingDraft ? (draftTimestamp || '???') : '-');
-            views.currentNodePaneLayout.appendView(documentSummary.dom);
+            sandbox.getModule('mainBar').setSummaryView(documentSummary.dom);
 
             sandbox.getModule('mainBar').setCommandEnabled('drop-draft', usingDraft);
             sandbox.getModule('mainBar').setCommandEnabled('save', usingDraft);