mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
hides the create new inventory button for non admin users [fixes SCI-2296]
This commit is contained in:
parent
0815111cae
commit
bef166ff30
3 changed files with 14 additions and 9 deletions
|
@ -9,7 +9,7 @@ class RepositoriesController < ApplicationController
|
|||
before_action :check_manage_permissions, only:
|
||||
%i(destroy destroy_modal rename_modal update)
|
||||
before_action :check_create_permissions, only:
|
||||
%i(create_new_modal create copy_modal copy)
|
||||
%i(create_modal create copy_modal copy)
|
||||
|
||||
layout 'fluid'
|
||||
|
||||
|
|
|
@ -6,15 +6,19 @@
|
|||
# show only if no repositories present. If the team will have them we will
|
||||
# handle this in left side navigation bar
|
||||
%>
|
||||
<div class="jumbotron text-center" style="margin-top:25%">
|
||||
<div class="jumbotron text-center" style="margin-top:18%">
|
||||
<strong><%=t 'libraries.index.no_libraries.text' %></strong>
|
||||
<h2><strong><%=t 'libraries.index.no_libraries.title' %><strong></h2>
|
||||
<br />
|
||||
<%= link_to t('libraries.index.no_libraries.create_new_button'),
|
||||
create_modal_team_repositories_path(current_team),
|
||||
class: "btn btn-primary btn-lg",
|
||||
id: "create-new-repository",
|
||||
remote: true %>
|
||||
<% if can_create_repositories?(current_team) %>
|
||||
<h2><strong><%=t 'libraries.index.no_libraries.title' %><strong></h2>
|
||||
<br />
|
||||
<%= link_to t('libraries.index.no_libraries.create_new_button'),
|
||||
create_modal_team_repositories_path(current_team),
|
||||
class: "btn btn-primary btn-lg",
|
||||
id: "create-new-repository",
|
||||
remote: true %>
|
||||
<% else %>
|
||||
<h2><strong><%=t 'libraries.index.no_libraries.no_permission_title' %><strong></h2>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<!-- If member of no teams -->
|
||||
|
|
|
@ -1026,6 +1026,7 @@ en:
|
|||
index:
|
||||
head_title: "Inventories"
|
||||
no_libraries:
|
||||
no_permission_title: "You don't have permission to create new inventory. Please contact your team administrator."
|
||||
text: "You don't have any inventories."
|
||||
title: "Please create your first Inventory"
|
||||
create_new_button: "Create New Inventory"
|
||||
|
|
Loading…
Reference in a new issue