Browse Source

Merge pull request #68 from weseek/master

release 1.1.5
Yuki Takei 9 years ago
parent
commit
6cee1c6760

+ 5 - 0
CHANGES.md

@@ -1,6 +1,11 @@
 CHANGES
 ========
 
+## 1.1.5
+
+* Fix: crowi-plus Enhanced Layout
+* Support: Merge official Crowi v1.6.1 master branch [573144b]
+
 ## 1.1.4
 
 * Feature: Ensure to select layout type from Admin Page

+ 1 - 3
lib/views/crowi-plus/page.html

@@ -37,7 +37,5 @@
 {% endblock %}
 
 {% block content_main_after %}
-  {% if not page.isDeleted() %}
-    {% include 'widget/comments.html' %}
-  {% endif %}
+  {% include 'widget/comments.html' %}
 {% endblock %}

+ 1 - 3
lib/views/crowi-plus/page_list.html

@@ -37,7 +37,5 @@
 {% endblock %}
 
 {% block content_main_after %}
-  {% if not page.isDeleted() %}
-    {% include 'widget/comments.html' %}
-  {% endif %}
+  {% include 'widget/comments.html' %}
 {% endblock %}

+ 2 - 0
lib/views/crowi-plus/widget/comments.html

@@ -16,6 +16,7 @@
       <div class="page-comments-list-older collapse in" id="page-comments-list-older"></div>
     </div>
 
+    {% if page and not page.isDeleted() %}
     <form class="form page-comment-form" id="page-comment-form" onsubmit="return false;">
       <div class="comment-form">
         <div class="comment-form-user">
@@ -40,6 +41,7 @@
         </div>
       </div>
     </form>
+    {% endif %}
 
   </div>
 

+ 7 - 0
lib/views/crowi-plus/widget/header.html

@@ -50,6 +50,13 @@
       </ul>
       {% endif %}
 
+      {% if not page and not isUserPageList(path) and !isTrashPage() %}
+      <div class="portal-form-button">
+        <button class="btn btn-primary" id="create-portal-button">Create Portal</button>
+        <p class="help-block"><a href="#" data-target="#help-portal" data-toggle="modal"><i class="fa fa-question-circle"></i> What is Portal?</a></p>
+      </div>
+      {% endif %}
+
     </div>
 
   </header>

+ 6 - 9
lib/views/me/index.html

@@ -73,17 +73,14 @@
           </p>
           {% endif %}
         </div>
-        <div class="form-group {% if not user.lang %}has-error{% endif %}">
-          <label for="userForm[lang]" class="col-sm-2 control-label">{{ t('Language') }}</label>
-          <div class="col-sm-4 radio">
-            <label><input type="radio" name="userForm[lang]" value="{{ consts.language.LANG_EN_US }}" {% if user.lang == consts.language.LANG_EN_US %}checked="checked"{% endif %}>{{ t('English') }}</label>
-            <label><input type="radio" name="userForm[lang]" value="{{ consts.language.LANG_JA }}" {% if user.lang == consts.language.LANG_JA %}checked="checked"{% endif %}>{{ t('Japanese') }}</label>
-          </div>
-          <div class="col-sm-offset-2 col-sm-10">
-          </div>
+      </div>
+      <div class="form-group {% if not user.lang %}has-error{% endif %}">
+        <label for="userForm[lang]" class="col-sm-2 control-label">{{ t('Language') }}</label>
+        <div class="col-sm-4">
+          <label class="radio-inline"><input type="radio" name="userForm[lang]" value="{{ consts.language.LANG_EN_US }}" {% if user.lang == consts.language.LANG_EN_US %}checked="checked"{% endif %}>{{ t('English') }}</label>
+          <label class="radio-inline"><input type="radio" name="userForm[lang]" value="{{ consts.language.LANG_JA }}" {% if user.lang == consts.language.LANG_JA %}checked="checked"{% endif %}>{{ t('Japanese') }}</label>
         </div>
       </div>
-
       <div class="form-group">
         <div class="col-sm-offset-2 col-sm-10">
           <button type="submit" class="btn btn-primary">{{ t('Update') }}</button>

+ 1 - 0
lib/views/page_list.html

@@ -78,6 +78,7 @@
   data-page-revision-created="{% if revision %}{{ revision.createdAt|datetz('U') }}{% endif %}"
   data-page-is-seen="{% if page and page.isSeenUser(user) %}1{% else %}0{% endif %}"
   data-linebreaks-enabled="{{ isEnabledLinebreaks() }}"
+  data-csrftoken="{{ csrf() }}"
   >
 
 <div class="portal {% if not page or req.query.offset > 0 %}hide{% endif %}">

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "crowi-plus",
-  "version": "1.1.4-RC",
+  "version": "1.1.5-RC",
   "description": "Enhanced Crowi",
   "tags": [
     "wiki",

+ 31 - 49
resource/css/_comment_crowi-plus.scss

@@ -1,5 +1,32 @@
 .crowi-plus.main-container  {
 
+  %comment-section {
+    background: #f5f5f5;
+      padding: 1em;
+      position: relative;
+      margin-left: 4.5em;
+      margin-bottom: 1em;
+      border-radius: 3px;
+      &:before {
+        border: 1em solid transparent;
+        border-right-color:#f5f5f5;
+        border-left-width: 0;
+        left: -1em;
+        content: "";
+        display: block;
+        top: 1.5em;
+        position: absolute;
+        width: 0;
+      }
+  }
+
+  %picture-rounded {
+    position: absolute;
+    top: 1em;
+    width: 3em;
+    height: 3em;
+  }
+
   .page-comments-row {
     border-top: 5px solid #f0f0f0;
     margin: 30px 16px;
@@ -16,31 +43,12 @@
 
     // ユーザーアイコン
     .picture.picture-rounded {
-      position: absolute;
-      top: 1em;
-      width: 3em;
-      height: 3em;
+      @extend %picture-rounded;
     }
 
     // コメントセクション
     .page-comment-main {
-      background: #f5f5f5;
-      padding: 1em;
-      position: relative;
-      margin-left: 4.5em;
-      margin-bottom: 1em;
-      border-radius: 3px;
-      &:before {
-        border: 2em solid transparent;
-        border-right-color:#f5f5f5;
-        border-left-width: 0;
-        left: -1em;
-        content: "";
-        display: block;
-        top: 0.5em;
-        position: absolute;
-        width: 0;
-      }
+      @extend %comment-section;
     }
 
     // コメント本文
@@ -59,38 +67,12 @@
     margin-top: 2em;
     // ユーザーアイコン
     .picture.picture-rounded {
-      position: absolute;
-      top: 1em;
-      width: 3em;
-      height: 3em;
+      @extend %picture-rounded;
     }
 
     // コメントフォームセクション
     .comment-form-main {
-      margin-left: 4.5em;
-      margin-bottom: 1em;
-      background: #f5f5f5;
-      padding: 1em;
-      position: relative;
-      border-radius: 3px;
-      &:before {
-        border: 2em solid transparent;
-        border-right-color:#f5f5f5;
-        border-left-width: 0;
-        left: -1em;
-        content: "";
-        display: block;
-        top: 0.5em;
-        position: absolute;
-        width: 0;
-      }
-    }
-
-    // コメントの吹き出しアイコン
-    .comment-ico {
-      font-size: 1.2em;
-      margin-right: 0.3em;
-      opacity: 0.6;
+      @extend %comment-section;
     }
 
     // コメント入力フォーム

+ 1 - 1
resource/js/app.js

@@ -64,7 +64,7 @@ const componentMappings = {
 };
 if (pagePath) {
   componentMappings['revision-path'] = <RevisionPath pagePath={pagePath} />;
-  componentMappings['revision-url'] = <RevisionUrl pagePath={pagePath} url={location.href} />;
+  componentMappings['revision-url'] = <RevisionUrl pageId={pageId} pagePath={pagePath} />;
 }
 
 Object.keys(componentMappings).forEach((key) => {

+ 6 - 2
resource/js/components/HeaderSearchBox/SearchForm.js

@@ -100,7 +100,9 @@ export default class SearchForm extends React.Component {
   }
 
   render() {
-    const emptyLabel = (this.state.searchError !== null) ? 'Error on searching.' : 'No matches found.';
+    const emptyLabel = (this.state.searchError !== null)
+        ? 'Error on searching.'
+        : 'No matches found on title... Hit [Enter] key so that search on contents.';
     const formClear = this.getFormClearComponent();
 
     return (
@@ -116,7 +118,9 @@ export default class SearchForm extends React.Component {
               labelKey="path"
               minLength={2}
               options={this.state.pages}
-              placeholder="Search ... Page Title (Path) and Content"
+              placeholder="Search ..."
+              emptyLabel={emptyLabel}
+              align='left'
               submitFormOnEnter={true}
               onSearch={this.search}
               onInputChange={this.onInputChange}

+ 7 - 4
resource/js/components/Page/RevisionUrl.js

@@ -15,11 +15,14 @@ export default class RevisionUrl extends React.Component {
       fontSize: "1em"
     }
 
-    const urlText = decodeURIComponent(this.props.url);
-    const copiedText = this.props.pagePath + '\n' + this.props.url;
+    const url = (this.props.pageId === '')
+        ? decodeURIComponent(location.href)
+        : `${location.origin}/${this.props.pageId}`;
+    const copiedText = this.props.pagePath + '\n' + url;
+
     return (
       <span>
-        {urlText}
+        {url}
         <CopyButton buttonId="btnCopyRevisionUrl" text={copiedText}
             buttonClassName="btn btn-default" buttonStyle={buttonStyle} iconClassName="fa fa-link text-muted" />
       </span>
@@ -28,6 +31,6 @@ export default class RevisionUrl extends React.Component {
 }
 
 RevisionUrl.propTypes = {
+  pageId: React.PropTypes.string.isRequired,
   pagePath: React.PropTypes.string.isRequired,
-  url: React.PropTypes.string.isRequired,
 };