Merge pull request #1093 from ZmagoD/zd_SCI_2296

hides the create new inventory button for non admin users [fixes SCI-…
This commit is contained in:
Zmago Devetak 2018-04-16 16:18:15 +02:00 committed by GitHub
commit a0f549e935
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View file

@ -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'

View file

@ -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 -->

View file

@ -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"