-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use blacklight document show actions framework
- Loading branch information
1 parent
7e7b576
commit 756ff2d
Showing
3 changed files
with
63 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,3 @@ | |
overflow:scroll; | ||
max-height: 450px; | ||
} | ||
|
||
.show-tools .bookmark_toggle { | ||
padding: 0px 0px; | ||
} |
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
<% document ||= @document %> | ||
<div class="panel panel-default show-tools"> | ||
<div class="panel-heading"> | ||
<%= t('blacklight.tools.title') %> | ||
</div> | ||
|
||
<div class="panel-body"> | ||
<ul class="nav"> | ||
<%= render_show_doc_actions @document do |config, inner| %> | ||
<li class="<%= config.key %>"> | ||
<%= inner %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% if document_downloadable? %> | ||
<div class='panel-body'> | ||
<div class='btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'> | ||
<% if document.direct_download.present? %> | ||
<%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %> | ||
<% elsif document.hgl_download.present? %> | ||
<%= link_to(download_text(document.download_types.first[0]), | ||
download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] }, | ||
class: 'btn btn-default') %> | ||
<% else %> | ||
<%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: document.download_types.first[0])}", download: 'trigger', download_type: document.download_types.first[0], download_id: document[:layer_slug_s] }, class: 'btn btn-default') %> | ||
<% end %> | ||
<button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'> | ||
<span class='caret'></span> | ||
<span class='sr-only'>Toggle Download Dropdown</span> | ||
</button> | ||
<ul class='dropdown-menu' role='menu'> | ||
<% if document.hgl_download.present? %> | ||
<li role="presentation" class="dropdown-header">Original</li> | ||
<li> | ||
<%= link_to(download_text(document.download_types.first[0]), | ||
download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] }) %> | ||
</li> | ||
<% else %> | ||
<% if document.direct_download.present? %> | ||
<li role="presentation" class="dropdown-header">Original</li> | ||
<li> | ||
<%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %> | ||
</li> | ||
<% end %> | ||
<% if document.download_types.present? %> | ||
<li role="presentation" class="dropdown-header">Generated</li> | ||
<% document.download_types.each do |type| %> | ||
<%= content_tag(:li) do %> | ||
<% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: type[0])}", download: 'trigger', download_type: type[0], download_id: document[:layer_slug_s] }) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</ul> | ||
</div> | ||
</div> | ||
<% elsif document.restricted? && document.same_institution? %> | ||
<div class='panel-body'> | ||
<%= link_to t('geoblacklight.tools.login_to_view'), new_user_session_path(referrer: request.original_url) %> | ||
</div> | ||
<% end %> | ||
</div> |