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

Merge pull request #67 from weseek/master

release 1.1.4
Yuki Takei 9 лет назад
Родитель
Сommit
a8d184e437

+ 5 - 0
CHANGES.md

@@ -1,6 +1,11 @@
 CHANGES
 ========
 
+## 1.1.4
+
+* Feature: Ensure to select layout type from Admin Page
+* Feature: Add crowi-plus Enhanced Layout
+
 ## 1.1.3
 
 * Improvement: Use POSIX-style paths (bollowed crowi/crowi#219 by @Tomasom)

+ 9 - 0
lib/form/admin/customlayout.js

@@ -0,0 +1,9 @@
+'use strict';
+
+var form = require('express-form')
+  , field = form.field
+  ;
+
+module.exports = form(
+  field('settingForm[customize:layout]')
+);

+ 1 - 0
lib/form/index.js

@@ -19,6 +19,7 @@ module.exports = {
     plugin: require('./admin/plugin'),
     markdown: require('./admin/markdown'),
     customcss: require('./admin/customcss'),
+    customlayout: require('./admin/customlayout'),
     userInvite: require('./admin/userInvite'),
     slackSetting: require('./admin/slackSetting'),
   },

+ 7 - 0
lib/models/config.js

@@ -46,6 +46,7 @@ module.exports = function(crowi) {
       'plugin:isEnabledPlugins' : true,
 
       'customize:css' : '',
+      'customize:layout' : 'crowi',
     };
   }
 
@@ -253,6 +254,11 @@ module.exports = function(crowi) {
     return this.uglifiedCustomCss;
   }
 
+  configSchema.statics.layoutType = function(config)
+  {
+    return config.crowi['customize:layout'] || 'crowi';
+  }
+
   configSchema.statics.fileUploadEnabled = function(config)
   {
     const Config = this;
@@ -303,6 +309,7 @@ module.exports = function(crowi) {
         image: Config.isUploadable(config),
         file: Config.fileUploadEnabled(config),
       },
+      layoutType: Config.layoutType(config),
     };
 
     return local_config;

+ 3 - 2
lib/routes/admin.js

@@ -68,7 +68,9 @@ module.exports = function(crowi, app) {
   }
 
   actions.index = function(req, res) {
-    return res.render('admin/index');
+    return res.render('admin/index', {
+      plugins: pluginUtils.listPlugins(crowi.rootDir),
+    });
   };
 
   // app.get('/admin/app'                  , admin.app.index);
@@ -79,7 +81,6 @@ module.exports = function(crowi, app) {
 
     return res.render('admin/app', {
       settingForm: settingForm,
-      plugins: pluginUtils.listPlugins(crowi.rootDir),
     });
   };
 

+ 2 - 1
lib/routes/comment.js

@@ -54,7 +54,8 @@ module.exports = function(crowi, app) {
     var form = req.form.commentForm;
 
     if (!req.form.isValid) {
-      return res.json(ApiResponse.error('Invalid comment.'));
+      // return res.json(ApiResponse.error('Invalid comment.'));
+      return res.json(ApiResponse.error('コメントを入力してください。'));
     }
 
     var pageId = form.page_id;

+ 3 - 2
lib/routes/index.js

@@ -52,8 +52,9 @@ module.exports = function(crowi, app) {
   app.post('/admin/markdown/lineBreaksSetting', loginRequired(crowi, app) , middleware.adminRequired() , csrf, form.admin.markdown, admin.markdown.lineBreaksSetting);
 
   // markdown admin
-  app.get('/admin/customize'            , loginRequired(crowi, app) , middleware.adminRequired() , admin.customize.index);
-  app.post('/_api/admin/customize/css'  , loginRequired(crowi, app) , middleware.adminRequired() , csrf, form.admin.customcss, admin.api.customizeSetting);
+  app.get('/admin/customize'              , loginRequired(crowi, app) , middleware.adminRequired() , admin.customize.index);
+  app.post('/_api/admin/customize/css'    , loginRequired(crowi, app) , middleware.adminRequired() , csrf, form.admin.customcss, admin.api.customizeSetting);
+  app.post('/_api/admin/customize/layout' , loginRequired(crowi, app) , middleware.adminRequired() , csrf, form.admin.customlayout, admin.api.customizeSetting);
 
   // search admin
   app.get('/admin/search'              , loginRequired(crowi, app) , middleware.adminRequired() , admin.search.index);

+ 4 - 4
lib/routes/page.js

@@ -113,7 +113,7 @@ module.exports = function(crowi, app) {
       };
       renderVars.pager = generatePager(pagerOptions);
       renderVars.pages = pageList;
-      res.render('page_list', renderVars);
+      res.render('customlayout-selector/page_list', renderVars);
     }).catch(function(err) {
       debug('Error on rendering pageListShow', err);
     });
@@ -152,7 +152,7 @@ module.exports = function(crowi, app) {
 
       renderVars.pager = generatePager(pagerOptions);
       renderVars.pages = pageList;
-      res.render('page_list', renderVars);
+      res.render('customlayout-selector/page_list', renderVars);
     }).catch(function(err) {
       debug('Error on rendering deletedPageListShow', err);
     });
@@ -178,7 +178,7 @@ module.exports = function(crowi, app) {
       return Page.findListByPageIds(ids);
     }).then(function(pages) {
 
-      res.render('page_list', {
+      res.render('customlayout-selector/page_list', {
         path: '/',
         pages: pages,
         pager: generatePager({offset: 0, limit: 50})
@@ -243,7 +243,7 @@ module.exports = function(crowi, app) {
     }).then(function() {
       return interceptorManager.process('beforeRenderPage', req, res, renderVars);
     }).then(function() {
-      var defaultPageTeamplate = 'page';
+      var defaultPageTeamplate = 'customlayout-selector/page';
       if (userData) {
         defaultPageTeamplate = 'user_page';
       }

+ 5 - 0
lib/util/swigFunctions.js

@@ -55,6 +55,11 @@ module.exports = function(crowi, app, req, locals) {
     return Config.customCss();
   }
 
+  locals.layoutType = function() {
+    var config = crowi.getConfig()
+    return Config.layoutType(config);
+  }
+
   locals.slackConfigured = function() {
     var config = crowi.getConfig()
     if (Config.hasSlackToken(config)) {

+ 0 - 20
lib/views/admin/app.html

@@ -288,26 +288,6 @@
       </fieldset>
       </form>
 
-      <h4>インストールされているプラグイン一覧</h4>
-      <table class="table table-bordered">
-        <th class="text-center">
-          パッケージ名
-        </th>
-        <th class="text-center">
-          指定バージョン
-        </th>
-        <th class="text-center">
-          インストールされているバージョン
-        </th>
-        {% for pluginName in Object.keys(plugins) %}
-        <tr>
-          <td>{{ pluginName }}</td>
-          <td class="text-center">{{ plugins[pluginName] }}</td>
-          <td class="text-center">(TBD)</td>
-        </tr>
-        {% endfor %}
-      </table>
-
     </div>
   </div>
 

+ 35 - 1
lib/views/admin/customize.html

@@ -45,6 +45,40 @@
     </div>
     <div class="col-md-9">
 
+      <form action="/_api/admin/customize/layout" method="post" class="form-horizontal" id="cutomlayoutSettingForm" role="form">
+      <fieldset>
+        <legend>レイアウト</legend>
+
+        <div class="form-group">
+          <div class="col-xs-6">
+            <h4>
+              <input type="radio" name="settingForm[customize:layout]" value="crowi"
+                  {% 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>
+          </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
+            </h4>
+            <a href="http://placehold.it"><img src="http://placehold.it/350x150"></a>
+          </div>
+        </div>
+
+        <div class="form-group">
+          <div class="col-xs-offset-5 col-xs-6">
+            <input type="hidden" name="_csrf" value="{{ csrf() }}">
+            <button type="submit" class="btn btn-primary">更新</button>
+          </div>
+        </div>
+
+      </fieldset>
+      </form>
+
+
       <form action="/_api/admin/customize/css" method="post" class="form-horizontal" id="cutomcssSettingForm" role="form">
       <fieldset>
         <legend>カスタムCSS</legend>
@@ -80,7 +114,7 @@
   </div>
 
   <script>
-    $('#cutomcssSettingForm').each(function() {
+    $('#cutomcssSettingForm, #cutomlayoutSettingForm').each(function() {
       $(this).submit(function()
       {
         function showMessage(formId, msg, status) {

+ 20 - 0
lib/views/admin/index.html

@@ -49,6 +49,26 @@
           <td>{{ yarnVersion() }}</td>
         </tr>
       </table>
+
+      <h3>インストールされているプラグイン一覧</h3>
+      <table class="table table-bordered">
+        <th class="text-center">
+          パッケージ名
+        </th>
+        <th class="text-center">
+          指定バージョン
+        </th>
+        <th class="text-center">
+          インストールされているバージョン
+        </th>
+        {% for pluginName in Object.keys(plugins) %}
+        <tr>
+          <td>{{ pluginName }}</td>
+          <td class="text-center">{{ plugins[pluginName] }}</td>
+          <td class="text-center">(TBD)</td>
+        </tr>
+        {% endfor %}
+      </table>
     </div>
   </div>
 

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

@@ -0,0 +1,42 @@
+{% extends '../../page_list.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 #}

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

@@ -0,0 +1,42 @@
+{% extends '../../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 #}

+ 43 - 0
lib/views/crowi-plus/page.html

@@ -0,0 +1,43 @@
+{% extends 'base/page_nosidebar.html' %}
+
+
+{% block content_head %}
+
+  {% block content_head_before %}
+  {% endblock %}
+
+  {% include 'widget/header.html' %}
+
+  {% block content_head_after %}
+  {% endblock %}
+
+{% endblock %} {# /content_head #}
+
+
+{% block content_main %}
+  <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"></div>
+    </div> {# /.col- #}
+
+  </div>
+{% endblock %}
+
+{% block content_main_after %}
+  {% if not page.isDeleted() %}
+    {% include 'widget/comments.html' %}
+  {% endif %}
+{% endblock %}

+ 43 - 0
lib/views/crowi-plus/page_list.html

@@ -0,0 +1,43 @@
+{% extends 'base/page_list_nosidebar.html' %}
+
+
+{% block content_head %}
+
+  {% block content_head_before %}
+  {% endblock %}
+
+  {% include 'widget/header.html' %}
+
+  {% block content_head_after %}
+  {% endblock %}
+
+{% endblock %} {# /content_head #}
+
+
+{% block content_main %}
+  <div class="row">
+
+    <div class="col-md-10">
+
+      {% parent %}
+
+      {# force remove #revision-toc from #content_main of parent #}
+      <script>
+        $('#revision-toc').remove();
+      </script>
+
+    </div> {# /.col-md-10 #}
+
+    {# relocate #revision-toc #}
+    <div class="col-md-2 visible-lg visible-md">
+      <div id="revision-toc" class="revision-toc"></div>
+    </div> {# /.col-md-2 #}
+
+  </div>
+{% endblock %}
+
+{% block content_main_after %}
+  {% if not page.isDeleted() %}
+    {% include 'widget/comments.html' %}
+  {% endif %}
+{% endblock %}

+ 46 - 0
lib/views/crowi-plus/widget/comments.html

@@ -0,0 +1,46 @@
+<div class="page-comments-row row">
+
+  <div class="page-comments col-lg-7 col-md-9">
+
+    <h4><i class="fa fa-comments"></i> Comments</h4>
+
+    <div class="page-comments-list" id="page-comments-list">
+      <div class="page-comments-list-newer collapse" id="page-comments-list-newer"></div>
+
+      <a class="page-comments-list-toggle-newer text-center" data-toggle="collapse" href="#page-comments-list-newer"><i class="fa fa-angle-double-up"></i> Comments for Newer Revision <i class="fa fa-angle-double-up"></i></a>
+
+      <div class="page-comments-list-current" id="page-comments-list-current"></div>
+
+      <a class="page-comments-list-toggle-older text-center" data-toggle="collapse" href="#page-comments-list-older"><i class="fa fa-angle-double-down"></i> Comments for Older Revision <i class="fa fa-angle-double-down"></i></a>
+
+      <div class="page-comments-list-older collapse in" id="page-comments-list-older"></div>
+    </div>
+
+    <form class="form page-comment-form" id="page-comment-form" onsubmit="return false;">
+      <div class="comment-form">
+        <div class="comment-form-user">
+            <img src="{{ user|picture }}" class="picture picture-rounded" width="25" alt="{{ user.name }}" title="{{ user.name }}" />
+        </div>
+        <div class="comment-form-main">
+          <div class="comment-write" id="comment-write">
+            <textarea class="comment-form-comment form-control" id="comment-form-comment" name="commentForm[comment]" rows="10" placeholder="コメントを入力してください。"></textarea>
+          </div>
+          <div class="comment-submit">
+            <input type="hidden" name="_csrf" value="{{ csrf() }}">
+            <input type="hidden" name="commentForm[page_id]" value="{{ page._id.toString() }}">
+            <input type="hidden" name="commentForm[revision_id]" value="{{ revision._id.toString() }}">
+            <div class="pull-right">
+              <span class="text-danger" id="comment-form-message"></span>
+              <button type="submit" id="comment-form-button" class="btn btn-primary form-inline">
+                <i class="fa fa-comment comment-ico" aria-hidden="true"></i>Comment
+              </button>
+            </div>
+            <div class="clearfix"></div>
+          </div>
+        </div>
+      </div>
+    </form>
+
+  </div>
+
+</div>

+ 71 - 0
lib/views/crowi-plus/widget/header.html

@@ -0,0 +1,71 @@
+<div class="header-wrap">
+  {% if not page.isDeleted() %}
+  <header id="page-header">
+    <p class="stopper"><a href="#" data-affix-disable="#page-header"><i class="fa fa-chevron-up"></i></a></p>
+
+    <div class="flex-title-line">
+      <div>
+        <h1 class="title flex-item-title" id="revision-path"></h1>
+        <div id="revision-url" class="url-line"></div>
+      </div>
+      {% if page %}
+      <div class="flex-item-action">
+        <span id="bookmark-button">
+          <p class="bookmark-link">
+            <i class="fa fa-star-o"></i>
+          </p>
+        </span>
+      </div>
+      <div class="flex-item-action visible-xs visible-sm">
+        <button
+            data-csrftoken="{{ csrf() }}"
+            data-liked="{% if page.isLiked(user) %}1{% else %}0{% endif %}"
+            class="like-button btn btn-default btn-sm {% if page.isLiked(user) %}active{% endif %}"
+        ><i class="fa fa-thumbs-o-up"></i></button>
+      </div>
+
+      <ul class="authors visible-md visible-lg">
+        <li>
+          <div class="creator-picture">
+            <a href="{{ userPageRoot(page.creator) }}">
+              <img src="{{ page.creator|default(author)|picture }}" class="picture picture-rounded"><br>
+            </a>
+          </div>
+          <div class="">
+            <div>Created by <a href="{{ userPageRoot(page.creator) }}">{{ page.creator.name|default(author.name) }}</a></div>
+            <div class="text-muted">{{ page.createdAt|datetz('Y/m/d H:i:s') }}</div>
+          </div>
+        </li>
+        <li>
+          <div class="creator-picture">
+            <a href="{{ userPageRoot(page.lastUpdateUser) }}">
+              <img src="{{ page.lastUpdateUser|default(author)|picture }}" class="picture picture-rounded"><br>
+            </a>
+          </div>
+          <div class="">
+            <div>Updated by <a href="{{ userPageRoot(page.lastUpdateUser) }}">{{ page.lastUpdateUser.name|default(author.name) }}</a></div>
+            <div class="text-muted">{{ page.updatedAt|datetz('Y/m/d H:i:s') }}</div>
+          </div>
+        </li>
+      </ul>
+      {% endif %}
+
+    </div>
+
+  </header>
+  {% else %}
+  {# trash/* #}
+  <header id="page-header">
+    <div class="flex-title-line">
+      <h1 class="title flex-item-title"></h1>
+      <div class="flex-item-action">
+        <span id="bookmark-button">
+          <p class="bookmark-link">
+            <i class="fa fa-star-o"></i>
+          </a>
+        </span>
+      </div>
+    </div>
+  </header>
+  {% endif %}
+</div>

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

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

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

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

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

@@ -19,8 +19,9 @@
   <div id="footer-container" class="footer">
     <footer class="">
       <p>
-      <a href="" data-target="#help-modal" data-toggle="modal"><i class="fa fa-question-circle"></i> {{ t('Help') }}</a>
-      &copy; {{ now|date('Y') }} crowi-plus {{ crowiVersion() }} <img src="/logo/100x11_g.png" alt="powered by Crowi"> </p>
+        <a href="" data-target="#help-modal" data-toggle="modal"><i class="fa fa-question-circle"></i> {{ t('Help') }}</a>
+        <a href="https://github.com/weseek/crowi-plus">crowi-plus</a> {{ crowiVersion() }}
+      </p>
     </footer>
   </div>
 </aside>

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

@@ -55,7 +55,7 @@
 
 {% block html_body %}
 <body
-  class="crowi main-container {% block html_base_css %}{% endblock %}"
+  class="crowi main-container {% 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 %}

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

@@ -20,8 +20,9 @@
 <div id="footer-container" class="footer">
   <footer class="">
     <p>
-    <a href="" data-target="#help-modal" data-toggle="modal"><i class="fa fa-question-circle"></i> {{ t('Help') }}</a>
-    &copy; {{ now|date('Y') }} crowi-plus {{ crowiVersion() }} <img src="/logo/100x11_g.png" alt="powered by Crowi"> </p>
+      <a href="" data-target="#help-modal" data-toggle="modal"><i class="fa fa-question-circle"></i> {{ t('Help') }}</a>
+      <a href="https://github.com/weseek/crowi-plus">crowi-plus</a> {{ crowiVersion() }}
+    </p>
   </footer>
 </div>
 {% endblock %}

+ 1 - 1
lib/views/page.html

@@ -210,7 +210,7 @@
     {# formatted text #}
     <div class="tab-pane {% if not req.body.pageForm %}active{% endif %}" id="revision-body">
       <div class="revision-toc" id="revision-toc">
-        <a data-toggle="collapse" data-parent="#revision-toc" href="#revision-toc-content" class="revision-toc-head collapsed">{{ t('Table of Contents') }}</a>
+        <a data-toggle="collapse" data-parent="#revision-toc" href="#revision-toc-content" class="revision-toc-head">{{ t('Table of Contents') }}</a>
 
       </div>
       <div class="wiki" id="revision-body-content"></div>

+ 1 - 1
package.json

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

+ 101 - 0
resource/css/_comment_crowi-plus.scss

@@ -0,0 +1,101 @@
+.crowi-plus.main-container  {
+
+  .page-comments-row {
+    border-top: 5px solid #f0f0f0;
+    margin: 30px 16px;
+  }
+
+  .page-comments {
+    h4 {
+      margin-bottom: 1em;
+    }
+  }
+
+  .page-comment {
+    position: relative;
+
+    // ユーザーアイコン
+    .picture.picture-rounded {
+      position: absolute;
+      top: 1em;
+      width: 3em;
+      height: 3em;
+    }
+
+    // コメントセクション
+    .page-comment-main {
+      background: #f5f5f5;
+      padding: 1em;
+      position: relative;
+      margin-left: 4.5em;
+      margin-bottom: 1em;
+      border-radius: 3px;
+      &:before {
+        border: 2em solid transparent;
+        border-right-color:#f5f5f5;
+        border-left-width: 0;
+        left: -1em;
+        content: "";
+        display: block;
+        top: 0.5em;
+        position: absolute;
+        width: 0;
+      }
+    }
+
+    // コメント本文
+    .page-comment-body {
+      margin-bottom: 0.5em;
+    }
+
+    // ユーザー名
+    .page-comment-creator {
+      margin-bottom: 0.5em;
+    }
+  }
+
+  .comment-form {
+    position: relative;
+    margin-top: 2em;
+    // ユーザーアイコン
+    .picture.picture-rounded {
+      position: absolute;
+      top: 1em;
+      width: 3em;
+      height: 3em;
+    }
+
+    // コメントフォームセクション
+    .comment-form-main {
+      margin-left: 4.5em;
+      margin-bottom: 1em;
+      background: #f5f5f5;
+      padding: 1em;
+      position: relative;
+      border-radius: 3px;
+      &:before {
+        border: 2em solid transparent;
+        border-right-color:#f5f5f5;
+        border-left-width: 0;
+        left: -1em;
+        content: "";
+        display: block;
+        top: 0.5em;
+        position: absolute;
+        width: 0;
+      }
+    }
+
+    // コメントの吹き出しアイコン
+    .comment-ico {
+      font-size: 1.2em;
+      margin-right: 0.3em;
+      opacity: 0.6;
+    }
+
+    // コメント入力フォーム
+    .comment-write {
+      margin-bottom: 0.5em;
+    }
+  }
+}

+ 36 - 0
resource/css/_page_crowi-plus.scss

@@ -0,0 +1,36 @@
+.crowi-plus.main-container {
+  .flex-title-line {
+
+    // the container of h1
+    div:first-child {
+      margin-right: auto;
+    }
+
+    ul.authors {
+      margin: 0;
+
+      li {
+        display: flex;
+        list-style: none;
+        font-size: 12px;
+
+        .creator-picture {
+          width: 24px;
+          height: 24px;
+          margin-right: 10px;
+        }
+      }
+
+      li:first-child {
+        margin-bottom: 10px;
+      }
+    }
+  }
+
+  // hide authors from affix
+  .main #page-header.affix {
+    .authors {
+      display: none !important;
+    }
+  }
+}

+ 19 - 0
resource/css/_wiki_crowi-plus.scss

@@ -0,0 +1,19 @@
+.crowi-plus .revision-toc {
+
+  // reset official styles
+  float: none;
+  border: none;
+  border-radius: 0;
+  max-width: none;
+  overflow: auto;
+
+  .revision-toc-content {
+    margin-top: 50px;
+    background: none;
+  }
+
+  // affix
+  &.affix {
+    top: 30px;
+  }
+}

+ 3 - 0
resource/css/crowi.scss

@@ -18,15 +18,18 @@ $bootstrap-sass-asset-helper: true;
 @import 'admin';
 @import 'attachments';
 @import 'comment';
+@import 'comment_crowi-plus';
 @import 'delete';
 @import 'form';
 @import 'layout';
 @import 'page_list';
 @import 'page';
+@import 'page_crowi-plus';
 @import 'portal';
 @import 'search';
 @import 'user';
 @import 'wiki';
+@import 'wiki_crowi-plus';
 
 
 ul {

+ 12 - 3
resource/js/legacy/crowi.js

@@ -3,7 +3,7 @@
 */
 
 var io = require('socket.io-client');
-
+var moment = require("moment");
 require('bootstrap-sass');
 require('jquery.cookie');
 
@@ -34,7 +34,7 @@ Crowi.revisionToc = function(contentId, tocId) {
   var $content = $(contentId || '#revision-body-content');
   var $tocId = $(tocId || '#revision-toc');
 
-  var $tocContent = $('<div id="revision-toc-content" class="revision-toc-content collapse"></div>');
+  var $tocContent = $('<div id="revision-toc-content" class="revision-toc-content collapse in"></div>');
   $tocId.append($tocContent);
 
   $('h1', $content).each(function(idx, elm) {
@@ -74,6 +74,14 @@ Crowi.revisionToc = function(contentId, tocId) {
       });
     });
   });
+
+  // set affix when crowi-plus
+  var config = crowi.getConfig();
+  if ('crowi-plus' === config.layoutType) {
+    $tocId.affix({
+      offset: 100
+    });
+  }
 };
 
 
@@ -500,7 +508,8 @@ $(function() {
       }
 
       var $commentMeta = $('<div class="page-comment-meta">')
-        .text(commentedAt + ' ')
+        //日付変換
+        .text(moment(commentedAt).format('YYYY/MM/DD HH:mm:ss') + ' ')
         .append($commentRevision);
 
       var $commentBody = $('<div class="page-comment-body">')