فهرست منبع

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
                 span
                   = currentBoard.stars
                   = 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
             a.board-header-btn.js-watch-board
               if $eq watchLevel "watching"
               if $eq watchLevel "watching"
                 i.fa.fa-eye
                 i.fa.fa-eye
@@ -32,6 +31,12 @@ template(name="boardHeaderBar")
                 i.fa.fa-bell-slash
                 i.fa.fa-bell-slash
                 span {{_ 'muted'}}
                 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
   .board-header-btns.right
     if currentBoard
     if currentBoard
       if isMiniScreen
       if isMiniScreen
@@ -44,13 +49,12 @@ template(name="boardHeaderBar")
                 span
                 span
                   = currentBoard.stars
                   = 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(
             a.board-header-btn.js-watch-board(
               title="{{_ watchLevel }}")
               title="{{_ watchLevel }}")
               if $eq watchLevel "watching"
               if $eq watchLevel "watching"
@@ -60,6 +64,12 @@ template(name="boardHeaderBar")
               if $eq watchLevel "muted"
               if $eq watchLevel "muted"
                 i.fa.fa-bell-slash
                 i.fa.fa-bell-slash
               span {{_ watchLevel}}
               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(
       a.board-header-btn.js-open-filter-view(
           title="{{#if Filter.isActive}}{{_ 'filter-on-desc'}}{{else}}{{_ 'filter'}}{{/if}}"
           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();
         evt.stopPropagation();
         MultiSelection.disable();
         MultiSelection.disable();
       },
       },
+      'click .js-log-in'() {
+        FlowRouter.go('atSignIn');
+      },
     }];
     }];
   },
   },
 }).register('boardHeaderBar');
 }).register('boardHeaderBar');

+ 1 - 0
i18n/en.i18n.json

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