Sotaro KARASAWA 10 лет назад
Родитель
Сommit
d91295974e
4 измененных файлов с 26 добавлено и 4 удалено
  1. 3 0
      lib/routes/index.js
  2. 10 0
      lib/routes/page.js
  3. 3 2
      lib/views/page.html
  4. 10 2
      lib/views/user_page.html

+ 3 - 0
lib/routes/index.js

@@ -73,6 +73,9 @@ module.exports = function(crowi, app) {
   app.post('/_api/attachment/page/:pageId', loginRequired(crowi, app) , attachment.api.add);
   app.post('/_api/attachment/:id/remove',loginRequired(crowi, app), attachment.api.remove);
 
+  app.get( '/user/:username([^/]+)/bookmarks'      , loginRequired(crowi, app) , page.userBookmarkList);
+  app.get( '/user/:username([^/]+)/recent-create'  , loginRequired(crowi, app) , page.userRecentCreatedList);
+
   // HTTP RPC Styled API (に徐々に移行していいこうと思う)
   app.get('/_api/users.list'          , accessTokenParser(crowi, app) , loginRequired(crowi, app) , user.api.list);
   app.get('/_api/pages.get'           , accessTokenParser(crowi, app) , loginRequired(crowi, app) , page.api.get);

+ 10 - 0
lib/routes/page.js

@@ -251,6 +251,16 @@ module.exports = function(crowi, app) {
     });
   };
 
+  // app.get( '/users/:username([^/]+)/bookmarks'      , loginRequired(crowi, app) , page.userBookmarkList);
+  actions.userBookmarkList = function(req, res) {
+    var username = req.params.username;
+  };
+
+  // app.get( '/users/:username([^/]+)/recent-created' , loginRequired(crowi, app) , page.userRecentCreatedList);
+  actions.userRecentCreatedList = function(req, res) {
+    var username = req.params.username;
+  };
+
   var api = actions.api = {};
 
   /**

+ 3 - 2
lib/views/page.html

@@ -197,8 +197,9 @@
 </div>
 
 <p class="meta">
-  Path: <span id="pagePath">{{ page.path }}</span><br />
-  Last updated at {{ page.updatedAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.creator|default(author)|picture }}" class="picture picture-rounded"> {{ page.creator.name|default(author.name) }}
+  Path: <span id="pagePath">{{ page.path }}</span><br>
+  Last updated at {{ page.revision.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.revision.author|picture }}" class="picture picture-rounded"> {{ page.revision.author.name }}<br>
+  Created at {{ page.createdAt|datetz('Y-m-d H:i:s') }} by <img src="{{ page.creator|default(page.creator)|picture }}" class="picture picture-rounded"> {{ page.creator.name }}<br>
 </p>
 
 {% endblock %}

+ 10 - 2
lib/views/user_page.html

@@ -46,8 +46,12 @@
         <div class="page-list-container">
           {% if bookmarkList.length == 0 %}
           No bookmarks yet.
+          {% else %}
+            {% include 'widget/page_list.html' with { pages: bookmarkList } %}
+            <div class="user-page-list-additional-link">
+              <a href="/user/{{ pageUser.username }}/bookmarks"><i class="fa fa-angle-double-right"></i> See bookmarks</a>
+            </div>
           {% endif %}
-          {% include 'widget/page_list.html' with { pages: bookmarkList } %}
         </div>
       </div>
 
@@ -55,8 +59,12 @@
         <div class="page-list-container">
           {% if createdList.length == 0 %}
           No created pages yet.
+          {% else %}
+            {% include 'widget/page_list.html' with { pages: createdList } %}
+            <div class="user-page-list-additional-link">
+              <a href="/user/{{ pageUser.username }}/recent-created"><i class="fa fa-angle-double-right"></i> See created pages</a>
+            </div>
           {% endif %}
-          {% include 'widget/page_list.html' with { pages: createdList } %}
         </div>
       </div>
     </div>