mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-09 05:37:36 +08:00
Hide checkbox column when user is not admin
This commit is contained in:
parent
876cfada9a
commit
1bf8198129
3 changed files with 18 additions and 6 deletions
|
|
@ -47,7 +47,7 @@
|
||||||
destroy: true,
|
destroy: true,
|
||||||
columnDefs: [{
|
columnDefs: [{
|
||||||
targets: 0,
|
targets: 0,
|
||||||
visible: true,
|
visible: !$('.repositories-index').data('readonly'),
|
||||||
searchable: false,
|
searchable: false,
|
||||||
orderable: false,
|
orderable: false,
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,25 @@
|
||||||
.repositories-index {
|
.repositories-index {
|
||||||
&.active {
|
&.active {
|
||||||
[data-view-mode="archived"] {
|
[data-view-mode="archived"] {
|
||||||
display: none
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.archived {
|
&.archived {
|
||||||
[data-view-mode="active"] {
|
[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 %>
|
<% if current_team %>
|
||||||
<%= render partial: "sidebar", locals: { repositories: @repositories, archived: params[:archived] } %>
|
<%= 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">
|
<div class="content-header">
|
||||||
<h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1>
|
<h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1>
|
||||||
<h1 data-view-mode="archived"><%= t('libraries.index.head_title_archived') %></h1>
|
<h1 data-view-mode="archived"><%= t('libraries.index.head_title_archived') %></h1>
|
||||||
|
|
@ -26,8 +27,7 @@
|
||||||
<!-- Active table template -->
|
<!-- Active table template -->
|
||||||
<template id="activeRepositoriesListTable">
|
<template id="activeRepositoriesListTable">
|
||||||
<table id="repositoriesList" class="table"
|
<table id="repositoriesList" class="table"
|
||||||
data-source="<%= team_repositories_path(current_team, format: :json) %>"
|
data-source="<%= team_repositories_path(current_team, format: :json) %>">
|
||||||
>
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue