Browse Source

Merge pull request #69 from weseek/master

release 1.1.6
Yuki Takei 9 years ago
parent
commit
03f70ade7a

+ 4 - 0
CHANGES.md

@@ -1,6 +1,10 @@
 CHANGES
 ========
 
+## 1.1.6
+
+* Fix: crowi-plus Enhanced Layout
+
 ## 1.1.5
 
 * Fix: crowi-plus Enhanced Layout

+ 1 - 1
lib/routes/page.js

@@ -245,7 +245,7 @@ module.exports = function(crowi, app) {
     }).then(function() {
       var defaultPageTeamplate = 'customlayout-selector/page';
       if (userData) {
-        defaultPageTeamplate = 'user_page';
+        defaultPageTeamplate = 'customlayout-selector/user_page';
       }
       res.render(req.query.presentation ? 'page_presentation' : defaultPageTeamplate, renderVars);
     }).catch(function(err) {

+ 23 - 4
lib/views/admin/customize.html

@@ -24,7 +24,7 @@
 {% endblock %}
 
 {% block content_main %}
-<div class="content-main">
+<div class="content-main admin-customize">
   {% set smessage = req.flash('successMessage') %}
   {% if smessage.length %}
   <div class="alert alert-success">
@@ -56,15 +56,34 @@
                   {% if !settingForm['customize:layout'] || 'crowi' === settingForm['customize:layout'] %}checked="checked"{% endif %}>
               Official Crowi Classic Layout
             </h4>
-            <a href="http://placehold.it"><img src="http://placehold.it/350x150"></a>
+            <a href="/images/admin/customize/layout-classic.gif" class="ss-container">
+              <img src="/images/admin/customize/layout-classic-thumb.gif" width="240px">
+            </a>
+            <ul>
+              <li>Functional</li>
+              <ul>
+                <li>Collapsible Sidebar</li>
+                <li>Show and post comments in Sidebar</li>
+                <li>Collapsible Table-of-contents</li>
+              </ul>
+            </ul>
           </div>
           <div class="col-xs-6">
             <h4>
               <input type="radio" name="settingForm[customize:layout]" value="crowi-plus"
                   {% if 'crowi-plus' === settingForm['customize:layout'] %}checked="checked"{% endif %}>
-              crowi-plus Enhanced Layout
+              crowi-plus Enhanced Layout <small class="text-success">(Recommended)</small>
             </h4>
-            <a href="http://placehold.it"><img src="http://placehold.it/350x150"></a>
+            <a href="/images/admin/customize/layout-crowi-plus.gif" class="ss-container">
+              <img src="/images/admin/customize/layout-crowi-plus-thumb.gif" width="240px">
+            </a>
+            <ul>
+              <li>Simple and Clear</li>
+              <ul>
+                <li>Show and post comments from the bottom of the page</li>
+                <li>Affix Table-of-contents</li>
+              </ul>
+            </ul>
           </div>
         </div>
 

+ 42 - 0
lib/views/crowi-plus/base/user_page_nosidebar.html

@@ -0,0 +1,42 @@
+{% extends '../../user_page.html' %}
+
+
+{% block layout_sidebar %}
+{% endblock %}
+
+
+{% block layout_main %}
+<div id="main" class="main col-md-12 {% if page %}{{ css.grant(page) }}{% endif %} {% block main_css_class %}{% endblock %}">
+  {% if page && page.grant != 1 %}
+  <p class="page-grant">
+    <i class="fa fa-lock"></i> {{ consts.pageGrants[page.grant] }} ({{ t('Browsing of this page is restricted') }})
+  </p>
+  {% endif %}
+  {% if page && page.grant == 2 %}
+  <p class="alert alert-info">
+    {{ t('Shareable Link') }}
+    <input type="text" class="copy-link form-control" value="{{ baseUrl }}/{{ page._id.toString() }}" readonly>
+  </p>
+  {% endif %}
+  <article>
+    {% block content_head %}
+      {% parent %}
+    {% endblock %}
+
+    {% block content_main_before %}
+    {% endblock %}
+
+    {% block content_main %}
+      {% parent %}
+    {% endblock content_main %}
+
+    {% block content_main_after %}
+    {% endblock %}
+
+    {% block content_footer %}
+      {% parent %}
+    {% endblock %}
+  </article>
+</div>
+
+{% endblock %} {# layout_main #}

+ 14 - 12
lib/views/crowi-plus/page.html

@@ -15,24 +15,26 @@
 
 
 {% block content_main %}
-  <div class="row">
+  <div class="container-fluid">
+    <div class="row">
 
-    <div class="col-lg-10 col-md-9">
+      <div class="col-lg-10 col-md-9">
 
-      {% parent %}
+        {% parent %}
 
-      {# force remove #revision-toc from #content_main of parent #}
-      <script>
-        $('#revision-toc').remove();
-      </script>
+        {# force remove #revision-toc from #content_main of parent #}
+        <script>
+          $('#revision-toc').remove();
+        </script>
 
-    </div> {# /.col- #}
+      </div> {# /.col- #}
 
-    {# relocate #revision-toc #}
-    <div class="col-lg-2 col-md-3 visible-lg visible-md">
-      <div id="revision-toc" class="revision-toc"></div>
-    </div> {# /.col- #}
+      {# relocate #revision-toc #}
+      <div class="col-lg-2 col-md-3 visible-lg visible-md">
+        <div id="revision-toc" class="revision-toc" data-spy="affix" data-offset-top="100"></div>
+      </div> {# /.col- #}
 
+    </div>
   </div>
 {% endblock %}
 

+ 14 - 12
lib/views/crowi-plus/page_list.html

@@ -15,24 +15,26 @@
 
 
 {% block content_main %}
-  <div class="row">
+  <div class="container-fluid">
+    <div class="row">
 
-    <div class="col-md-10">
+      <div class="col-lg-10 col-md-9">
 
-      {% parent %}
+        {% parent %}
 
-      {# force remove #revision-toc from #content_main of parent #}
-      <script>
-        $('#revision-toc').remove();
-      </script>
+        {# force remove #revision-toc from #content_main of parent #}
+        <script>
+          $('#revision-toc').remove();
+        </script>
 
-    </div> {# /.col-md-10 #}
+      </div> {# /.col- #}
 
-    {# relocate #revision-toc #}
-    <div class="col-md-2 visible-lg visible-md">
-      <div id="revision-toc" class="revision-toc"></div>
-    </div> {# /.col-md-2 #}
+      {# relocate #revision-toc #}
+      <div class="col-lg-2 col-md-3 visible-lg visible-md">
+        <div id="revision-toc" class="revision-toc" data-spy="affix" data-offset-top="100"></div>
+      </div> {# /.col- #}
 
+    </div>
   </div>
 {% endblock %}
 

+ 38 - 0
lib/views/crowi-plus/user_page.html

@@ -0,0 +1,38 @@
+{% extends 'base/user_page_nosidebar.html' %}
+
+{% block main_css_class %}
+  {% parent %}
+{% endblock %}
+
+{% block content_head %}
+  {% parent %}
+{% endblock %} {# /content_head #}
+
+
+{% block content_main %}
+  <div class="container-fluid">
+    <div class="row">
+
+      <div class="col-lg-10 col-md-9">
+
+        {% parent %}
+
+        {# force remove #revision-toc from #content_main of parent #}
+        <script>
+          $('#revision-toc').remove();
+        </script>
+
+      </div> {# /.col- #}
+
+      {# relocate #revision-toc #}
+      <div class="col-lg-2 col-md-3 visible-lg visible-md">
+        <div id="revision-toc" class="revision-toc" data-spy="affix" data-offset-top="310"></div>
+      </div> {# /.col- #}
+
+    </div>
+  </div>
+{% endblock %}
+
+{% block content_main_after %}
+  {% include 'widget/comments.html' %}
+{% endblock %}

+ 5 - 0
lib/views/customlayout-selector/user_page.html

@@ -0,0 +1,5 @@
+{% if 'crowi-plus' === layoutType() %}
+  {% include '../crowi-plus/user_page.html' %}
+{% else %}
+  {% include '../user_page.html' %}
+{% endif %}

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

@@ -23,7 +23,7 @@
   <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
 
   <!-- jQuery -->
-  <script src="//cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
+  <script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.min.js"></script>
 
   {% if env === 'development' %}
     <script src="/dll/vendor.dll.js"></script>
@@ -41,9 +41,9 @@
   <script src="{{ webpack_asset('app').js }}" defer></script>
 
   <!-- Google Fonts -->
-  <link href='//fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
+  <link href='https://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
   <!-- Font Awesome -->
-  <link href='//cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
+  <link href='https://cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>
 
   {% block html_additional_headers %}{% endblock %}
 

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "crowi-plus",
-  "version": "1.1.5-RC",
+  "version": "1.1.6-RC",
   "description": "Enhanced Crowi",
   "tags": [
     "wiki",

BIN
public/images/admin/customize/layout-classic-thumb.gif


BIN
public/images/admin/customize/layout-classic.gif


BIN
public/images/admin/customize/layout-crowi-plus-thumb.gif


BIN
public/images/admin/customize/layout-crowi-plus.gif


+ 7 - 0
resource/css/_admin.scss

@@ -7,4 +7,11 @@
     }
   }
 
+  .content-main.admin-customize {
+    .ss-container img {
+      padding: .5em;
+      background-color: #ddd;
+    }
+  }
+
 } // }}}

+ 5 - 0
resource/css/_layout_crowi-plus.scss

@@ -0,0 +1,5 @@
+.crowi-plus.main-container {
+  .main .content-main {
+    padding: 0;
+  }
+}

+ 1 - 1
resource/css/_wiki.scss

@@ -111,7 +111,7 @@ div.body {
     }
   }
 
-/* ensure to disable in crowi-plus
+/* ensure to disable in crowi-plus system
   pre {
     line-height: 1.4em;
     font-size: .9em;

+ 1 - 0
resource/css/crowi.scss

@@ -22,6 +22,7 @@ $bootstrap-sass-asset-helper: true;
 @import 'delete';
 @import 'form';
 @import 'layout';
+@import 'layout_crowi-plus';
 @import 'page_list';
 @import 'page';
 @import 'page_crowi-plus';

+ 0 - 8
resource/js/legacy/crowi.js

@@ -74,14 +74,6 @@ Crowi.revisionToc = function(contentId, tocId) {
       });
     });
   });
-
-  // set affix when crowi-plus
-  var config = crowi.getConfig();
-  if ('crowi-plus' === config.layoutType) {
-    $tocId.affix({
-      offset: 100
-    });
-  }
 };