Преглед изворни кода

Merge pull request #2442 from weseek/create-path-view

Create path view
Yuki Takei пре 5 година
родитељ
комит
3182ff4c7b

+ 1 - 0
resource/locales/en-US/translation.json

@@ -50,6 +50,7 @@
   "Shere this page link to public": "Shere this page link to public",
   "Create Archive Page": "Create Archive Page",
   "File type": "File type",
+  "Target page": "Target page",
   "Include Attachment File": "Include Attachment File",
   "Include Comment": "Include Comment",
   "Include Subordinated Page": "Include Subordinated Page",

+ 1 - 0
resource/locales/ja/translation.json

@@ -49,6 +49,7 @@
   "Not available for guest": "ゲストユーザーは利用できません",
   "Shere this page link to public": "外部に共有するリンクを発行する",
   "Create Archive Page": "アーカイブページの作成",
+  "Target page": "対象ページ",
   "File type": "ファイル形式",
   "Include Attachment File": "添付ファイルも含める",
   "Include Comment": "コメントも含める",

+ 12 - 4
src/client/js/components/ArchiveCreateModal.jsx

@@ -7,12 +7,11 @@ import {
 
 
 const ArchiveCreateModal = (props) => {
-
   const { t } = props;
-
   const [isCommentDownload, setIsCommentDownload] = useState(false);
   const [isFileDownload, setIsFileDownload] = useState(false);
   const [isSubordinatedPageDownload, setIsSubordinatedPageDownload] = useState(false);
+
   const [fileType, setFileType] = useState('markDown');
 
 
@@ -39,7 +38,7 @@ const ArchiveCreateModal = (props) => {
     (filetype) => {
       setFileType(filetype);
     },
-    [fileType],
+    [],
   );
 
 
@@ -50,7 +49,13 @@ const ArchiveCreateModal = (props) => {
       </ModalHeader>
       <ModalBody>
         <div className="form-group">
-          <div className="custom-control custom-radio custom-control-inline ">
+          <div className="form-group">
+            <label>{t('Target page')}</label>
+            <br />
+            <code>{props.path}</code>
+          </div>
+
+          <div className="custom-control-inline">
             <label>{t('File type')}: </label>
           </div>
           <div className="custom-control custom-radio custom-control-inline ">
@@ -135,10 +140,13 @@ const ArchiveCreateModal = (props) => {
   );
 };
 
+
 ArchiveCreateModal.propTypes = {
   t: PropTypes.func.isRequired, //  i18next
   isOpen: PropTypes.bool.isRequired,
   onClose: PropTypes.func,
+  path: PropTypes.string.isRequired,
 };
 
+
 export default withTranslation()(ArchiveCreateModal);

+ 0 - 1
src/client/js/components/CreateTemplateModal.jsx

@@ -62,7 +62,6 @@ const CreateTemplateModal = (props) => {
         </div>
       </ModalBody>
     </Modal>
-
   );
 };
 

+ 19 - 5
src/client/js/components/Page/PageShareManagement.jsx

@@ -16,6 +16,7 @@ import ArchiveCreateModal from '../ArchiveCreateModal';
 const PageShareManagement = (props) => {
   const { t, appContainer, pageContainer } = props;
 
+  const { path } = pageContainer.state;
   const { currentUser } = appContainer;
 
   const [isOutsideShareLinkModalShown, setIsOutsideShareLinkModalShown] = useState(false);
@@ -70,6 +71,7 @@ const PageShareManagement = (props) => {
         <ArchiveCreateModal
           isOpen={isArchiveCreateModalShown}
           onClose={closeArchiveCreateModalHandler}
+          path={path}
         />
       </>
     );
@@ -112,20 +114,32 @@ const PageShareManagement = (props) => {
       {currentUser == null ? renderGuestUser() : renderCurrentUser()}
       <div className="dropdown-menu dropdown-menu-right">
         <button className="dropdown-item" type="button" onClick={openOutsideShareLinkModalHandler}>
-          <i className="icon-fw icon-link"></i>{t('Shere this page link to public')}
+          <i className="icon-fw icon-link"></i>
+          {t('Shere this page link to public')}
           <span className="ml-2 badge badge-info badge-pill">{pageContainer.state.shareLinksNumber}</span>
         </button>
-        <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('markdown') }}>
+        <button
+          type="button"
+          className="dropdown-item"
+          onClick={() => {
+            exportPageHundler('markdown');
+          }}
+        >
           <span>{t('export_bulk.export_page_markdown')}</span>
         </button>
-        <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('pdf') }}>
+        <button
+          type="button"
+          className="dropdown-item"
+          onClick={() => {
+            exportPageHundler('pdf');
+          }}
+        >
           <span>{t('export_bulk.export_page_pdf')}</span>
         </button>
 
         <button className="dropdown-item" type="button" onClick={openArchiveModalHandler}>
-          <i className="icon-fw">{t('Create Archive Page')}</i>
+          <i className="icon-fw"></i>{t('Create Archive Page')}
         </button>
-
       </div>
       {renderModals()}
     </>