mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Add empty repositories index page [SCI-5248]
This commit is contained in:
parent
324c268594
commit
6b2a94f045
3 changed files with 35 additions and 1 deletions
|
@ -26,7 +26,9 @@ class RepositoriesController < ApplicationController
|
|||
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.html do; end
|
||||
format.html do
|
||||
render 'empty_index' if @repositories.blank?
|
||||
end
|
||||
format.json do
|
||||
render json: prepare_repositories_datatable(@repositories, current_team, params)
|
||||
end
|
||||
|
|
29
app/views/repositories/empty_index.html.erb
Normal file
29
app/views/repositories/empty_index.html.erb
Normal file
|
@ -0,0 +1,29 @@
|
|||
<% provide(:head_title, t('libraries.index.head_title')) %>
|
||||
<% provide(:container_class, 'no-second-nav-container') %>
|
||||
|
||||
<%= render partial: 'sidebar', locals: { repositories: @repositories, archived: false } %>
|
||||
<div class="content-pane flexible repositories-index" data-readonly="<%= !current_user.is_admin_of_team?(current_team) %>">
|
||||
<div class="content-header">
|
||||
<h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1>
|
||||
</div>
|
||||
<div class="content-body">
|
||||
<h1>
|
||||
<%= t('repositories.index.empty_title') %>
|
||||
</h1>
|
||||
<% if can_create_repositories?(current_team) %>
|
||||
<h5>
|
||||
<%= t('repositories.index.empty_description_with_create') %>
|
||||
</h5>
|
||||
<a id="createRepoBtn" class="btn btn-primary create-new-repository" data-remote="true" href="<%= create_modal_team_repositories_path(current_team) %>">
|
||||
<span class="fas fa-plus"></span>
|
||||
<span class="hidden-xs"><%= t('libraries.index.no_libraries.create_new_button') %></span>
|
||||
</a>
|
||||
<% else %>
|
||||
<h5>
|
||||
<%= t('repositories.index.empty_description_no_create') %>
|
||||
</h5>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= javascript_include_tag 'repositories/index' %>
|
|
@ -1188,6 +1188,9 @@ en:
|
|||
index:
|
||||
head_title: "Inventories"
|
||||
title: "Inventories"
|
||||
empty_title: "Your team has no inventories yet"
|
||||
empty_description_no_create: "It would be a shame to waste all this space. Sadly you don’t have permission to add inventories. You can ask your team admin to grant you that permission."
|
||||
empty_description_with_create: "It would be a shame to waste all this space. Create your first inventory now"
|
||||
add_new_repository_tab: "Add inventory"
|
||||
delete_flash: "\"%{name}\" inventory was successfully deleted!"
|
||||
rename_flash: "\"%{old_name}\" inventory was successfully renamed to \"%{new_name}\"!"
|
||||
|
|
Loading…
Reference in a new issue