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

+ 1 - 1
lib/routes/page.js

@@ -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';
       }

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

@@ -0,0 +1,7 @@
+{% extends '../page.html' %}
+
+{% block content_main_after %}
+  {% if not page.isDeleted() %}
+    {% include 'widget/comments.html' %}
+  {% endif %}
+{% endblock %}

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

@@ -0,0 +1,33 @@
+<h3><i class="fa fa-comment"></i> Comments</h3>
+<div class="page-comments">
+
+  <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-main">
+        <div class="comment-write" id="comment-write">
+          <textarea class="comment-form-comment form-control" id="comment-form-comment" name="commentForm[comment]"></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() }}">
+          <span class="text-danger" id="comment-form-message"></span>
+          <input type="submit" id="comment-form-button" value="Comment" class="btn btn-primary btn-sm form-inline">
+        </div>
+      </div>
+    </div>
+  </form>
+
+</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 %}