mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #2699 from urbanrotnik/ur-sci-4809-hide-buttons-when-no-permissions
Hide checkbox column when user is not an admin [SCI-4809]
This commit is contained in:
commit
b347fcf5c9
3 changed files with 18 additions and 6 deletions
|
@ -47,7 +47,7 @@
|
|||
destroy: true,
|
||||
columnDefs: [{
|
||||
targets: 0,
|
||||
visible: true,
|
||||
visible: !$('.repositories-index').data('readonly'),
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
render: function() {
|
||||
|
|
|
@ -1,13 +1,25 @@
|
|||
.repositories-index {
|
||||
&.active {
|
||||
[data-view-mode="archived"] {
|
||||
display: none
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.archived {
|
||||
[data-view-mode="active"] {
|
||||
display: none
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&[data-readonly="true"] {
|
||||
.main-actions {
|
||||
.toolbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.filter-container {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
<% if current_team %>
|
||||
<%= render partial: "sidebar", locals: { repositories: @repositories, archived: params[:archived] } %>
|
||||
<div class="content-pane flexible <%= params[:archived] ? :archived : :active %> repositories-index">
|
||||
<div class="content-pane flexible <%= params[:archived] ? :archived : :active %> 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>
|
||||
<h1 data-view-mode="archived"><%= t('libraries.index.head_title_archived') %></h1>
|
||||
|
@ -26,8 +27,7 @@
|
|||
<!-- Active table template -->
|
||||
<template id="activeRepositoriesListTable">
|
||||
<table id="repositoriesList" class="table"
|
||||
data-source="<%= team_repositories_path(current_team, format: :json) %>"
|
||||
>
|
||||
data-source="<%= team_repositories_path(current_team, format: :json) %>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
|
|
Loading…
Reference in a new issue