Skip to content

Commit

Permalink
Only render View Published toolbar action if AppConfig[:show_view_pub…
Browse files Browse the repository at this point in the history
…lished]
  • Loading branch information
payten committed Apr 22, 2020
1 parent e4f9cc0 commit 7ca7b11
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions common/config/config-defaults.rb
Expand Up @@ -605,3 +605,6 @@
# # 'erb_partial' returns the path to an erb template from which the action will be rendered
# 'erb_partial' => 'shared/my_special_action',
# }

# Enable/disable the View Published links in the frontend record toolbars
AppConfig[:show_view_published] = true
2 changes: 1 addition & 1 deletion frontend/app/views/accessions/_toolbar.html.erb
Expand Up @@ -22,7 +22,7 @@
<% end %>
<div class="btn-toolbar pull-right">
<div class="btn-group">
<% if @accession.publish %>
<% if AppConfig[:show_view_published] && @accession.publish %>
<div class="btn btn-inline-form">
<%= link_to I18n.t("actions.view_published"), File.join(AppConfig[:public_proxy_url], @accession.uri).to_s, :target => "_blank", :class => "btn btn-sm btn-default" %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/views/agents/_toolbar.html.erb
Expand Up @@ -26,7 +26,7 @@
<div class="btn btn-inline-form">
<%= link_to I18n.t("actions.export_eac"), {:controller => :exports, :action => :download_eac, :id => @agent.id, :type => @agent.agent_type}, :class => "btn btn-sm btn-default" %>
</div>
<% if @agent.publish %>
<% if AppConfig[:show_view_published] && @agent.publish %>
<div class="btn btn-inline-form">
<%= link_to I18n.t("actions.view_published"), File.join(AppConfig[:public_proxy_url], @agent.uri).to_s, :target => "_blank", :class => "btn btn-sm btn-default" %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/views/shared/_resource_toolbar.html.erb
Expand Up @@ -33,7 +33,7 @@
:"data-confirm-btn-class" => "btn-primary",
}) %>
</div>
<% if record.publish %>
<% if AppConfig[:show_view_published] && record.publish %>
<div class="btn-group">
<%= link_to I18n.t("actions.view_published"), File.join(AppConfig[:public_proxy_url], record.uri).to_s, :target => "_blank", :class => "btn btn-sm btn-default" %>
</div>
Expand Down

0 comments on commit 7ca7b11

Please sign in to comment.