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

Merge pull request #187 from weseek/master

release v2.1.2
Yuki Takei 8 лет назад
Родитель
Сommit
85c09d2599
7 измененных файлов с 35 добавлено и 13 удалено
  1. 6 0
      CHANGES.md
  2. 1 1
      lib/form/invited.js
  3. 11 6
      lib/views/admin/users.html
  4. 4 4
      package.json
  5. 4 1
      resource/css/_form.scss
  6. 2 1
      resource/css/_utilities.scss
  7. 7 0
      resource/css/_wiki.scss

+ 6 - 0
CHANGES.md

@@ -1,6 +1,12 @@
 CHANGES
 ========
 
+## 2.1.2
+
+* Improvement: Ensure to prevent suspending own account
+* Fix: Ensure to be able to use `.` for username when invited
+* Fix: monospace font for `<code></code>`
+
 ## 2.1.1
 
 * Fix: The problem that React Modal doesn't work

+ 1 - 1
lib/form/invited.js

@@ -4,7 +4,7 @@ var form = require('express-form')
   , field = form.field;
 
 module.exports = form(
-  field('invitedForm.username').required().is(/^[\da-zA-Z\-_]+$/),
+  field('invitedForm.username').required().is(/^[\da-zA-Z\-_\.]+$/),
   field('invitedForm.name').required(),
   field('invitedForm.password').required().is(/^[\x20-\x7F]{6,}$/)
 );

+ 11 - 6
lib/views/admin/users.html

@@ -205,12 +205,17 @@
                   </form>
                   {% endif  %}
                   {% if sUser.status == 2 %}
-
-                  <form action="/admin/user/{{ sUser._id.toString() }}/suspend" method="post">
-                    <input type="hidden" name="_csrf" value="{{ csrf() }}">
-                    <button type="submit" class="btn btn-block btn-warning">アカウント停止</button>
-                  </form>
-                  {% endif  %}
+                    {% if sUser.username != user.username %}
+                    <form action="/admin/user/{{ sUser._id.toString() }}/suspend" method="post">
+                      <input type="hidden" name="_csrf" value="{{ csrf() }}">
+                      <button type="submit" class="btn btn-block btn-warning">アカウント停止</button>
+                    </form>
+                    {% else %}
+                    <button class="btn btn-block btn-warning" disabled>アカウント停止</button>
+                    <br>
+                    <p class="alert alert-danger">自分自身のアカウントを停止することはできません</p>
+                    {% endif %}
+                  {% endif %}
                   {% if sUser.status == 3 %}
                   <form action="/admin/user/{{ sUser._id.toString() }}/activate" method="post">
                     <input type="hidden" name="_csrf" value="{{ csrf() }}">

+ 4 - 4
package.json

@@ -1,6 +1,6 @@
 {
   "name": "crowi-plus",
-  "version": "2.1.1-RC",
+  "version": "2.1.2-RC",
   "description": "Enhanced Crowi",
   "tags": [
     "wiki",
@@ -135,9 +135,9 @@
     "sinon-chai": "^2.13.0"
   },
   "engines": {
-    "node": "6.11.3",
-    "npm": "4.6.1",
-    "yarn": "1.1.0"
+    "node": ">=6.11 <7",
+    "npm": ">=4.6 <5",
+    "yarn": "~1.1.0"
   },
   "config": {
     "blanket": {

+ 4 - 1
resource/css/_form.scss

@@ -1,3 +1,6 @@
+// import crowi variable
+@import 'utilities';
+
 .crowi.main-container .main .content-main.on-edit { // {{{ Edit Form of Page
   padding: 0;
 
@@ -137,7 +140,7 @@
 } // }}}
 
 textarea {
-  font-family: menlo, monaco, consolas, monospace;
+  font-family: $font-family-monospace-not-strictly;
   line-height: 1.1em;
 }
 

+ 2 - 1
resource/css/_utilities.scss

@@ -58,7 +58,8 @@ $link-hover-color:      darken($link-color, 15%);
 //
 $font-family-sans-serif:  Lato, -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
 // $font-family-serif:       Georgia, "Times New Roman", Times, serif;
-$font-family-monospace:   Monaco, Menlo, Consolas, "Courier New", MeiryoKe_Console, monospace;
+$font-family-monospace:   Osaka-Mono, "MS Gothic", Monaco, Menlo, Consolas, "Courier New", monospace;
+$font-family-monospace-not-strictly:   Monaco, Menlo, Consolas, "Courier New", MeiryoKe_Console, "M+ 1m", monospace;
 // $font-family-base:        $font-family-sans-serif;
 //
 // $font-size-base:          14px;

+ 7 - 0
resource/css/_wiki.scss

@@ -1,3 +1,6 @@
+// import crowi variable
+@import 'utilities';
+
 div.body {
   padding: 10px;
 }
@@ -181,6 +184,10 @@ div.body {
   };
 */
 
+  p code {  // only inline code blocks
+    font-family: $font-family-monospace-not-strictly;
+  }
+
   .page-template-builder {
     position: relative;