Răsfoiți Sursa

move tag form component

yusuketk 7 ani în urmă
părinte
comite
f7344e7025

+ 3 - 1
src/client/js/app.js

@@ -27,6 +27,7 @@ import PageAttachment   from './components/PageAttachment';
 import PageStatusAlert  from './components/PageStatusAlert';
 import SeenUserList     from './components/SeenUserList';
 import RevisionPath     from './components/Page/RevisionPath';
+import PageTagForm      from './components/PageTagForm';
 import RevisionUrl      from './components/Page/RevisionUrl';
 import BookmarkButton   from './components/BookmarkButton';
 import PagePathAutoComplete from './components/PagePathAutoComplete';
@@ -72,8 +73,8 @@ if (mainContent !== null) {
   pageIdOnHackmd = mainContent.getAttribute('data-page-id-on-hackmd') || null;
   hasDraftOnHackmd = !!mainContent.getAttribute('data-page-has-draft-on-hackmd');
   pagePath = mainContent.attributes['data-path'].value;
+  pageTags = mainContent.getAttribute('data-page-tags') || '';
   slackChannels = mainContent.getAttribute('data-slack-channels') || '';
-  // pageTags = mainContent.getAttribute('data-page-tags') || '';
   const rawText = document.getElementById('raw-text-original');
   if (rawText) {
     pageContent = rawText.innerHTML;
@@ -296,6 +297,7 @@ if (pageId) {
 if (pagePath) {
   componentMappings['page'] = <Page crowi={crowi} crowiRenderer={crowiRenderer} markdown={markdown} pagePath={pagePath} showHeadEditButton={true} onSaveWithShortcut={saveWithShortcut} />;
   componentMappings['revision-path'] = <RevisionPath pagePath={pagePath} crowi={crowi} />;
+  componentMappings['page-tag'] = <PageTagForm pageId={pageId} pageTags={pageTags} pagePath={pagePath} crowi={crowi} />;
   componentMappings['revision-url'] = <RevisionUrl pageId={pageId} pagePath={pagePath} />;
 }
 

+ 0 - 9
src/client/js/components/SavePageControls.jsx

@@ -7,7 +7,6 @@ import SplitButton  from 'react-bootstrap/es/SplitButton';
 import MenuItem from 'react-bootstrap/es/MenuItem';
 
 import SlackNotification from './SlackNotification';
-import PageTagForm from './PageTagForm';
 import GrantSelector from './SavePageControls/GrantSelector';
 
 class SavePageControls extends React.PureComponent {
@@ -60,14 +59,6 @@ class SavePageControls extends React.PureComponent {
 
     return (
       <div className="d-flex align-items-center form-inline">
-        <div className="mr-2">
-          <PageTagForm
-            ref='pageTagForm'
-            crowi={this.props.crowi}
-            pageId={this.props.pageId}
-            pagePath={this.props.pagePath}
-            pageTags={this.props.pageTags} />
-      </div>
         <div className="mr-2">
           <SlackNotification
               ref='slackNotification'

+ 1 - 0
src/server/views/layout-growi/widget/header.html

@@ -8,6 +8,7 @@
       </div>
       <div class="title-container">
         <h1 class="title" id="revision-path"></h1>
+        <div class="tag" id="page-tag"></div>
         <div id="revision-url" class="url-line"></div>
       </div>
       {% if page %}

+ 1 - 0
src/server/views/widget/page_content.html

@@ -10,6 +10,7 @@
   data-page-has-draft-on-hackmd="{% if hasDraftOnHackmd %}{{ hasDraftOnHackmd.toString() }}{% endif %}"
   data-page-is-seen="{% if page and page.isSeenUser(user) %}1{% else %}0{% endif %}"
   data-slack-channels="{{ slack|default('') }}"
+  data-page-tags="{{ tags|default('') }}"
   >
 {% else %}
 <div id="content-main" class="content-main"