瀏覽代碼

UI: Add log-in button to public boards

Even if a board is public and a user can view it, the user might want to
log in to be able to edit the board.

The button replaces the "public" permission indicator, because it is
obvious (if the user is not logged in and can view the board, it has to
be public).
Alexander Sulfrian 9 年之前
父節點
當前提交
fad5150ada
共有 3 個文件被更改,包括 24 次插入10 次删除
  1. 20 10
      client/components/boards/boardHeader.jade
  2. 3 0
      client/components/boards/boardHeader.js
  3. 1 0
      i18n/en.i18n.json

+ 20 - 10
client/components/boards/boardHeader.jade

@@ -16,11 +16,10 @@ template(name="boardHeaderBar")
                 span
                   = currentBoard.stars
 
-          a.board-header-btn(class="{{#if currentUser.isBoardAdmin}}js-change-visibility{{else}}is-disabled{{/if}}")
-            i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
-            span {{_ currentBoard.permission}}
+            a.board-header-btn(class="{{#if currentUser.isBoardAdmin}}js-change-visibility{{else}}is-disabled{{/if}}")
+              i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
+              span {{_ currentBoard.permission}}
 
-          if currentUser
             a.board-header-btn.js-watch-board
               if $eq watchLevel "watching"
                 i.fa.fa-eye
@@ -32,6 +31,12 @@ template(name="boardHeaderBar")
                 i.fa.fa-bell-slash
                 span {{_ 'muted'}}
 
+          else
+            a.board-header-btn.js-log-in(
+              title="{{_ 'log-in'}}")
+              i.fa.fa-sign-in
+              span {{_ 'log-in'}}
+
   .board-header-btns.right
     if currentBoard
       if isMiniScreen
@@ -44,13 +49,12 @@ template(name="boardHeaderBar")
                 span
                   = currentBoard.stars
 
-          a.board-header-btn(
-            class="{{#if currentUser.isBoardAdmin}}js-change-visibility{{else}}is-disabled{{/if}}"
-            title="{{_ currentBoard.permission}}")
-            i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
-            span {{_ currentBoard.permission}}
+            a.board-header-btn(
+              class="{{#if currentUser.isBoardAdmin}}js-change-visibility{{else}}is-disabled{{/if}}"
+              title="{{_ currentBoard.permission}}")
+              i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
+              span {{_ currentBoard.permission}}
 
-          if currentUser
             a.board-header-btn.js-watch-board(
               title="{{_ watchLevel }}")
               if $eq watchLevel "watching"
@@ -60,6 +64,12 @@ template(name="boardHeaderBar")
               if $eq watchLevel "muted"
                 i.fa.fa-bell-slash
               span {{_ watchLevel}}
+  
+          else
+            a.board-header-btn.js-log-in(
+              title="{{_ 'log-in'}}")
+              i.fa.fa-sign-in
+              span {{_ 'log-in'}}
 
       a.board-header-btn.js-open-filter-view(
           title="{{#if Filter.isActive}}{{_ 'filter-on-desc'}}{{else}}{{_ 'filter'}}{{/if}}"

+ 3 - 0
client/components/boards/boardHeader.js

@@ -90,6 +90,9 @@ BlazeComponent.extendComponent({
         evt.stopPropagation();
         MultiSelection.disable();
       },
+      'click .js-log-in'() {
+        FlowRouter.go('atSignIn');
+      },
     }];
   },
 }).register('boardHeaderBar');

+ 1 - 0
i18n/en.i18n.json

@@ -209,6 +209,7 @@
     "listImportCardPopup-title": "Import a Trello card",
     "lists": "Lists",
     "log-out": "Log Out",
+    "log-in": "Log In",
     "loginPopup-title": "Log In",
     "memberMenuPopup-title": "Member Settings",
     "members": "Members",