Parcourir la source

WIP: apply bootstrap theme

* page attachment, on-edit
Yuki Takei il y a 8 ans
Parent
commit
8b62bf6de3

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

@@ -107,7 +107,8 @@ gh/highlightjs/cdn-release@9.12.0/build/languages/yaml.min.js
 
 {% block html_body %}
 <body
-  class="crowi main-container content-wrapper {% block html_base_css %}{% endblock %} {% if 'crowi-plus' === layoutType() %}crowi-plus{% endif %}"
+  class="crowi main-container content-wrapper {% block html_base_css %}{% endblock %}
+      {% if 'crowi-plus' === layoutType() %}crowi-plus{% endif %}"
   data-me="{{ user._id.toString() }}"
   data-plugin-enabled="{{ isEnabledPlugins() }}"
  {% block html_base_attr %}{% endblock %}
@@ -170,7 +171,7 @@ gh/highlightjs/cdn-release@9.12.0/build/languages/yaml.min.js
         {% if user and user.admin %}
         <li id="">
           <a href="/admin" id="link-mypage">
-            <i class="ti-world"></i> {{ t('Admin') }}
+            <i class="icon-settings"></i> {{ t('Admin') }}
           </a>
         </li>
         {% endif %}

+ 19 - 14
lib/views/page.html

@@ -94,7 +94,7 @@
 
 {% endblock %}
 
-<div id="content-main" class="content-main {% if not page or req.body.pageForm %}on-edit{% endif %}"
+<div id="content-main" class="content-main"
   data-path="{{ path }}"
   data-path-shortname="{{ path|path2name }}"
   data-page-id="{% if page %}{{ page._id.toString() }}{% endif %}"
@@ -216,20 +216,25 @@
 
 
 {% if page %}
-<div class="page-attachments meta" id="page-attachment">
+<div class="row page-attachments-row">
+  <div class="col-xs-12">
+    <div class="m-t-15 m-l-15 m-r-15 m-b-15">
+      <div class="page-attachments" id="page-attachment"></div>
+
+      <p class="page-meta">
+        Path: <span id="pagePath">{{ page.path }}</span><br>
+        {# for BC #}
+        {% if page.lastUpdateUser %}
+          Last updated at {{ page.updatedAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.lastUpdateUser|picture }}" class="picture img-circle"> {{ page.lastUpdateUser.name }}<br>
+        {% else %}
+          Last updated at {{ page.revision.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.revision.author|picture }}" class="picture img-circle"> {{ page.revision.author.name }}<br>
+        {% endif %}
+        {# /for BC #}
+        Created at {{ page.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.creator|default(page.creator)|picture }}" class="picture img-circle"> {{ page.creator.name }}<br>
+      </p>
+    </div>
+  </div>
 </div>
-
-<p class="page-meta meta">
-  Path: <span id="pagePath">{{ page.path }}</span><br>
-  {# for BC #}
-  {% if page.lastUpdateUser %}
-    Last updated at {{ page.updatedAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.lastUpdateUser|picture }}" class="picture img-circle"> {{ page.lastUpdateUser.name }}<br>
-  {% else %}
-    Last updated at {{ page.revision.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.revision.author|picture }}" class="picture img-circle"> {{ page.revision.author.name }}<br>
-  {% endif %}
-  {# /for BC #}
-  Created at {{ page.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.creator|default(page.creator)|picture }}" class="picture img-circle"> {{ page.creator.name }}<br>
-</p>
 {% endif %}
 
 {% endblock %}

+ 0 - 1
resource/js/components/PageAttachment.js

@@ -112,7 +112,6 @@ export default class PageAttachment extends React.Component {
 
     return (
       <div>
-        <p>Attachments</p>
         <PageAttachmentList
           attachments={this.state.attachments}
           inUse={this.state.inUse}

+ 8 - 3
resource/js/components/PageAttachment/PageAttachmentList.js

@@ -22,9 +22,14 @@ export default class PageAttachmentList extends React.Component {
     });
 
     return (
-      <ul>
-        {attachmentList}
-      </ul>
+      <div>
+        {(attachmentList.length != 0) &&
+          <h5><strong>Attachments</strong></h5>
+        }
+        <ul>
+          {attachmentList}
+        </ul>
+      </div>
     );
   }
 }

+ 0 - 1
resource/js/components/PageEditor/Editor.js

@@ -266,7 +266,6 @@ export default class Editor extends React.Component {
   renderOverlay() {
     const overlayStyle = {
       position: 'absolute',
-      zIndex: 1060, // FIXME: required because .content-main.on-edit has 'z-index:1050'
       top: 0,
       right: 0,
       bottom: 0,

+ 2 - 2
resource/js/legacy/crowi-form.js

@@ -27,7 +27,7 @@
   }
 
   $('a[data-toggle="tab"][href="#edit-form"]').on('show.bs.tab', function() {
-    $('.content-main').addClass('on-edit');
+    $('body').addClass('on-edit');
 
     if (slackConfigured) {
       var $slackChannels = $('#page-form-slack-channel');
@@ -41,7 +41,7 @@
   });
 
   $('a[data-toggle="tab"][href="#edit-form"]').on('hide.bs.tab', function() {
-    $('.content-main').removeClass('on-edit');
+    $('body').removeClass('on-edit');
   });
 
 /**

+ 2 - 2
resource/js/legacy/crowi.js

@@ -372,7 +372,7 @@ $(function() {
 
   $('#create-portal-button').on('click', function(e) {
     $('.portal').removeClass('hide');
-    $('.content-main').addClass('on-edit');
+    $('body').addClass('on-edit');
     $('.portal a[data-toggle="tab"][href="#edit-form"]').tab('show');
 
     var path = $('.content-main').data('path');
@@ -387,7 +387,7 @@ $(function() {
   });
   $('#portal-form-close').on('click', function(e) {
     $('.portal').addClass('hide');
-    $('.content-main').removeClass('on-edit');
+    $('body').removeClass('on-edit');
 
     return false;
   });

+ 13 - 1
resource/styles/scss/_attachments.scss

@@ -1,5 +1,17 @@
 
-.page-attachments {
+.page-attachments-row {
+  border-top: solid 1px #ccc;
+  background: #f5f5f5;
+}
+.page-attachments, .page-meta {
+  font-size: 0.95em;
+
+  .picture {
+    width: 16px;
+    height: 16px;
+    border: 1px solid #ccc;
+  }
+
   .attachment-in-use {
     margin: 0 0 0 4px;
     padding: 1px 5px;

+ 30 - 18
resource/styles/scss/_form.scss → resource/styles/scss/_on-edit.scss

@@ -1,7 +1,16 @@
-// import Growi variable
-@import 'variables';
+body.on-edit {
 
-.crowi.main-container .main .content-main.on-edit { // {{{ Edit Form of Page
+  .navbar.navbar-static-top,
+  .row.page-list,
+  .row.page-comments-row,
+  .row.page-attachments-row,
+  footer {
+    display: none;
+  }
+
+
+
+  /*
   padding: 0;
 
   position: fixed;
@@ -61,6 +70,7 @@
       }
     }
   }
+*/
 
   .page-editor-editor-container {
     padding-right: 0;
@@ -196,18 +206,18 @@
     overflow-y: scroll;
   }
 
-  .form-group.form-submit-group {
-    position: fixed;
-    z-index: 1054;
-    bottom: 0;
-    width: 100%;
-    left: 0;
-    padding: 8px;
-    min-height: 50px;
-    background: rgba(255,255,255,.8);
-    border-top: solid 1px #ccc;
-    margin-bottom: 0;
-  }
+  // .form-group.form-submit-group {
+  //   position: fixed;
+  //   z-index: 1054;
+  //   bottom: 0;
+  //   width: 100%;
+  //   left: 0;
+  //   padding: 8px;
+  //   min-height: 50px;
+  //   background: rgba(255,255,255,.8);
+  //   border-top: solid 1px #ccc;
+  //   margin-bottom: 0;
+  // }
 
   #page-editor-options-selector {
     label {
@@ -228,6 +238,7 @@
   }
 } // }}}
 
+/*
 .crowi.main-container .main .page-list.content-main { // {{{ Edit Form of Page List
 
   .close-button {
@@ -249,7 +260,8 @@
     border-bottom: solid 1px #ccc;
   }
 } // }}}
-
+*/
+/*
 @media (max-width: $screen-sm-max) { // {{{ less than tablet size
 
   .content-main.on-edit {
@@ -268,11 +280,11 @@
     float: right;
   }
 } // }}}
-
+*/
 // overwrite .CodeMirror-hints
 .CodeMirror-hints {
   // FIXME: required because .content-main.on-edit has 'z-index:1050'
-  z-index: 1060 !important;
+  // z-index: 1060 !important;
 
   max-height: 30em !important;
 

+ 0 - 11
resource/styles/scss/_page.scss

@@ -124,17 +124,6 @@
   }
   // }}}
 
-  .page-attachments { // {{{
-    p {
-      font-weight: bold;
-    }
-
-    ul {
-    }
-  } // }}}
-  */
-
-  /*
   .footer { // {{{
     position: fixed;
     width: calc(25% - 18px);

+ 2 - 18
resource/styles/scss/crowi.scss

@@ -12,14 +12,14 @@
 
 // crowi component
 // @import 'admin';
-// @import 'attachments';
+@import 'attachments';
 @import 'comment';
 @import 'comment_crowi-plus';
 @import 'create-page';
 @import 'crowi-sidebar';
-// @import 'form';
 @import 'layout';
 @import 'layout_crowi-plus';
+@import 'on-edit';
 @import 'page_list';
 @import 'page';
 @import 'page_crowi-plus';
@@ -36,22 +36,6 @@ ul {
   padding-left: 18px;
 }
 
-
-.meta {
-  margin-top: 0;
-  padding: 16px;
-  color: #666;
-  border-top: solid 1px #ccc;
-  background: #f0f0f0;
-  font-size: 0.95em;
-  color: #888;
-
-  .picture {
-    width: 16px;
-    height: 16px;
-  }
-}
-
 .page-meta {
   margin-bottom: 0;
 }