hyrax 3.0.0.pre.rc3 → 3.0.0.pre.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/.dassie/config/locales/hyrax.es.yml +3 -1
  3. data/.dassie/config/tinymce.yml +3 -2
  4. data/.regen +1 -1
  5. data/CONTAINERS.md +12 -0
  6. data/Dockerfile +10 -8
  7. data/README.md +5 -0
  8. data/app/assets/javascripts/hyrax.js +1 -0
  9. data/app/assets/javascripts/hyrax/app.js.erb +0 -10
  10. data/app/assets/stylesheets/hyrax/_catalog.scss +1 -0
  11. data/app/assets/stylesheets/hyrax/_representative-media.scss +2 -2
  12. data/app/controllers/hyrax/file_sets_controller.rb +55 -4
  13. data/app/controllers/hyrax/my_controller.rb +1 -1
  14. data/app/forms/hyrax/forms/file_manager_form.rb +9 -2
  15. data/app/helpers/hyrax/ability_helper.rb +2 -1
  16. data/app/helpers/hyrax/contact_form_helper.rb +1 -2
  17. data/app/helpers/hyrax/hyrax_helper_behavior.rb +16 -1
  18. data/app/helpers/hyrax/workflows_helper.rb +42 -0
  19. data/app/models/concerns/hyrax/ability.rb +2 -2
  20. data/app/models/hyrax/contact_form.rb +1 -7
  21. data/app/models/hyrax/permission_template.rb +14 -0
  22. data/app/models/proxy_deposit_request.rb +8 -4
  23. data/app/presenters/hyrax/file_set_presenter.rb +10 -0
  24. data/app/presenters/hyrax/google_scholar_presenter.rb +86 -0
  25. data/app/presenters/hyrax/work_show_presenter.rb +1 -1
  26. data/app/search_builders/hyrax/dashboard/nested_collections_search_builder.rb +0 -24
  27. data/app/services/hyrax/admin_set_member_service.rb +1 -1
  28. data/app/services/hyrax/change_content_depositor_service.rb +29 -7
  29. data/app/services/hyrax/collections/permissions_service.rb +5 -6
  30. data/app/services/hyrax/custom_queries/find_ids_by_model.rb +37 -0
  31. data/app/services/hyrax/edit_permissions_service.rb +201 -0
  32. data/app/services/hyrax/identifier/dispatcher.rb +1 -1
  33. data/app/services/hyrax/listeners/active_fedora_acl_index_listener.rb +26 -0
  34. data/app/services/hyrax/listeners/metadata_index_listener.rb +5 -1
  35. data/app/views/catalog/_index_header_list_collection.html.erb +1 -1
  36. data/app/views/catalog/_index_header_list_default.html.erb +1 -1
  37. data/app/views/catalog/_index_list_default.html.erb +1 -1
  38. data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +1 -1
  39. data/app/views/hyrax/base/_currently_shared.html.erb +46 -0
  40. data/app/views/hyrax/base/_form_share.html.erb +5 -33
  41. data/app/views/hyrax/base/_show_actions.html.erb +16 -14
  42. data/app/views/hyrax/base/unavailable.html.erb +1 -1
  43. data/app/views/hyrax/batch_edits/_currently_shared.html.erb +8 -0
  44. data/app/views/hyrax/collections/_show_document_list_row.html.erb +1 -1
  45. data/app/views/hyrax/collections/_sort_and_per_page.html.erb +1 -1
  46. data/app/views/hyrax/contact_form/new.html.erb +3 -1
  47. data/app/views/hyrax/dashboard/collections/_show_document_list_menu.html.erb +1 -1
  48. data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +1 -1
  49. data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
  50. data/app/views/hyrax/file_sets/_actions.html.erb +1 -2
  51. data/app/views/hyrax/file_sets/_permission_form.html.erb +2 -31
  52. data/app/views/hyrax/file_sets/_show_actions.html.erb +1 -1
  53. data/app/views/hyrax/file_sets/media_display/_audio.html.erb +2 -2
  54. data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
  55. data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
  56. data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
  57. data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +2 -2
  58. data/app/views/hyrax/file_sets/media_display/_video.html.erb +2 -2
  59. data/app/views/hyrax/my/_sort_and_per_page.html.erb +1 -1
  60. data/app/views/layouts/_head_tag_content.html.erb +1 -1
  61. data/app/views/shared/_citations.html.erb +16 -12
  62. data/bin/hyrax-entrypoint.sh +9 -2
  63. data/chart/hyrax/Chart.yaml +2 -2
  64. data/config/initializers/listeners.rb +1 -0
  65. data/config/locales/hyrax.de.yml +71 -13
  66. data/config/locales/hyrax.en.yml +31 -19
  67. data/config/locales/hyrax.es.yml +60 -2
  68. data/config/locales/hyrax.fr.yml +60 -2
  69. data/config/locales/hyrax.it.yml +60 -2
  70. data/config/locales/hyrax.pt-BR.yml +60 -2
  71. data/config/locales/hyrax.zh.yml +60 -2
  72. data/documentation/developing-your-hyrax-based-app.md +2 -2
  73. data/hyrax.gemspec +2 -2
  74. data/lib/generators/hyrax/templates/catalog_controller.rb +4 -0
  75. data/lib/generators/hyrax/templates/config/tinymce.yml +3 -2
  76. data/lib/generators/hyrax/work_resource/work_resource_generator.rb +11 -0
  77. data/lib/hyrax/configuration.rb +14 -0
  78. data/lib/hyrax/engine.rb +1 -0
  79. data/lib/hyrax/version.rb +1 -1
  80. data/lib/wings.rb +1 -0
  81. data/lib/wings/services/custom_queries/find_ids_by_model.rb +46 -0
  82. data/lib/wings/setup.rb +1 -0
  83. data/template.rb +1 -1
  84. metadata +21 -7
@@ -44,7 +44,7 @@ module Hyrax
44
44
  # @return [ActiveFedora::Base, Hyrax::Resource] object
45
45
  def assign_for(object:, attribute: :identifier)
46
46
  record = registrar.register!(object: object)
47
- object.public_send("#{attribute}=".to_sym, [record.identifier])
47
+ object.public_send("#{attribute}=".to_sym, Array.wrap(record.identifier))
48
48
  object
49
49
  end
50
50
 
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hyrax
4
+ module Listeners
5
+ ##
6
+ # Reindexes resources when their ACLs are updated
7
+ #
8
+ # Hyrax's `Ability` behavior depends on the index being up-to-date as
9
+ # concerns-their read/write users/groups, and visibility.
10
+ class ActiveFedoraAclIndexListener
11
+ ##
12
+ # Re-index the resource for the updated ACL.
13
+ #
14
+ # @param event [Dry::Event]
15
+ def on_object_acl_updated(event)
16
+ return unless event[:result] == :success # do nothing on failure
17
+
18
+ if Hyrax.metadata_adapter.is_a?(Wings::Valkyrie::MetadataAdapter)
19
+ Wings::ActiveFedoraConverter.convert(resource: event[:acl].resource).update_index
20
+ else
21
+ Hyrax.logger.info('Skipping ActiveFedora object reindex because the Wings adapter is not in use.')
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -16,7 +16,11 @@ module Hyrax
16
16
  #
17
17
  # @param event [Dry::Event]
18
18
  def on_object_metadata_updated(event)
19
- Hyrax.index_adapter.save(resource: event[:object])
19
+ return Hyrax.index_adapter.save(resource: event[:object]) if
20
+ event[:object].is_a?(Valkyrie::Resource)
21
+
22
+ Hyrax.logger.info('Skipping object reindex because the object ' \
23
+ "#{event[:object]} was not a Valkyrie::Resource.")
20
24
  end
21
25
  end
22
26
  end
@@ -1,4 +1,4 @@
1
1
  <div class="search-results-title-row">
2
- <h4 class="search-result-title"><%= link_to document.title_or_label, [hyrax, document] %></h4>
2
+ <h3 class="search-result-title"><%= link_to document.title_or_label, [hyrax, document] %></h3>
3
3
  <%= Hyrax::CollectionPresenter.new(document, current_ability).collection_type_badge %>
4
4
  </div>
@@ -1,3 +1,3 @@
1
1
  <div class="search-results-title-row">
2
- <h4 class="search-result-title"><%= link_to document.title_or_label, document %></h4>
2
+ <h3 class="search-result-title"><%= link_to document.title_or_label, document %></h3>
3
3
  </div>
@@ -4,7 +4,7 @@
4
4
  <% doc_presenter = index_presenter(document) %>
5
5
  <% index_fields(document).each do |field_name, field| -%>
6
6
  <% if should_render_index_field? document, field %>
7
- <dt><%= render_index_field_label document, field: field_name %></dt>
7
+ <dt data-solr-field-name="<%= field_name %>"><%= render_index_field_label document, field: field_name %></dt>
8
8
  <dd><%= doc_presenter.field_value field %></dd>
9
9
  <% end %>
10
10
  <% end %>
@@ -8,7 +8,7 @@
8
8
  </td>
9
9
  <td>
10
10
  <div class="media">
11
- <%= link_to [main_app, document], class: "media-left" do %>
11
+ <%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %>
12
12
  <%= render_thumbnail_tag document, { class: "hidden-xs file_listing_thumbnail" }, { suppress_link: true } %>
13
13
  <% end %>
14
14
  <div class="media-body">
@@ -0,0 +1,46 @@
1
+ <% permission_service = Hyrax::EditPermissionsService.build_service_object_from(form: f, ability: current_ability) %>
2
+
3
+ <h2><%= t('.currently_sharing') %></h2>
4
+
5
+ <table class="table table-bordered">
6
+ <tr>
7
+ <th><%= t('.table_title_user') %></th>
8
+ <th><div class="col-sm-10"><%= t('.table_title_access') %></div></th>
9
+ </tr>
10
+ <tr id="file_permissions">
11
+ <td>
12
+ <%= label_tag :owner_access, class: "control-label" do %>
13
+ Depositor (<span id="file_owner" data-depositor="<%= permission_service.depositor %>"><%= link_to_profile permission_service.depositor %></span>)
14
+ <% end %>
15
+ </td>
16
+ <td>
17
+ <div class="col-sm-10">
18
+ <%= Hyrax.config.owner_permission_levels.keys[0] %>
19
+ </div>
20
+ </td>
21
+ </tr>
22
+ <%= f.fields_for :permissions do |permission_fields| %>
23
+ <% permission_service.with_applicable_permission(permission_hash: permission_fields.object.to_hash) do |permission| %>
24
+ <tr>
25
+ <td>
26
+ <%= permission_fields.label :agent_name, class: "control-label" do %>
27
+ <%= user_display_name_and_key(permission.name) %>
28
+ <%= permission.granted_by_html_hint %>
29
+ <% end %>
30
+ </td>
31
+ <td>
32
+ <div class="col-sm-10">
33
+ <% if permission.can_edit? %>
34
+ <%= permission_fields.select :access, Hyrax.config.permission_levels, {}, class: 'form-control select_perm' %>
35
+ <% else %>
36
+ <%= Hyrax.config.permission_levels.key(permission.access) %>
37
+ <% end %>
38
+ </div>
39
+ <% if permission.can_edit? %>
40
+ <button class="btn close remove_perm" data-index="<%= permission_fields.index %>">&times;</button>
41
+ <% end %>
42
+ </td>
43
+ </tr>
44
+ <% end %>
45
+ <% end %>
46
+ </table>
@@ -49,39 +49,11 @@
49
49
  </div>
50
50
  </fieldset>
51
51
 
52
- <h2><%= t('.currently_sharing') %></h2>
53
-
54
- <table class="table">
55
- <tr id="file_permissions">
56
- <td width="20%">
57
- <%= configured_owner_permission_levels.keys.first %>
58
- </td>
59
- <td width="60%">
60
- <%= label_tag :owner_access, class: "control-label" do %>
61
- <%= t('.depositor') %>(<span id="file_owner" data-depositor="<%= depositor %>"><%= link_to_profile depositor %></span>)
62
- <% end %>
63
- </td>
64
- </tr>
65
- <%= f.fields_for :permissions do |permission_fields| %>
66
- <%# skip the public, registered, and depositor perms as they are displayed first at the top %>
67
- <% next if ['public', 'registered', depositor].include? permission_fields.object.agent_name.downcase %>
68
- <tr>
69
- <td>
70
- <%= permission_fields.select :access, configured_permission_levels, {}, class: 'form-control select_perm' %>
71
- </td>
72
- <td>
73
- <%= permission_fields.label :agent_name, class: "control-label" do %>
74
- <%= user_display_name_and_key(permission_fields.object.agent_name) %>
75
- <% end %>
76
- <button class="btn close remove_perm" data-index="<%= permission_fields.index %>">&times;</button>
77
- </td>
78
- </tr>
79
- <% end %>
80
- </table>
52
+ <%= render 'currently_shared', f: f %>
81
53
 
82
54
  <script type="text/x-tmpl" id="tmpl-work-grant">
83
- <tr>
84
- <td>{%= o.accessLabel %}</td>
85
- <td><label class="control-label">{%= o.name %}</label> <button class="btn close">&times;</button></td>
86
- </tr>
55
+ <tr>
56
+ <td><label class="control-label">{%= o.name %}</label></td>
57
+ <td><div class="col-sm-10">{%= o.accessLabel %}<button class="btn close">&times;</button></div></td>
58
+ </tr>
87
59
  </script>
@@ -1,19 +1,21 @@
1
1
  <div class="row show-actions button-row-top-two-column">
2
2
  <div class="col-sm-6">
3
- <% if presenter.show_deposit_for?(collections: @user_collections) %>
4
- <input type="checkbox" style="display:none" name="batch_document_ids[]" id="batch_document_<%= presenter.id %>" value="<%= presenter.id %>" class="batch_document_selector" checked="checked" />
5
- <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
6
- class: 'btn btn-default submits-batches submits-batches-add',
7
- data: { toggle: "modal", target: "#collection-list-container" } %>
8
- <% end %>
9
- <% if presenter.work_featurable? %>
10
- <%= link_to t('.feature'), hyrax.featured_work_path(presenter, format: :json),
11
- data: { behavior: 'feature' },
12
- class: presenter.display_feature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
3
+ <% if !workflow_restriction?(presenter) %>
4
+ <% if presenter.show_deposit_for?(collections: @user_collections) %>
5
+ <input type="checkbox" style="display:none" name="batch_document_ids[]" id="batch_document_<%= presenter.id %>" value="<%= presenter.id %>" class="batch_document_selector" checked="checked" />
6
+ <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
7
+ class: 'btn btn-default submits-batches submits-batches-add',
8
+ data: { toggle: "modal", target: "#collection-list-container" } %>
9
+ <% end %>
10
+ <% if presenter.work_featurable? %>
11
+ <%= link_to t('.feature'), hyrax.featured_work_path(presenter, format: :json),
12
+ data: { behavior: 'feature' },
13
+ class: presenter.display_feature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
13
14
 
14
- <%= link_to t('.unfeature'), hyrax.featured_work_path(presenter, format: :json),
15
- data: { behavior: 'unfeature' },
16
- class: presenter.display_unfeature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
15
+ <%= link_to t('.unfeature'), hyrax.featured_work_path(presenter, format: :json),
16
+ data: { behavior: 'unfeature' },
17
+ class: presenter.display_unfeature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
18
+ <% end %>
17
19
  <% end %>
18
20
  <% if Hyrax.config.analytics? %>
19
21
  <% # turbolinks needs to be turned off or the page will use the cache and the %>
@@ -23,7 +25,7 @@
23
25
  </div>
24
26
 
25
27
  <div class="col-sm-6 text-right">
26
- <% if presenter.editor? %>
28
+ <% if presenter.editor? && !workflow_restriction?(presenter) %>
27
29
  <%= link_to t('.edit'), edit_polymorphic_path([main_app, presenter]), class: 'btn btn-default' %>
28
30
  <% if presenter.member_presenters.size > 1 %>
29
31
  <%= link_to t("hyrax.file_manager.link_text"), polymorphic_path([main_app, :file_manager, presenter]), class: 'btn btn-default' %>
@@ -1,5 +1,5 @@
1
1
  <h1>
2
- <%= @presenter %> <%= @presenter.workflow.badge %>
2
+ <%= @presenter %> <%= @presenter.try(:workflow).try(:badge) %>
3
3
  </h1>
4
4
  <% if @parent_presenter %>
5
5
  <ul class="breadcrumb">
@@ -0,0 +1,8 @@
1
+ <h2><%= t('.share_batch_with') %></h2>
2
+
3
+ <table class="table table-bordered">
4
+ <tr id="file_permissions">
5
+ <th width="65%"><%= t('.table_title_user') %></th>
6
+ <th><div class="col-sm-10"><%= t('.table_title_access') %></div></th>
7
+ </tr>
8
+ </table>
@@ -7,7 +7,7 @@
7
7
  </td>
8
8
  <td>
9
9
  <div class="media">
10
- <%= link_to [main_app, document], class: "media-left" do %>
10
+ <%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %>
11
11
  <%= render_thumbnail_tag document, { class: "hidden-xs file_listing_thumbnail", alt: "#{document.title_or_label} #{t('hyrax.homepage.admin_sets.thumbnail')}" }, { suppress_link: true } %>
12
12
  <% end %>
13
13
  <div class="media-body">
@@ -7,7 +7,7 @@
7
7
  <%= select_tag(:sort, options_from_collection_for_select(collection_member_sort_fields, 'first', lambda {|field| field.last.label}, h(params[:sort]))) %>
8
8
  <%= label_tag(:per_page) do %>
9
9
  <span class="tiny-nudge"><%= t('.results_per_page') %></span>
10
- <%= select_tag(:per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])), title: t('.number_of_results_to_display_per_page')) %>
10
+ <%= select_tag(:per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page, h(params[:per_page])), title: t('.number_of_results_to_display_per_page')) %>
11
11
  <% end %>
12
12
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort)) %>
13
13
  &nbsp;<button class="btn btn-xs btn-default tiny-nudge"><span class="glyphicon glyphicon-refresh"></span> <%= t('helpers.action.refresh') %></button>
@@ -1,3 +1,5 @@
1
+ <% provide :page_title, I18n.t('hyrax.contact_form.title') %>
2
+
1
3
  <div class="alert alert-info">
2
4
  <%= render 'directions' %>
3
5
  </div>
@@ -20,7 +22,7 @@
20
22
  <div class="form-group">
21
23
  <%= f.label :category, t('hyrax.contact_form.type_label'), class: "col-sm-2 control-label" %>
22
24
  <div class="col-sm-10">
23
- <%= f.select 'category', options_for_select(contact_form_issue_type_options), {}, {class: 'form-control', required: true } %>
25
+ <%= f.select 'category', options_for_select(contact_form_issue_type_options), { include_blank: t('hyrax.contact_form.select_type') }, {class: 'form-control', required: true } %>
24
26
  </div>
25
27
  </div>
26
28
 
@@ -2,7 +2,7 @@
2
2
  <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><%= t('.select') %> <span class="caret"></span>
3
3
  </button>
4
4
  <ul class="dropdown-menu dropdown-menu-right">
5
- <% if can? :edit, document %>
5
+ <% if can?( :edit, document ) && !workflow_restriction?(@presenter) %>
6
6
  <li>
7
7
  <%= link_to [main_app, :edit, document],
8
8
  class: "itemicon itemedit",
@@ -7,7 +7,7 @@
7
7
  </td>
8
8
  <td>
9
9
  <div class="media">
10
- <%= link_to [main_app, document], class: "media-left" do %>
10
+ <%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %>
11
11
  <%= render_thumbnail_tag document, { class: "hidden-xs file_listing_thumbnail", alt: document.title_or_label }, { suppress_link: true } %>
12
12
  <% end %>
13
13
  <div class="media-body">
@@ -17,7 +17,7 @@
17
17
  <%= label_tag(:sort, t(".sort_by")) %>
18
18
  <%= select_tag(:sort, options_from_collection_for_select(collection_member_sort_fields, 'first', lambda {|field| field.last.label}, h(params[:sort]))) %>
19
19
  <%= label_tag(:per_page) do %>
20
- <%= t(".show_par_page_html", select: select_tag(:per_page, options_for_select(['10', '20', '50', '100'], params[:per_page]), title: t('hyrax.dashboard.my.sr.results_per_page'))) %>
20
+ <%= t(".show_par_page_html", select: select_tag(:per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page, params[:per_page]), title: t('hyrax.dashboard.my.sr.results_per_page'))) %>
21
21
  <% end %>
22
22
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort)) %>
23
23
  <button class="btn btn-info"><span class="glyphicon glyphicon-refresh"></span> <%= t('helpers.action.refresh') %></button>
@@ -1,6 +1,5 @@
1
- <% if file_set.user_can_perform_any_action? %>
1
+ <% if (can?(:download, file_set.id) || can?(:destroy, file_set.id) || can?(:edit, file_set.id)) && !workflow_restriction?(file_set.parent) %>
2
2
  <div class="btn-group">
3
-
4
3
  <button class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button" id="dropdownMenu_<%= file_set.id %>" aria-haspopup="true" aria-expanded="false">
5
4
  <span class="sr-only"><%= t('.press_to') %> </span>
6
5
  <%= t('.header') %>
@@ -65,37 +65,8 @@
65
65
  </div>
66
66
  </div>
67
67
 
68
- <table class="table table-bordered">
69
- <tr>
70
- <th width="60%"><%= t('.table_title_user') %></th>
71
- <th width="40%"><%= t('.table_title_access') %></th>
72
- </tr>
73
- <tr id="file_permissions">
74
- <td>
75
- <%= label_tag :owner_access, class: "control-label" do %>
76
- <%= t('.depositor') %> (<span id="file_owner" data-depositor="<%= depositor %>"><%= link_to_profile depositor %></span>)
77
- <% end %>
78
- </td>
79
- <td>
80
- <%= configured_owner_permission_levels.keys.first %>
81
- </td>
82
- </tr>
83
- <%= f.fields_for :permissions do |permission_fields| %>
84
- <%# skip the public, registered, and depositor perms as they are displayed first at the top %>
85
- <% next if ['public', 'registered', depositor].include? permission_fields.object.agent_name.downcase %>
86
- <tr>
87
- <td><%= permission_fields.label :agent_name, class: "control-label" do %>
88
- <%= user_display_name_and_key(permission_fields.object.agent_name) %>
89
- <% end %></td>
90
- <td>
91
- <div class="col-sm-8">
92
- <%= permission_fields.select :access, Hyrax.config.permission_levels, {}, class: 'form-control select_perm' %>
93
- </div>
94
- <button class="btn close remove_perm" data-index="<%= permission_fields.index %>">X</button>
95
- </td>
96
- </tr>
97
- <% end %>
98
- </table>
68
+ <%= render 'currently_shared', f: f %>
69
+
99
70
  <script type="text/x-tmpl" id="tmpl-file-set-grant">
100
71
  <tr>
101
72
  <td><label class="control-label">{%= o.name %}</label></td>
@@ -5,7 +5,7 @@
5
5
  <%= link_to t('.analytics'), @presenter.stats_path, id: 'stats', class: 'btn btn-default', data: { turbolinks: false } %>
6
6
  <% end %>
7
7
 
8
- <% if @presenter.editor? %>
8
+ <% if @presenter.editor? && !workflow_restriction?(@presenter) %>
9
9
  <%= link_to t(".edit_this", type: @presenter.human_readable_type), edit_polymorphic_path([main_app, @presenter]),
10
10
  class: 'btn btn-default' %>
11
11
  <%= link_to t(".delete_this", type: @presenter.human_readable_type), [main_app, @presenter],
@@ -1,5 +1,5 @@
1
- <% if Hyrax.config.display_media_download_link? %>
2
- <div>
1
+ <% if Hyrax.config.display_media_download_link? && !workflow_restriction?(file_set.try(:parent)) %>
2
+ <div>
3
3
  <h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
4
4
  <audio controls="controls" class="audiojs" style="width:100%" controlsList="nodownload" preload="auto">
5
5
  <source src="<%= hyrax.download_path(file_set, file: 'ogg') %>" type="audio/ogg" />
@@ -1,6 +1,6 @@
1
1
  <div class="no-preview">
2
2
  <%= t('hyrax.works.show.no_preview') %>
3
- <% if Hyrax.config.display_media_download_link? %>
3
+ <% if Hyrax.config.display_media_download_link? && !workflow_restriction?(file_set.try(:parent)) %>
4
4
  <p /><%= link_to t('hyrax.file_set.show.download'),
5
5
  hyrax.download_path(file_set),
6
6
  id: "file_download",
@@ -1,4 +1,4 @@
1
- <% if Hyrax.config.display_media_download_link? && can?(:download, file_set.id) %>
1
+ <% if Hyrax.config.display_media_download_link? && can?(:download, file_set.id) && !workflow_restriction?(file_set.try(:parent)) %>
2
2
  <div>
3
3
  <h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
4
4
  <%= image_tag thumbnail_url(file_set),
@@ -1,4 +1,4 @@
1
- <% if Hyrax.config.display_media_download_link? %>
1
+ <% if Hyrax.config.display_media_download_link? && !workflow_restriction?(file_set.try(:parent)) %>
2
2
  <div>
3
3
  <h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
4
4
  <%= image_tag thumbnail_url(file_set),
@@ -1,5 +1,5 @@
1
- <% if Hyrax.config.display_media_download_link? %>
2
- <div>
1
+ <% if Hyrax.config.display_media_download_link? && !workflow_restriction?(file_set.try(:parent)) %>
2
+ <div>
3
3
  <h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
4
4
  <%= image_tag thumbnail_url(file_set),
5
5
  class: "representative-media",
@@ -1,5 +1,5 @@
1
- <% if Hyrax.config.display_media_download_link? %>
2
- <div>
1
+ <% if Hyrax.config.display_media_download_link? && !workflow_restriction?(file_set.try(:parent)) %>
2
+ <div>
3
3
  <h2 class="sr-only"><%= t('hyrax.file_set.show.downloadable_content.heading') %></h2>
4
4
  <video controls="controls" class="video-js vjs-default-skin" style="width:100%" data-setup="{}" controlsList="nodownload" preload="auto">
5
5
  <source src="<%= hyrax.download_path(file_set, file: 'webm') %>" type="video/webm" />
@@ -5,7 +5,7 @@
5
5
  <fieldset class="col-xs-12">
6
6
  <legend class="sr-only"><%= t('hyrax.dashboard.my.sr.results_per_page') %></legend>
7
7
  <%= label_tag :per_page do %>
8
- Show <%= select_tag :per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])),
8
+ Show <%= select_tag :per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page.map(&:to_s), h(params[:per_page])),
9
9
  title: t(".number_of_results_to_display_per_page") %> per page
10
10
  <% end %>
11
11
  <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort, :utf8)) %>
@@ -22,7 +22,7 @@ signed in %>
22
22
 
23
23
  <!-- application js -->
24
24
  <%= javascript_include_tag 'application' %>
25
- <%= tinymce_assets if can? :update, ContentBlock %>
25
+
26
26
  <%= render 'shared/appearance_styles' %>
27
27
 
28
28
  <!-- Google Analytics -->
@@ -14,28 +14,31 @@
14
14
  <meta name="twitter:label2" content="Rights Statement" />
15
15
  <% end %>
16
16
 
17
+ <% gscholar = Hyrax::GoogleScholarPresenter.new(@presenter) %>
18
+
19
+ <% if gscholar.scholarly? %>
17
20
  <% content_for(:gscholar_meta) do %>
18
- <meta name="description" content="<%= @presenter.description.first.truncate(200) rescue @presenter.title.first %>" />
19
- <meta name="citation_title" content="<%= @presenter.title.first %>" />
21
+ <meta name="description" content="<%= gscholar.description %>" />
22
+ <meta name="citation_title" content="<%= gscholar.title %>" />
20
23
 
21
- <% @presenter.creator.each do |creator| %>
22
- <meta name="citation_author" content="<%= creator %>" />
24
+ <% gscholar.authors.each do |author| %>
25
+ <meta name="citation_author" content="<%= author %>" />
23
26
  <% end %>
24
27
 
25
- <% unless @presenter.date_created.blank? %>
26
- <meta name="citation_publication_date" content="<%= @presenter.date_created.first %>" />
28
+ <% if gscholar.publication_date.present? %>
29
+ <meta name="citation_publication_date" content="<%= gscholar.publication_date %>" />
27
30
  <% end %>
28
31
 
29
- <% unless @presenter.download_url.blank? %>
30
- <meta name="citation_pdf_url" content="<%= @presenter.download_url %>" />
32
+ <% if gscholar.pdf_url.present? %>
33
+ <meta name="citation_pdf_url" content="<%= gscholar.pdf_url %>" />
31
34
  <% end %>
32
35
 
33
- <% unless @presenter.keyword.blank? %>
34
- <meta name="citation_keywords" content="<%= @presenter.keyword.join('; ') %>" />
36
+ <% if gscholar.keywords.present? %>
37
+ <meta name="citation_keywords" content="<%= gscholar.keywords %>" />
35
38
  <% end %>
36
39
 
37
- <% unless @presenter.publisher.blank? %>
38
- <meta name="citation_publisher" content="<%= @presenter.publisher.join('; ') %>" />
40
+ <% if gscholar.publisher.present? %>
41
+ <meta name="citation_publisher" content="<%= gscholar.publisher %>" />
39
42
  <% end %>
40
43
 
41
44
  <!-- Hyrax does not yet support these metadata -->
@@ -47,3 +50,4 @@
47
50
  <meta name="citation_lastpage" content=""/>
48
51
  -->
49
52
  <% end %>
53
+ <% end %>