mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
add permissions in views
This commit is contained in:
parent
9b836d04fa
commit
76b08e6ac9
2 changed files with 34 additions and 31 deletions
|
@ -116,17 +116,16 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if current_user.teams.length > 1 %>
|
||||
<li data-hook="new-team-btn"
|
||||
role="separator"
|
||||
class="divider"></li>
|
||||
<% if current_user.teams.length > 1 && can_create_teams? %>
|
||||
<li role="separator"
|
||||
class="divider"></li>
|
||||
<li>
|
||||
<%= link_to new_team_path do %>
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<%= t('users.settings.teams.index.new_team') %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li data-hook="new-team-btn">
|
||||
<%= link_to new_team_path do %>
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<%= t('users.settings.teams.index.new_team') %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -258,19 +257,21 @@
|
|||
<%= image_tag avatar_path(current_user, :icon_small),
|
||||
class: "avatar" %>
|
||||
</a>
|
||||
<ul class="dropdown-menu" data-hook="navigation-user-menu">
|
||||
<li>
|
||||
<%= link_to t('nav.user.settings'),
|
||||
'/settings',
|
||||
data: { turbolinks: false } %>
|
||||
</li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<%= link_to t('nav.user.logout'),
|
||||
destroy_user_session_path,
|
||||
method: :delete %>
|
||||
</li>
|
||||
</ul>
|
||||
<% if current_user.teams.length > 1 || can_create_teams? %>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%= link_to t('nav.user.settings'),
|
||||
'/settings',
|
||||
data: { turbolinks: false } %>
|
||||
</li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<%= link_to t('nav.user.logout'),
|
||||
destroy_user_session_path,
|
||||
method: :delete %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -13,14 +13,16 @@
|
|||
<% else %>
|
||||
<em><%= t("users.settings.teams.index.no_teams") %></em>
|
||||
<% end %>
|
||||
<span id="new-team-button">
|
||||
<%= link_to new_team_path, class: "btn btn-default", style: "margin-left: 30px;" do %>
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<span class="hidden-xs">
|
||||
<%= t("users.settings.teams.index.new_team") %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<% if can_create_teams? %>
|
||||
<span id="new-team-button">
|
||||
<%= link_to new_team_path, class: "btn btn-default", style: "margin-left: 30px;" do %>
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<span class="hidden-xs">
|
||||
<%= t("users.settings.teams.index.new_team") %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if @member_of > 0 %>
|
||||
|
|
Loading…
Reference in a new issue