mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 12:09:17 +08:00
Make share status icon dynamic (#2007)
This commit is contained in:
parent
5e3f1d59f5
commit
d70b7e2272
6 changed files with 18 additions and 5 deletions
|
@ -145,6 +145,7 @@
|
|||
if (data.warnings) {
|
||||
alert(data.warnings);
|
||||
}
|
||||
$('.repository-share-status').toggleClass('hidden', !data.status);
|
||||
$('.share-repo-modal').modal('hide');
|
||||
},
|
||||
error: function(data) {
|
||||
|
|
|
@ -111,6 +111,7 @@
|
|||
#repo-tree {
|
||||
.fas-custom {
|
||||
float: right;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.active {
|
||||
|
|
|
@ -22,6 +22,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
.repository-share-status {
|
||||
display: contents !important;
|
||||
|
||||
&.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.repository-table {
|
||||
margin-top: 20px;
|
||||
|
|
|
@ -43,7 +43,7 @@ class TeamRepositoriesController < ApplicationController
|
|||
team_ids_for_update: teams_to_update,
|
||||
**share_all_params)
|
||||
if service_call.succeed?
|
||||
render json: { warnings: service_call.warnings.join(', ') }, status: :ok
|
||||
render json: { warnings: service_call.warnings.join(', '), status: @repository.i_shared?(current_team) }, status: :ok
|
||||
else
|
||||
render json: { errors: service_call.errors.map { |_, v| v }.join(', ') }, status: :unprocessable_entity
|
||||
end
|
||||
|
|
|
@ -30,8 +30,10 @@
|
|||
<% else %>
|
||||
<%= draw_custom_icon('shared-read') %>
|
||||
<% end %>
|
||||
<% elsif repository.i_shared?(current_team) %>
|
||||
<%= draw_custom_icon('i-shared') %>
|
||||
<% else %>
|
||||
<span class="repository-share-status <%= "hidden" unless @repository.i_shared?(current_team) %>" >
|
||||
<%= draw_custom_icon('i-shared') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
<% else %>
|
||||
<%= draw_custom_icon('shared-read') %>
|
||||
<% end %>
|
||||
<% elsif @repository.i_shared?(current_team) %>
|
||||
<%= draw_custom_icon('i-shared') %>
|
||||
<% else %>
|
||||
<span class="repository-share-status <%= "hidden" unless @repository.i_shared?(current_team) %>" >
|
||||
<%= draw_custom_icon('i-shared') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="repository-title">
|
||||
|
|
Loading…
Reference in a new issue