mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 21:24:23 +08:00
Setup initial GUI
This commit is contained in:
parent
b94d2c5c03
commit
38361e4bb4
5 changed files with 25 additions and 7 deletions
|
@ -3,5 +3,6 @@
|
|||
|
||||
$('.delete-repo-option').initializeModal('#delete-repo-modal');
|
||||
$('.rename-repo-option').initializeModal('#rename-repo-modal');
|
||||
$('.copy-repo-option').initializeModal('#copy-repo-modal');
|
||||
$('.create-repository').initializeModal('#create-repo-modal');
|
||||
})();
|
||||
|
|
|
@ -1070,6 +1070,10 @@ module PermissionHelper
|
|||
is_admin_of_team(repository.team)
|
||||
end
|
||||
|
||||
def can_copy_repository(repository)
|
||||
can_create_repository(repository.team)
|
||||
end
|
||||
|
||||
def can_create_columns_in_repository(repository)
|
||||
is_normal_user_or_admin_of_team(repository.team)
|
||||
end
|
||||
|
|
|
@ -51,17 +51,27 @@
|
|||
<span class="glyphicon glyphicon-cog"></span>
|
||||
<span class="caret"></span>
|
||||
</div>
|
||||
<% if can_edit_and_destroy_repository repo %>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li class="dropdown-header">
|
||||
<%= t("repositories.index.options_dropdown.header") %>
|
||||
</li>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li class="dropdown-header">
|
||||
<%= t("repositories.index.options_dropdown.header") %>
|
||||
</li>
|
||||
<% if can_edit_and_destroy_repository(repo) %>
|
||||
<li>
|
||||
<%= link_to t('repositories.index.options_dropdown.rename'),
|
||||
team_repository_rename_modal_path(repository_id: repo),
|
||||
class: "rename-repo-option",
|
||||
remote: true %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can_copy_repository(repo) %>
|
||||
<li>
|
||||
<%= link_to t('repositories.index.options_dropdown.copy'),
|
||||
team_repository_copy_modal_path(repository_id: repo),
|
||||
class: "copy-repo-option",
|
||||
remote: true %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if can_edit_and_destroy_repository(repo) %>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<%= link_to t('repositories.index.modal_delete.delete'),
|
||||
|
@ -69,8 +79,8 @@
|
|||
class: "delete-repo-option",
|
||||
remote: true %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -849,6 +849,7 @@ en:
|
|||
options_dropdown:
|
||||
header: "Edit repository"
|
||||
rename: "Rename"
|
||||
copy: "Copy"
|
||||
delete: "Delete"
|
||||
modal_delete:
|
||||
title_html: "Delete repository <em>%{name}</em>"
|
||||
|
|
|
@ -132,6 +132,8 @@ Rails.application.routes.draw do
|
|||
defaults: { format: 'json' }
|
||||
get 'rename_modal', to: 'repositories#rename_modal',
|
||||
defaults: { format: 'json' }
|
||||
get 'copy_modal', to: 'repositories#copy_modal',
|
||||
defaults: { format: 'json' }
|
||||
end
|
||||
resources :samples, only: [:new, :create]
|
||||
resources :sample_types, except: [:show, :new] do
|
||||
|
|
Loading…
Add table
Reference in a new issue