Просмотр исходного кода

WIP: reconstruct layouts

* page_tabs
Yuki Takei 8 лет назад
Родитель
Сommit
4910565e7c
4 измененных файлов с 17 добавлено и 17 удалено
  1. 2 0
      lib/routes/page.js
  2. 0 3
      lib/views/layout-growi/page_list.html
  3. 3 3
      lib/views/page.html
  4. 12 11
      lib/views/widget/page_tabs.html

+ 2 - 0
lib/routes/page.js

@@ -160,6 +160,7 @@ module.exports = function(crowi, app) {
     var renderVars = {
       page: null,
       path: path,
+      isPortal: false,
       pages: [],
       tree: [],
     };
@@ -167,6 +168,7 @@ module.exports = function(crowi, app) {
     Page.hasPortalPage(path, req.user, req.query.revision)
     .then(function(portalPage) {
       renderVars.page = portalPage;
+      renderVars.isPortal = true;
 
       if (portalPage) {
         renderVars.revision = portalPage.revision;

+ 0 - 3
lib/views/layout-growi/page_list.html

@@ -34,9 +34,6 @@
         {# force remove #revision-toc from #content_main of parent #}
         <script>
           $('#revision-toc').remove();
-
-          // hide unportalize button
-          $('.portal > .nav > .dropdown').remove();
         </script>
 
       </div> {# /.col- #}

+ 3 - 3
lib/views/page.html

@@ -49,7 +49,7 @@
   <ul class="nav nav-tabs hidden-print">
     <li><a>Create: {{ path }}</a></li>
     <li class="dropdown pull-right">
-      <a href="#" onclick="history.back();"><i class="fa fa-times"></i> {{ t('Cancel') }}</a>
+      <a href="#" onclick="history.back();"><i class="icon-close"></i> {{ t('Cancel') }}</a>
     </li>
   </ul>
   <div class="tab-content">
@@ -74,13 +74,13 @@
 {% endblock %}
 
 {% block side_header %}
-  {% if not page.isDeleted() %}
+  {% if page and not page.isDeleted() %}
     {% include 'widget/page_side_header.html' %}
   {% endif %}
 {% endblock %} {# side_header #}
 
 {% block side_content %}
-  {% if not page.isDeleted() %}
+  {% if page and not page.isDeleted() %}
     {% include 'widget/page_side_content.html' %}
   {% endif %}
 {% endblock %}

+ 12 - 11
lib/views/widget/page_tabs.html

@@ -19,17 +19,7 @@
   {#
     Right Tabs
   #}
-
-  {% if isPortal %}
-  <li class="dropdown pull-right">
-    <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
-      <i class="icon-options-vertical"></i>
-    </a>
-    <ul class="dropdown-menu">
-      <li><a href="#" data-target="#unportalize" data-toggle="modal"><i class="fa fa-share"></i> {{ t('Unportalize') }}</a></li>
-    </ul>
-  </li>
-  {% else %}
+  {% if not isPortal %}
   <li class="dropdown pull-right">
     <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
       <i class="icon-options-vertical"></i>
@@ -44,8 +34,19 @@
       {% endif %}
     </ul>
   </li>
+  {% elseif ('/' !== path) %}
+  <li class="dropdown pull-right">
+    <a class="dropdown-toggle {% if not user %}dropdown-disabled{% endif %}" {% if user %}data-toggle="dropdown" href="#"{% endif %}>
+      <i class="icon-options-vertical"></i>
+    </a>
+    <ul class="dropdown-menu">
+      <li><a href="#" data-target="#unportalize" data-toggle="modal"><i class="fa fa-share"></i> {{ t('Unportalize') }}</a></li>
+    </ul>
+  </li>
   {% endif %}
+
   <li class="pull-right"><a href="#revision-history" data-toggle="tab"><i class="icon-layers"></i> History</a></li>
   <li class="pull-right"><a href="?presentation=1" class="toggle-presentation"><i class="icon-film"></i> {{ t('Presentation Mode') }}</a></li>
+
 </ul>
 {% endif %}