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

WIP: reconstruct layouts

* create portal button
Yuki Takei 8 лет назад
Родитель
Сommit
d7749efa71

+ 3 - 2
lib/views/layout-crowi/page.html

@@ -92,6 +92,7 @@
   <div id="presentation-layer" class="fullscreen-layer">
   <div id="presentation-layer" class="fullscreen-layer">
     <div id="presentation-container"></div>
     <div id="presentation-container"></div>
   </div>
   </div>
-
-  {% include '../widget/page_modals.html' %}
+  <div id="crowi-modals">
+    {% include '../widget/page_modals.html' %}
+  </div>
 {% endblock %}
 {% endblock %}

+ 1 - 30
lib/views/layout-crowi/page_list.html

@@ -99,12 +99,7 @@
 {% block side_header %}
 {% block side_header %}
 
 
 {% if not page and not isUserPageList(path) and !isTrashPage() %}
 {% if not page and not isUserPageList(path) and !isTrashPage() %}
-<div class="portal-side">
-  <div class="portal-form-button">
-    <button class="btn btn-primary" id="create-portal-button">Create Portal</button>
-    <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="fa fa-question-circle"></i> What is Portal?</a></p>
-  </div>
-</div>
+  {% include '../widget/create_portal.html' %}
 {% else %}
 {% else %}
   {% include '../widget/page_side_header.html' %}
   {% include '../widget/page_side_header.html' %}
 {% endif %}
 {% endif %}
@@ -116,28 +111,4 @@
   {% include '../modal/what_is_portal.html' %}
   {% include '../modal/what_is_portal.html' %}
   {% include '../modal/unportalize.html' %}
   {% include '../modal/unportalize.html' %}
 </div>
 </div>
-<div class="modal fade portal-warning-modal" id="portal-warning-modal">
-  <div class="modal-dialog">
-    <div class="modal-content">
-
-      <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-        <h4 class="modal-title">ポータルに関するヒント</h4>
-      </div>
-      <div class="modal-body">
-
-        <strong>Warning!</strong><br>
-
-        <p>既に <strong><a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a></strong> のページが存在します。</p>
-
-        <p>
-          <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> をポータル化するには、
-          <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> に移動し、「ページを移動」させてください。<br>
-          <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> とは別に、このページ(<code>{{ path }}</code>)にポータルを作成する場合、このまま編集を続けて作成してください。
-        </p>
-
-      </div>
-    </div>
-  </div>
-</div>
 {% endblock %} {# body_end #}
 {% endblock %} {# body_end #}

+ 3 - 1
lib/views/layout-growi/page.html

@@ -71,5 +71,7 @@
     <div id="presentation-container"></div>
     <div id="presentation-container"></div>
   </div>
   </div>
 
 
-  {% include '../widget/page_modals.html' %}
+  <div id="crowi-modals">
+    {% include '../widget/page_modals.html' %}
+  </div>
 {% endblock %}
 {% endblock %}

+ 6 - 2
lib/views/layout-growi/page_list.html

@@ -19,6 +19,7 @@
 
 
 
 
 {% block content_main_before %}
 {% block content_main_before %}
+
 {% endblock %}
 {% endblock %}
 
 
 
 
@@ -64,6 +65,9 @@
   <div id="presentation-layer" class="fullscreen-layer">
   <div id="presentation-layer" class="fullscreen-layer">
     <div id="presentation-container"></div>
     <div id="presentation-container"></div>
   </div>
   </div>
-
-  {% include '../widget/page_modals.html' %}
+  <div id="crowi-modals">
+    {% include '../widget/page_modals.html' %}
+    {% include '../modal/what_is_portal.html' %}
+    {% include '../modal/unportalize.html' %}
+  </div>
 {% endblock %}
 {% endblock %}

+ 3 - 4
lib/views/layout-growi/widget/header.html

@@ -53,10 +53,9 @@
       {% endif %}
       {% endif %}
 
 
       {% if not page and ('/' === path or 'crowi' === behaviorType()) and not isUserPageList(path) and !isTrashPage() %}
       {% if not page and ('/' === path or 'crowi' === behaviorType()) and not isUserPageList(path) and !isTrashPage() %}
-      <div class="portal-form-button">
-        <button class="btn btn-primary" id="create-portal-button" {% if not user %}disabled{% endif %}>Create Portal</button>
-        <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="fa fa-question-circle"></i> What is Portal?</a></p>
-      </div>
+        {% if '/' === path.slice(-1) %}
+          {% include '../../widget/create_portal.html' %}
+        {% endif %}
       {% endif %}
       {% endif %}
 
 
     </div>
     </div>

+ 24 - 0
lib/views/modal/what_is_portal.html

@@ -55,3 +55,27 @@
   </div><!-- /.modal-dialog -->
   </div><!-- /.modal-dialog -->
 </div><!-- /.modal -->
 </div><!-- /.modal -->
 
 
+<div class="modal fade portal-warning-modal" id="portal-warning-modal">
+  <div class="modal-dialog">
+    <div class="modal-content">
+
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <h4 class="modal-title">ポータルに関するヒント</h4>
+      </div>
+      <div class="modal-body">
+
+        <strong>Warning!</strong><br>
+
+        <p>既に <strong><a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a></strong> のページが存在します。</p>
+
+        <p>
+          <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> をポータル化するには、
+          <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> に移動し、「ページを移動」させてください。<br>
+          <a href="{{ path|removeLastSlash }}">{{ path|removeLastSlash }}</a> とは別に、このページ(<code>{{ path }}</code>)にポータルを作成する場合、このまま編集を続けて作成してください。
+        </p>
+
+      </div>
+    </div>
+  </div>
+</div>

+ 4 - 0
lib/views/widget/create_portal.html

@@ -0,0 +1,4 @@
+<div class="portal-form-button">
+  <button class="btn btn-primary" id="create-portal-button" {% if not user %}disabled{% endif %}>Create Portal</button>
+  <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="icon-question"></i> What is Portal?</a></p>
+</div>

+ 5 - 7
lib/views/widget/page_modals.html

@@ -1,7 +1,5 @@
-<div id="crowi-modals">
-  {% include '../modal/rename.html' %}
-  {% include '../modal/delete.html' %}
-  {% include '../modal/duplicate.html' %}
-  {% include '../modal/put_back.html' %}
-  {% include '../modal/page_name_warning.html' %}
-</div>
+{% include '../modal/rename.html' %}
+{% include '../modal/delete.html' %}
+{% include '../modal/duplicate.html' %}
+{% include '../modal/put_back.html' %}
+{% include '../modal/page_name_warning.html' %}

+ 5 - 0
resource/styles/scss/_layout_crowi.scss

@@ -36,4 +36,9 @@
     }
     }
   }
   }
 
 
+  .crowi-sidebar {
+    .portal-form-button {
+      text-align: center;
+    }
+  }
 }
 }

+ 0 - 12
resource/styles/scss/_portal.scss

@@ -1,12 +0,0 @@
-.portal {
-  .wiki {
-    margin-bottom: 1em;
-    padding-bottom: 1em;
-  }
-} // .portal
-
-.portal-side {
-  .portal-form-button {
-    text-align: center;
-  }
-} // .portal-side

+ 0 - 1
resource/styles/scss/crowi.scss

@@ -24,7 +24,6 @@
 @import 'page_list';
 @import 'page_list';
 @import 'page';
 @import 'page';
 @import 'page_crowi-plus';
 @import 'page_crowi-plus';
-@import 'portal';
 @import 'search';
 @import 'search';
 @import 'shortcuts';
 @import 'shortcuts';
 @import 'user';
 @import 'user';