Browse Source

Improved the state immediately after installation

* create portal page for '/'
* ensure to be able to create portal even if set 'crowi-plus Simplified Behavior' only when path is '/'
Yuki Takei 8 years ago
parent
commit
f396fea41e
2 changed files with 5 additions and 1 deletions
  1. 4 0
      lib/routes/installer.js
  2. 1 1
      lib/views/crowi-plus/widget/header.html

+ 4 - 0
lib/routes/installer.js

@@ -5,6 +5,7 @@ module.exports = function(crowi, app) {
     , models = crowi.models
     , models = crowi.models
     , Config = models.Config
     , Config = models.Config
     , User = models.User
     , User = models.User
+    , Page = models.Page
 
 
     , actions = {};
     , actions = {};
 
 
@@ -41,6 +42,9 @@ module.exports = function(crowi, app) {
             req.flash('successMessage', 'Crowi のインストールが完了しました!はじめに、このページでこの Wiki の各種設定を確認してください。');
             req.flash('successMessage', 'Crowi のインストールが完了しました!はじめに、このページでこの Wiki の各種設定を確認してください。');
             return res.redirect('/admin/app');
             return res.redirect('/admin/app');
           });
           });
+
+          // create portal page for '/'
+          Page.create('/', '# Welcome to crowi-plus!', userData, {});
         });
         });
       });
       });
     } else {
     } else {

+ 1 - 1
lib/views/crowi-plus/widget/header.html

@@ -56,7 +56,7 @@
       </ul>
       </ul>
       {% endif %}
       {% endif %}
 
 
-      {% if not page and ('crowi' === behaviorType()) and not isUserPageList(path) and !isTrashPage() %}
+      {% if not page and ('/' === path or 'crowi' === behaviorType()) and not isUserPageList(path) and !isTrashPage() %}
       <div class="portal-form-button">
       <div class="portal-form-button">
         <button class="btn btn-primary" id="create-portal-button" {% if not user %}disabled{% endif %}>Create Portal</button>
         <button class="btn btn-primary" id="create-portal-button" {% if not user %}disabled{% endif %}>Create Portal</button>
         <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="fa fa-question-circle"></i> What is Portal?</a></p>
         <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="fa fa-question-circle"></i> What is Portal?</a></p>