Yuki Takei 7 лет назад
Родитель
Сommit
79786646a1

+ 4 - 1
src/client/js/legacy/crowi.js

@@ -480,7 +480,10 @@ $(function() {
   });
 
   $('#create-portal-button').on('click', function(e) {
+    $('a[data-toggle="tab"][href="#edit"]').tab('show');
+
     $('body').addClass('on-edit');
+    $('body').addClass('builtin-editor');
 
     const path = $('.content-main').data('path');
     if (path != '/' && $('.content-main').data('page-id') == '') {
@@ -494,7 +497,7 @@ $(function() {
   });
   $('#portal-form-close').on('click', function(e) {
     $('body').removeClass('on-edit');
-    return false;
+    $('body').removeClass('builtin-editor');
   });
 
   /*

+ 3 - 1
src/server/routes/page.js

@@ -685,8 +685,10 @@ module.exports = function(crowi, app) {
         page = await Page.findOneByIdAndViewer(pageId, req.user);
       }
       else if (pagePath) {
-        page = await Page.findPage(pagePath, req.user, revisionId);
+        page = await Page.findPageByPathAndViewer(pagePath, req.user);
       }
+      // https://weseek.myjetbrains.com/youtrack/issue/GC-1224
+      // TODO populate
     }
     catch (err) {
       return res.json(ApiResponse.error(err));

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

@@ -33,6 +33,9 @@
         </div>
         <div id="page" class="m-t-15"></div>
       </div>
+    {% elseif 'crowi' === behaviorType() %}
+      <div class="tab-pane active" id="cancel-creating-portal">
+      </div>
     {% endif %}
 
     {% if not page.isDeleted() %}

+ 3 - 3
src/server/views/widget/page_tabs.html

@@ -81,13 +81,13 @@
 <ul class="nav nav-tabs nav-tabs-create-portal hidden-print">
 
   <li class="nav-main-left-tab">
-    <a id="portal-form-close" href="#">
+    <a id="portal-form-close" data-toggle="tab" href="#cancel-creating-portal">
       <i class="icon-action-undo"></i> {{ t('Cancel') }}
     </a>
   </li>
 
-  <li class="nav-main-left-tab active">
-    <a>
+  <li class="nav-main-left-tab">
+    <a {% if user %}href="#edit" data-toggle="tab"{% endif %} class="edit-button {% if not user %}edit-button-disabled{% endif %}">
       <i class="icon-note"></i> {{ t('Create') }}
     </a>
   </li>