-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render batch change results in partial instead of
flash
Avoid some exception use
- Loading branch information
Showing
6 changed files
with
52 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<% return unless @items_for_sharing %> | ||
<% items_text = 'item'.pluralize(@items_for_sharing.size) %> | ||
<% if @success&.any? || @gatekeeper_required&.any? %> | ||
<div id="notice_flash" class="fade in alert alert-success alert-dismissable" role="alert"> | ||
<% if @success.any? %> | ||
The sharing policies for your selected <%= items_text -%> were successfully updated: | ||
<ul id="ok"> | ||
<% @success.each do |item| %> | ||
<li><%= item.title %></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
<% if @gatekeeper_required.any? %> | ||
Publishing the following <%= items_text -%> requires approval from a gatekeeper: | ||
<ul id="gk"> | ||
<% @gatekeeper_required.each do |item| %> | ||
<li><%= item.title %></li> | ||
<% end %> | ||
</ul> | ||
The <%= items_text -%> will not be published until approved. | ||
<% end %> | ||
</div> | ||
<% elsif @error&.any? %> | ||
<div id="notice_flash" class="fade in alert alert-danger alert-dismissable" role="alert"> | ||
The sharing policies for your selected <%= items_text -%> were not successfully updated: | ||
<ul> | ||
<% @error.each do |item| %> | ||
<li> | ||
<%= item.title %><br> | ||
The reason: <%= item.errors.full_messages.join(', ') %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> |
18 changes: 2 additions & 16 deletions
18
app/views/single_pages/sample_batch_sharing_permissions_changed.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
<% | ||
flash_exists = flash[:error] || flash[:notice] | ||
%> | ||
<% if flash_exists %> | ||
<div id="notice_flash" class="fade in alert alert-<%= flash[:notice] ? "success" : "danger" %> alert-dismissable" role="alert"> | ||
<% if flash[:notice] %> | ||
<%= flash[:notice]%> | ||
<% else%> | ||
<%= flash[:error]%> | ||
<% flash[:error]=nil %> | ||
<% end %> | ||
</div> | ||
<a id="hide-permissions-changed" class=" btn btn-default" onclick="$j('#change-batch-permission-modal').modal('hide')">Ok</a> | ||
<% end %> | ||
|
||
<%= render partial: 'sharing/batch_change_results' %> | ||
|
||
<a id="hide-permissions-changed" class=" btn btn-default" onclick="$j('#change-batch-permission-modal').modal('hide')">OK</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters