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

add user_page for crowi-plus layout type

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

+ 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) {

+ 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 #}

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

@@ -0,0 +1,36 @@
+{% extends 'base/user_page_nosidebar.html' %}
+
+{% block main_css_class %}
+  {% parent %}
+{% endblock %}
+
+{% block content_head %}
+  {% parent %}
+{% 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" data-spy="affix" data-offset-top="310"></div>
+    </div> {# /.col- #}
+
+  </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 %}