Explorar el Código

reorganize expired shared page

Yuki Takei hace 5 años
padre
commit
88141ab422

+ 5 - 5
src/server/routes/page.js

@@ -442,17 +442,17 @@ module.exports = function(crowi, app) {
       return res.render(`layout-${layoutName}/not_found_shared_page`);
     }
 
-    let page = shareLink.relatedPage;
+    const renderVars = {};
+
+    renderVars.sharelink = shareLink;
 
     // check if share link is expired
     if (shareLink.isExpired()) {
       // page is not found
-      return res.render(`layout-${layoutName}/expired_shared_page`);
+      return res.render(`layout-${layoutName}/expired_shared_page`, renderVars);
     }
 
-    const renderVars = {};
-
-    renderVars.sharelink = shareLink;
+    let page = shareLink.relatedPage;
 
     // presentation mode
     if (req.query.presentation) {

+ 17 - 7
src/server/views/layout-growi/expired_shared_page.html

@@ -1,13 +1,23 @@
 {% extends './shared_page.html' %}
 
-{% block content_header %}
+{% block html_title %}
+  {{ customizeService.generateCustomTitle('Page is expired') }}
 {% endblock %}
 
-{% block content_page %}
-  <div class="col-md-12">
-    <h2 class="text-muted">
-      <i class="icon-ban" aria-hidden="true"></i>
-      Page is expired
-    </h2>
+{% block content_main %}
+  <div class="container-lg">
+
+    <div
+      id="is-shared-page"
+      data-share-link-expired-at="{% if sharelink.expiredAt %}{{ sharelink.expiredAt|datetz('Y/m/d H:i:s')}}{% endif %}"
+      data-share-link-created-at="{{ sharelink.createdAt|datetz('Y/m/d H:i:s')}}"
+    >
+      <div id="share-link-alert"></div>
+      <h2 class="text-muted">
+        <i class="icon-ban" aria-hidden="true"></i>
+        Page is expired
+      </h2>
+    </div>
+
   </div>
 {% endblock %}