Răsfoiți Sursa

move alert for not found page

Yuki Takei 4 ani în urmă
părinte
comite
58afe9c166

+ 0 - 7
packages/app/src/server/routes/page.js

@@ -302,10 +302,6 @@ module.exports = function(crowi, app) {
     renderVars.shortBodyMap = shortBodyMap;
     renderVars.shortBodyMap = shortBodyMap;
   }
   }
 
 
-  function addRenderVarsWhenNotCreatableOrForbidden(renderVars) {
-    renderVars.isAlertHidden = true;
-  }
-
   function replacePlaceholdersOfTemplate(template, req) {
   function replacePlaceholdersOfTemplate(template, req) {
     if (req.user == null) {
     if (req.user == null) {
       return '';
       return '';
@@ -329,11 +325,9 @@ module.exports = function(crowi, app) {
     const renderVars = { path };
     const renderVars = { path };
 
 
     if (!isCreatablePage(path)) {
     if (!isCreatablePage(path)) {
-      addRenderVarsWhenNotCreatableOrForbidden(renderVars);
       view = 'layout-growi/not_creatable';
       view = 'layout-growi/not_creatable';
     }
     }
     else if (req.isForbidden) {
     else if (req.isForbidden) {
-      addRenderVarsWhenNotCreatableOrForbidden(renderVars);
       view = 'layout-growi/forbidden';
       view = 'layout-growi/forbidden';
     }
     }
     else {
     else {
@@ -527,7 +521,6 @@ module.exports = function(crowi, app) {
       return res.render('layout-growi/not_found_shared_page');
       return res.render('layout-growi/not_found_shared_page');
     }
     }
     if (crowi.configManager.getConfig('crowi', 'security:disableLinkSharing')) {
     if (crowi.configManager.getConfig('crowi', 'security:disableLinkSharing')) {
-      addRenderVarsWhenNotCreatableOrForbidden(renderVars);
       return res.render('layout-growi/forbidden');
       return res.render('layout-growi/forbidden');
     }
     }
 
 

+ 1 - 0
packages/app/src/server/views/layout-growi/not_found.html

@@ -10,6 +10,7 @@
   </div>
   </div>
   <div class="grw-container-convertible">
   <div class="grw-container-convertible">
     {% include '../widget/page_alerts.html' %}
     {% include '../widget/page_alerts.html' %}
+    <div id="not-found-alert"></div>
   </div>
   </div>
 {% endblock %}
 {% endblock %}
 
 

+ 0 - 3
packages/app/src/server/views/widget/page_alerts.html

@@ -76,8 +76,5 @@
     {% if isTrashPage() %}
     {% if isTrashPage() %}
       <div id="trash-page-alert"></div>
       <div id="trash-page-alert"></div>
     {% endif %}
     {% endif %}
-    {% if page == null and !isAlertHidden %}
-      <div id="not-found-alert"></div>
-    {% endif %}
   </div>
   </div>
 </div>
 </div>