Skip to content

Commit 1667f05

Browse files
Ap 630 generate pdf (#16)
* Was using incorrect _toolbar.html.erb file for overriding the view. updated checksum in build.yml to reflect the correct file * checkum diff for _toolbar override was incorrect
1 parent 87b9b37 commit 1667f05

2 files changed

Lines changed: 14 additions & 26 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
BUILD_SUFFIX: -build-${{ github.run_id }}_${{ github.run_attempt }}
1111
DOCKER_METADATA_SET_OUTPUT_ENV: 'true'
12-
ARCHIVESSPACE_RESOURCE_TOOLBAR_DIFF_SHA256: 5122e9837c25fefe58d64ff499e570b5120f527f3654de4bb0acac22d5cfc1ed
12+
ARCHIVESSPACE_RESOURCE_TOOLBAR_DIFF_SHA256: 130c992dded062cd478569a1cd6c4cc45d79b06c62fd63402dd560669c29df25
1313

1414
jobs:
1515
build:

files/plugins/local/frontend/views/resources/_toolbar.html.erb

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@
2323
<input type="hidden" name="id", value="<%= @resource.id %>" />
2424
<label class="checkbox" for="include-unpublished">
2525
<input type="checkbox" id="include-unpublished" name="include_unpublished" <% if pref_include_unpublished %> checked="checked" <% end %>/>
26-
<%= t("export_options.include_unpublished") %>
26+
<%= t("export_options.include_unpublished") %>&#160;
2727
</label>
2828
<label class="checkbox" for="include-daos">
2929
<input type="checkbox" id="include-daos" name="include_daos" checked="checked"/>
30-
<%= t("export_options.include_daos") %>
30+
<%= t("export_options.include_daos") %>&#160;
3131
</label>
3232
<label class="checkbox" for="include-uris">
3333
<input type="checkbox" id="include-uris" name="include_uris" checked="checked"/>
34-
<%= t("export_options.include_uris") %>
34+
<%= t("export_options.include_uris") %>&#160;
3535
</label>
3636
<label class="checkbox" for="numbered-cs">
3737
<input type="checkbox" id="numbered-cs" name="numbered_cs" checked="checked"/>
38-
<%= t("export_options.numbered_cs") %>
38+
<%= t("export_options.numbered_cs") %>&#160;
3939
</label>
4040
<%# EAD3 %>
4141
<label class="checkbox" for="ead3">
4242
<input type="checkbox" id="ead3" name="ead3" />
43-
<%= t("export_options.ead3") %>
43+
<%= t("export_options.ead3") %>&#160;
4444
</label>
4545
<%# END - EAD3 %>
4646
</fieldset>
@@ -53,8 +53,8 @@
5353
<fieldset>
5454
<input type="hidden" name="id", value="<%= @resource.id %>" />
5555
<label class="checkbox" for="include-unpublished-marc">
56-
<input type="checkbox" id="include-unpublished-marc" name="include_unpublished_marc" <% if pref_include_unpublished %> checked="checked" <% end %>/>
57-
<%= t("export_options.include_unpublished") %>
56+
<input type="checkbox" id="include-unpublished-marc" name="include_unpublished_marc" <% if pref_include_unpublished %> checked="checked" <% end %>/>
57+
<%= t("export_options.include_unpublished") %>&#160;
5858
</label>
5959
<%# END - MARC %>
6060
</fieldset>
@@ -67,17 +67,13 @@
6767
<% if user_can?('create_job') %>
6868
<% if job_types['print_to_pdf_job']['create_permissions'].reject{|perm| user_can?(perm)}.empty? %>
6969

70-
<li class="dropdown-item p-0 dropdown-submenu" id="print-to-pdf-dropdown" data-print-to-pdf-url="<%= url_for(:controller => :exports, :action => :print_to_pdf, :id => @resource.id, :include_unpublished => "${include_unpublished}", :include_uris => "${include_uris}")%>">
71-
<a href="#" data-toggle="dropdown" data-display="static" class="py-1 px-4 d-block text-decoration-none menu-with-options print-to-pdf-action" title="<%= t("actions.print_to_pdf") %>"><%= t("actions.print_to_pdf") %></a>
72-
<div class="dropdown-menu" id="form_print_to_pdf">
73-
<fieldset class="d-flex flex-column">
70+
<li class="dropdown-item p-0 dropdown-submenu">
71+
<%= link_to t("actions.print_to_pdf"), {:controller => :exports, :action => :print_to_pdf, :id => @resource.id, :include_unpublished => false }, :id => 'print-to-pdf-link', :target => "_blank", :class => "py-1 px-4 d-block text-decoration-none" %>
72+
<div class="dropdown-menu">
73+
<fieldset>
7474
<label class="checkbox" for="include-unpublished-pdf">
75-
<input type="checkbox" id="include-unpublished-pdf" <% if pref_include_unpublished %> checked="checked" <% end %> />
76-
<%= t("export_options.include_unpublished") %>
77-
</label>
78-
<label class="checkbox" for="include-uris-pdf">
79-
<input type="checkbox" id="include-uris-pdf" />
80-
<%= t("export_options.include_uris") %>
75+
<input type="checkbox" id="include-unpublished-pdf" onchange="$('#print-to-pdf-link').attr('href', '<%= url_for :controller => :exports, :action => :print_to_pdf, :id => @resource.id %>?include_unpublished=' + $(this).prop('checked'))" <% if pref_include_unpublished %> checked="checked" <% end %> />
76+
<%= t("export_options.include_unpublished") %>&#160;
8177
</label>
8278
</fieldset>
8379
</div>
@@ -94,12 +90,4 @@
9490
:record => @resource,
9591
})
9692
%>
97-
<% elsif user_can_view_only?('resource') %>
98-
<%= render_aspace_partial(:partial => '/shared/resource_toolbar',
99-
:locals => {
100-
:record_type => 'resource',
101-
:record => @resource,
102-
:view_only => true,
103-
})
104-
%>
10593
<% end %>

0 commit comments

Comments
 (0)