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

Merge pull request #610 from weseek/feat/gc-939-gc988-990_recentCreated

gc939-gc988-990_recentCreated
Yuki Takei 7 лет назад
Родитель
Сommit
9352866a4f

+ 12 - 0
src/client/js/app.js

@@ -33,6 +33,7 @@ import RevisionPath     from './components/Page/RevisionPath';
 import RevisionUrl      from './components/Page/RevisionUrl';
 import BookmarkButton   from './components/BookmarkButton';
 import NewPageNameInput from './components/NewPageNameInput';
+import RecentCreated from './components/RecentCreated/RecentCreated';
 
 import CustomCssEditor  from './components/Admin/CustomCssEditor';
 import CustomScriptEditor from './components/Admin/CustomScriptEditor';
@@ -327,6 +328,17 @@ if (savePageControlsElem) {
   componentInstances.savePageControls = savePageControls;
 }
 
+// RecentCreated dev GC-939 start
+const recentCreatedControlsElem = document.getElementById('user-created-list');
+if (recentCreatedControlsElem) {
+  ReactDOM.render(
+    <RecentCreated >
+
+    </RecentCreated>, document.getElementById('user-created-list')
+  );
+}
+// RecentCreated dev GC-939 end
+
 /*
  * HackMD Editor
  */

+ 107 - 0
src/client/js/components/RecentCreated/RecentCreated.js

@@ -0,0 +1,107 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+//import { Pagination }  from 'react-js-pagination';
+import Pagination from 'react-bootstrap/lib/Pagination';
+export default class RecentCreated extends React.Component {
+
+  render() {
+    const testval = null;
+    let active = 7;
+    let items = [];
+    for (let number = 1; number <= 10; number++) {
+      items.push(
+        <Pagination.Item active={number === active}>{number}</Pagination.Item>
+      );
+    }
+    return (
+      <div className="page-list-container-create">
+        <ul className="page-list-ul page-list-ul-flat">
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest1
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest2
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest3
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest4
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest5
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest6
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox/Bootstrap3" className="page-list-link" data-path="/Sandbox/Bootstrap3" data-short-path="Bootstrap3">/reactTest7
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/" className="page-list-link" data-path="/" data-short-path="">/
+            </a>
+            <span className="page-list-meta">
+              <span className="label label-info">RE</span>
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+
+            <a href="/user/tsuyoshi" className="page-list-link" data-path="/user/tsuyoshi" data-short-path="tsuyoshi">/user/tsuyoshi/GC-939
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+          <li>
+            <img src="/images/icons/user.svg" className="picture img-circle" ></img>
+            <a href="/Sandbox" className="page-list-link" data-path="/Sandbox" data-short-path="/Sandbox">/ReactComponentTest
+            </a>
+            <span className="page-list-meta">
+            </span>
+          </li>
+        </ul>
+        <Pagination bsSize="small">{items}</Pagination>
+      </div>
+    );
+  }
+}
+
+RecentCreated.propTypes = {
+};
+
+RecentCreated.defaultProps = {
+  page: {},
+  linkTo: '',
+  excludePathString: '',
+};
+

+ 0 - 5
src/server/views/widget/user_page_content.html

@@ -27,11 +27,6 @@
 
     <div class="tab-pane user-created-list page-list" id="user-created-list">
       <div class="page-list-container">
-        {% if createdList.length == 0 %}
-        No created pages yet.
-        {% else %}
-          {% include 'page_list.html' with { pages: createdList } %}
-        {% endif %}
       </div>
     </div>
   </div>