sufia 6.0.0.rc2 → 6.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -5
- data/History.md +14 -0
- data/LICENSE +15 -0
- data/SUFIA_VERSION +1 -1
- data/app/assets/javascripts/sufia/batch_edit.js +1 -1
- data/app/assets/javascripts/sufia/permissions.js +8 -12
- data/app/assets/stylesheets/sufia.css.scss +1 -1
- data/app/assets/stylesheets/sufia/_multi_value_fields.css.scss +67 -0
- data/app/assets/stylesheets/sufia/_settings.scss +1 -0
- data/app/assets/stylesheets/sufia/_styles.scss +4 -0
- data/app/assets/stylesheets/sufia/_tinymce.scss +14 -0
- data/app/controllers/batch_controller.rb +11 -2
- data/app/controllers/concerns/sufia/breadcrumbs.rb +2 -3
- data/app/controllers/concerns/sufia/collections_controller_behavior.rb +0 -1
- data/app/controllers/concerns/sufia/contact_form_controller_behavior.rb +1 -2
- data/app/controllers/concerns/sufia/controller.rb +1 -7
- data/app/controllers/concerns/sufia/downloads_controller_behavior.rb +3 -8
- data/app/controllers/concerns/sufia/files_controller/local_ingest_behavior.rb +2 -3
- data/app/controllers/concerns/sufia/files_controller/upload_complete_behavior.rb +1 -2
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +27 -14
- data/app/controllers/concerns/sufia/homepage_controller.rb +3 -2
- data/app/controllers/content_blocks_controller.rb +17 -1
- data/app/controllers/downloads_controller.rb +0 -1
- data/app/controllers/my/shares_controller.rb +1 -0
- data/app/controllers/single_use_links_controller.rb +0 -1
- data/app/controllers/single_use_links_viewer_controller.rb +3 -8
- data/app/forms/sufia/forms/generic_file_edit_form.rb +1 -8
- data/app/helpers/content_block_helper.rb +30 -10
- data/app/helpers/generic_file_helper.rb +4 -4
- data/app/helpers/sufia/dashboard_helper_behavior.rb +2 -2
- data/app/helpers/sufia/sufia_helper_behavior.rb +4 -4
- data/app/helpers/trophy_helper.rb +3 -3
- data/app/jobs/content_delete_event_job.rb +1 -2
- data/app/jobs/content_deposit_event_job.rb +1 -1
- data/app/jobs/content_depositor_change_event_job.rb +1 -1
- data/app/jobs/content_new_version_event_job.rb +1 -1
- data/app/jobs/content_restored_version_event_job.rb +1 -1
- data/app/jobs/content_update_event_job.rb +1 -1
- data/app/models/concerns/sufia/solr_document_behavior.rb +5 -9
- data/app/models/content_block.rb +20 -0
- data/app/models/featured_work_list.rb +4 -0
- data/app/presenters/sufia/collection_presenter.rb +14 -2
- data/app/presenters/sufia/generic_file_presenter.rb +16 -0
- data/app/presenters/sufia/version_list_presenter.rb +1 -1
- data/app/views/batch/_metadata.html.erb +4 -4
- data/app/views/batch_edits/edit.html.erb +1 -1
- data/app/views/collections/_action_menu.html.erb +4 -5
- data/app/views/collections/_show_descriptions.html.erb +1 -5
- data/app/views/collections/_show_document_list.html.erb +0 -2
- data/app/views/collections/_show_document_list_menu.html.erb +5 -6
- data/app/views/collections/_show_document_list_row.html.erb +9 -9
- data/app/views/collections/_sort_and_per_page.html.erb +1 -1
- data/app/views/collections/_view_type_group.html.erb +1 -1
- data/app/views/collections/show.html.erb +3 -3
- data/app/views/generic_files/_asset_permissions_denial_flash.html.erb +1 -1
- data/app/views/generic_files/_asset_saved_flash.html.erb +1 -1
- data/app/views/generic_files/_asset_updated_flash.html.erb +1 -1
- data/app/views/generic_files/_browse_everything.html.erb +4 -4
- data/app/views/generic_files/_media_display.html.erb +9 -9
- data/app/views/generic_files/_permission_form.html.erb +1 -1
- data/app/views/generic_files/_show_actions.html.erb +1 -1
- data/app/views/generic_files/_show_collections.html.erb +2 -2
- data/app/views/generic_files/_show_details.html.erb +1 -1
- data/app/views/generic_files/_versioning.html.erb +9 -5
- data/app/views/generic_files/jq_upload.json.jbuilder +1 -1
- data/app/views/generic_files/new.html.erb +2 -3
- data/app/views/generic_files/show.html.erb +13 -16
- data/app/views/generic_files/upload/_alerts.html.erb +2 -2
- data/app/views/generic_files/upload/_form_fields.html.erb +1 -1
- data/app/views/generic_files/upload/_local_file_import_chooser.html.erb +1 -1
- data/app/views/generic_files/upload/_script_templates.html.erb +2 -2
- data/app/views/homepage/_featured.html.erb +2 -4
- data/app/views/homepage/_featured_researcher.html.erb +1 -1
- data/app/views/homepage/_featured_works.html.erb +5 -3
- data/app/views/homepage/_home_content.html.erb +1 -1
- data/app/views/homepage/_recent_document.html.erb +2 -2
- data/app/views/homepage/_sortable_featured.html.erb +1 -2
- data/app/views/my/_action_menu.html.erb +8 -8
- data/app/views/my/_collection_action_menu.html.erb +4 -4
- data/app/views/my/_index_partials/_list_collections.html.erb +9 -12
- data/app/views/my/_index_partials/_list_files.html.erb +9 -9
- data/app/views/my/index.html.erb +0 -1
- data/app/views/records/_rights_modal.html.erb +1 -0
- data/app/views/users/_contributions.html.erb +2 -3
- data/app/views/users/_edit_primary.html.erb +68 -0
- data/app/views/users/_edit_secondary.html.erb +1 -0
- data/app/views/users/_trophy_edit.html.erb +1 -3
- data/app/views/users/edit.html.erb +4 -78
- data/config/initializers/simple_form.rb +167 -0
- data/config/initializers/simple_form_bootstrap.rb +137 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/locales/sufia.en.yml +7 -4
- data/config/routes.rb +1 -1
- data/lib/generators/sufia/templates/catalog_controller.rb +1 -1
- data/lib/sufia/single_use_error.rb +1 -1
- data/lib/sufia/version.rb +1 -1
- data/spec/actors/generic_file/actor_spec.rb +5 -5
- data/spec/controllers/batch_controller_spec.rb +15 -0
- data/spec/controllers/collections_controller_spec.rb +1 -1
- data/spec/controllers/content_blocks_controller_spec.rb +23 -3
- data/spec/controllers/downloads_controller_spec.rb +5 -5
- data/spec/controllers/generic_files_controller_spec.rb +12 -12
- data/spec/controllers/homepage_controller_spec.rb +19 -6
- data/spec/controllers/my/files_controller_spec.rb +8 -10
- data/spec/controllers/my/shares_controller_spec.rb +34 -23
- data/spec/controllers/single_use_links_controller_spec.rb +2 -3
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +19 -20
- data/spec/controllers/users_controller_spec.rb +8 -8
- data/spec/factories/generic_files.rb +4 -4
- data/spec/factories/users.rb +2 -3
- data/spec/features/browse_dashboard_files_spec.rb +8 -8
- data/spec/features/collection_spec.rb +15 -8
- data/spec/features/edit_file_spec.rb +26 -0
- data/spec/features/single_use_links_spec.rb +3 -3
- data/spec/forms/generic_file_edit_form_spec.rb +8 -1
- data/spec/helpers/content_block_helper_spec.rb +10 -0
- data/spec/helpers/dashboard_helper_spec.rb +42 -0
- data/spec/helpers/sufia_helper_spec.rb +34 -7
- data/spec/helpers/trophy_helper_spec.rb +6 -6
- data/spec/inputs/select_with_help_input_spec.rb +16 -0
- data/spec/jobs/audit_job_spec.rb +1 -1
- data/spec/jobs/characterize_job_spec.rb +2 -7
- data/spec/jobs/create_derivatives_job_spec.rb +27 -38
- data/spec/jobs/import_url_job_spec.rb +2 -2
- data/spec/jobs/ingest_local_file_job_spec.rb +6 -8
- data/spec/lib/sufia/id_service_spec.rb +0 -7
- data/spec/lib/sufia/messages_spec.rb +16 -13
- data/spec/models/ability_spec.rb +3 -0
- data/spec/models/checksum_audit_log_spec.rb +1 -1
- data/spec/models/content_block_spec.rb +41 -0
- data/spec/models/featured_work_list_spec.rb +23 -9
- data/spec/models/file_content_datastream_spec.rb +4 -4
- data/spec/models/file_usage_spec.rb +1 -1
- data/spec/models/fits_datastream_spec.rb +4 -4
- data/spec/models/generic_file_spec.rb +31 -15
- data/spec/models/single_use_link_spec.rb +2 -2
- data/spec/models/solr_document_spec.rb +8 -5
- data/spec/models/user_spec.rb +3 -3
- data/spec/presenters/sufia/collection_presenter_spec.rb +34 -0
- data/spec/presenters/sufia/generic_file_presenter_spec.rb +41 -1
- data/spec/presenters/sufia/version_list_presenter_spec.rb +12 -2
- data/spec/services/generic_file_audit_service_spec.rb +3 -3
- data/spec/services/noid_spec.rb +4 -11
- data/spec/services/repository_audit_service_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/support/fixture_helpers.rb +2 -3
- data/spec/support/selectors.rb +7 -7
- data/spec/test_app_templates/Gemfile.extra +1 -0
- data/spec/views/batch/edit.html.erb_spec.rb +14 -17
- data/spec/views/collections/_show_descriptions.html.erb_spec.rb +1 -1
- data/spec/views/generic_file/_permission_form.html.erb_spec.rb +29 -7
- data/spec/views/generic_file/edit.html.erb_spec.rb +1 -1
- data/spec/views/generic_file/show.html.erb_spec.rb +69 -151
- data/spec/views/generic_file/stats.html.erb_spec.rb +1 -1
- data/spec/views/homepage/_featured_works.html.erb_spec.rb +29 -0
- data/spec/views/users/show.html.erb_spec.rb +1 -1
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +12 -8
- data/sufia-models/app/jobs/batch_update_job.rb +2 -2
- data/sufia-models/app/jobs/import_url_job.rb +5 -3
- data/sufia-models/app/jobs/ingest_local_file_job.rb +46 -0
- data/sufia-models/app/jobs/resolrize_job.rb +1 -8
- data/sufia-models/app/models/batch.rb +0 -7
- data/sufia-models/app/models/concerns/sufia/ability.rb +1 -1
- data/sufia-models/app/models/concerns/sufia/{collection.rb → collection_behavior.rb} +1 -13
- data/sufia-models/app/models/concerns/sufia/generic_file/batches.rb +3 -4
- data/sufia-models/app/models/concerns/sufia/generic_file/export.rb +1 -1
- data/sufia-models/app/models/concerns/sufia/generic_file/featured.rb +1 -4
- data/sufia-models/app/models/concerns/sufia/generic_file/metadata.rb +7 -7
- data/sufia-models/app/models/concerns/sufia/generic_file/trophies.rb +1 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/virus_check.rb +16 -11
- data/sufia-models/app/models/concerns/sufia/model_methods.rb +1 -14
- data/sufia-models/app/models/concerns/sufia/user.rb +5 -0
- data/sufia-models/app/models/file_usage.rb +1 -1
- data/sufia-models/app/models/file_view_stat.rb +1 -1
- data/sufia-models/app/models/sufia/collection.rb +5 -0
- data/sufia-models/app/services/sufia/generic_file_indexing_service.rb +1 -1
- data/sufia-models/app/services/sufia/id_service.rb +1 -2
- data/sufia-models/app/services/sufia/noid.rb +4 -24
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +6 -1
- data/sufia-models/lib/generators/sufia/models/templates/app/models/collection.rb +2 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/resque_config.rb +1 -1
- data/sufia-models/lib/generators/sufia/models/templates/config/solrconfig.xml +46 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +9 -5
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_external_key_to_content_blocks.rb +6 -0
- data/sufia-models/lib/generators/sufia/models/update_content_blocks_generator.rb +18 -0
- data/sufia-models/lib/sufia/messages.rb +11 -12
- data/sufia-models/lib/sufia/models/engine.rb +2 -1
- data/sufia-models/lib/sufia/models/stats/user_stat_importer.rb +9 -5
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/sufia-models.gemspec +5 -5
- data/sufia.gemspec +15 -15
- data/tasks/sufia-dev.rake +0 -16
- metadata +86 -64
- data/LICENSE.md +0 -14
- data/app/jobs/ingest_local_file_job.rb +0 -39
- data/sufia-models/app/models/collection.rb +0 -3
- data/sufia-models/app/services/sufia/indexing_service.rb +0 -15
@@ -9,7 +9,7 @@ module Sufia
|
|
9
9
|
private
|
10
10
|
|
11
11
|
def wrapped_list
|
12
|
-
@wrapped_list ||= @raw_list.map { |v| Sufia::VersionPresenter.new(v) }.sort
|
12
|
+
@wrapped_list ||= @raw_list.map { |v| Sufia::VersionPresenter.new(v) }.sort { |a,b| b.version.created <=> a.version.created }.tap { |l| l.first.try(:current!) }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -28,14 +28,14 @@
|
|
28
28
|
<div class="col-sm-6">
|
29
29
|
<h3>Applies to all files just uploaded</h3>
|
30
30
|
<%= f.input :resource_type, as: :select_with_help, collection: Sufia.config.resource_types,
|
31
|
-
input_html: { class: 'form-control', multiple: true
|
31
|
+
input_html: { class: 'form-control', multiple: true } %>
|
32
32
|
|
33
|
-
<%= f.input :tag, as: :multi_value_with_help
|
33
|
+
<%= f.input :tag, as: :multi_value_with_help %>
|
34
34
|
|
35
|
-
<%= f.input :creator, as: :multi_value_with_help
|
35
|
+
<%= f.input :creator, as: :multi_value_with_help %>
|
36
36
|
|
37
37
|
<%= f.input :rights, as: :select_with_modal_help, collection: Sufia.config.cc_licenses,
|
38
|
-
input_html: { class: 'form-control', multiple: true
|
38
|
+
input_html: { class: 'form-control', multiple: true } %>
|
39
39
|
|
40
40
|
<%= render "generic_files/rights_modal" %>
|
41
41
|
|
@@ -55,4 +55,4 @@
|
|
55
55
|
<!-- Ajax call to clear the batch before page uload. -->
|
56
56
|
<%= button_to "Clear Batch", { controller: :batch_edits, action: :clear }, form_class: 'hidden', remote: true, id: 'clear_batch' %>
|
57
57
|
|
58
|
-
</div><!-- descriptions_display -->
|
58
|
+
</div><!-- descriptions_display -->
|
@@ -6,19 +6,18 @@
|
|
6
6
|
<%= button_for_remove_from_collection(gf, 'Remove from Collection') %>
|
7
7
|
</li>
|
8
8
|
<li>
|
9
|
-
<%= link_to raw('<i class="glyphicon glyphicon-link over"></i> Single-Use Link to File'), '#', class: "copypaste itemicon itemcode", title: "Single-Use Link to File", id: "copy_link_#{
|
9
|
+
<%= link_to raw('<i class="glyphicon glyphicon-link over"></i> Single-Use Link to File'), '#', class: "copypaste itemicon itemcode", title: "Single-Use Link to File", id: "copy_link_#{id}" %>
|
10
10
|
</li>
|
11
11
|
<li>
|
12
|
-
<%= link_to raw('<i class="glyphicon glyphicon-pencil"></i> Edit File'), sufia.edit_generic_file_path(
|
12
|
+
<%= link_to raw('<i class="glyphicon glyphicon-pencil"></i> Edit File'), sufia.edit_generic_file_path(id), class: 'itemicon itemedit', title: 'Edit File' %>
|
13
13
|
</li>
|
14
14
|
<li>
|
15
|
-
<%= link_to raw('<i class="glyphicon glyphicon-download-alt"></i> Download File'), sufia.download_path(
|
15
|
+
<%= link_to raw('<i class="glyphicon glyphicon-download-alt"></i> Download File'), sufia.download_path(id), class: 'itemicon itemdownload', title: 'Download File', target: '_new' %>
|
16
16
|
</li>
|
17
17
|
<li>
|
18
|
-
<%= display_trophy_link(@user,
|
18
|
+
<%= display_trophy_link(@user, id) do |text| %>
|
19
19
|
<i class='glyphicon glyphicon-star'></i> <%= text %>
|
20
20
|
<% end %>
|
21
21
|
</li>
|
22
22
|
</ul>
|
23
23
|
</div>
|
24
|
-
|
@@ -1,10 +1,6 @@
|
|
1
1
|
<h2 class="sr-only">Descriptions</h2>
|
2
2
|
<dl class="metadata-collections">
|
3
|
-
|
4
|
-
<dd><%= @presenter.total_items %></dd>
|
5
|
-
<dt><%= t(".size") %></dt>
|
6
|
-
<dd><%= @presenter.size %></dd>
|
7
|
-
<% present_terms(@presenter, @presenter.terms_with_values) do |r, term| %>
|
3
|
+
<% present_terms(@presenter, @presenter.terms_with_values - [:title, :description]) do |r, term| %>
|
8
4
|
<dt><%= r.label(term) %></dt>
|
9
5
|
<dd><%= r.value(term) %></dd>
|
10
6
|
<% end %>
|
@@ -4,23 +4,22 @@
|
|
4
4
|
<ul class="dropdown-menu dropdown-menu-right">
|
5
5
|
<li>
|
6
6
|
<%= link_to raw('<i class="glyphicon glyphicon-link over"></i> Single-Use Link to File'), '#',
|
7
|
-
class: "copypaste itemicon itemcode", title: "Single-Use Link to File", id: "copy_link_#{
|
7
|
+
class: "copypaste itemicon itemcode", title: "Single-Use Link to File", id: "copy_link_#{id}" %>
|
8
8
|
</li>
|
9
9
|
<li>
|
10
|
-
<%= link_to raw('<i class="glyphicon glyphicon-pencil"></i> Edit File'), sufia.edit_generic_file_path(
|
10
|
+
<%= link_to raw('<i class="glyphicon glyphicon-pencil"></i> Edit File'), sufia.edit_generic_file_path(id),
|
11
11
|
class: 'itemicon itemedit', title: 'Edit File' %>
|
12
12
|
</li>
|
13
13
|
<li>
|
14
|
-
<%= link_to raw('<i class="glyphicon glyphicon-download-alt"></i> Download File'), sufia.download_path(
|
14
|
+
<%= link_to raw('<i class="glyphicon glyphicon-download-alt"></i> Download File'), sufia.download_path(id),
|
15
15
|
class: 'itemicon itemdownload', title: 'Download File', target: '_new' %>
|
16
16
|
</li>
|
17
|
-
<% if current_user %>
|
17
|
+
<% if current_user %>
|
18
18
|
<li>
|
19
|
-
<%= display_trophy_link(current_user,
|
19
|
+
<%= display_trophy_link(current_user, id) do |text| %>
|
20
20
|
<i class='glyphicon glyphicon-star'></i> <%= text %>
|
21
21
|
<% end %>
|
22
22
|
</li>
|
23
23
|
<% end %>
|
24
24
|
</ul>
|
25
25
|
</div>
|
26
|
-
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<%
|
2
|
-
<tr id="document_<%=
|
1
|
+
<% id = document.id %>
|
2
|
+
<tr id="document_<%= id %>" class="<%= cycle("", "zebra") %>">
|
3
3
|
<% gf = document.to_model%>
|
4
4
|
<td>
|
5
5
|
<%# This block is for adding/removing the magic wand while batch updates are processing %>
|
6
6
|
<% if gf.processing? %>
|
7
|
-
<i class="glyphicon glyphicon-time <%= 'ss-'+gf.batch.
|
7
|
+
<i class="glyphicon glyphicon-time <%= 'ss-'+gf.batch.id %>"/>
|
8
8
|
<% elsif current_user and gf.depositor != current_user.user_key %>
|
9
9
|
<i class="glyphicon glyphicon-share-alt"/>
|
10
10
|
<% end %>
|
@@ -16,8 +16,8 @@
|
|
16
16
|
<% end %>
|
17
17
|
<div class="media-body">
|
18
18
|
<h4 class="media-heading">
|
19
|
-
<%= link_to document.title_or_label, sufia.generic_file_path(
|
20
|
-
<a href="#" class="small" title="Click for more details"><i id="expand_<%=
|
19
|
+
<%= link_to document.title_or_label, sufia.generic_file_path(document), id: "src_copy_link#{id}", class: "#{'document-title' if document.title_or_label == document.label}" %>
|
20
|
+
<a href="#" class="small" title="Click for more details"><i id="expand_<%= id %>" class="glyphicon glyphicon-chevron-right"></i></a>
|
21
21
|
</h4>
|
22
22
|
<%= render_collection_list(gf) %>
|
23
23
|
</div>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</td>
|
26
26
|
<td class="text-center"><%= document.date_uploaded %> </td>
|
27
27
|
<td class="text-center">
|
28
|
-
<a href="<%= sufia.generic_file_path(
|
28
|
+
<a href="<%= sufia.generic_file_path(document) %>/edit/?tab=permissions" id="permission_<%= id %>" class="visibility-link">
|
29
29
|
<% if document.registered? %>
|
30
30
|
<span class="label label-info" title="<%= t('sufia.institution_name') %>"><%= t('sufia.institution_name') %></span>
|
31
31
|
<% elsif document.public? %>
|
@@ -36,14 +36,14 @@
|
|
36
36
|
</a>
|
37
37
|
</td>
|
38
38
|
<td class="text-center">
|
39
|
-
<%= render partial: 'show_document_list_menu', locals: {
|
39
|
+
<%= render partial: 'show_document_list_menu', locals: { id: id, gf: gf } %>
|
40
40
|
</td>
|
41
41
|
</tr>
|
42
|
-
<tr id="detail_<%=
|
42
|
+
<tr id="detail_<%= id %>"> <!-- document detail"> -->
|
43
43
|
<td colspan="6">
|
44
44
|
<dl class="expanded-details row">
|
45
45
|
<dt class="col-xs-3 col-lg-2">File Name:</dt>
|
46
|
-
<dd class="col-xs-9 col-lg-4"><%= link_to document.label, sufia.generic_file_path(
|
46
|
+
<dd class="col-xs-9 col-lg-4"><%= link_to document.label, sufia.generic_file_path(document) %></dd>
|
47
47
|
<dt class="col-xs-3 col-lg-2">File Format:</dt>
|
48
48
|
<dd class="col-xs-9 col-lg-4"><%= document.file_format %>JPG</dd>
|
49
49
|
<dt class="col-xs-3 col-lg-2">Creator:</dt>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<div class="sort-toggle">
|
13
13
|
<%# kind of hacky way to get this to work on catalog and folder controllers. May be able to simple do {action: "index"} but I'm not sure -%>
|
14
14
|
<% unless @response.response['numFound'] < 2 %>
|
15
|
-
<%= form_tag collections.collection_path(@collection
|
15
|
+
<%= form_tag collections.collection_path(@collection), method: :get, class: 'per_page form-inline' do %>
|
16
16
|
<%= label_tag(:sort, "<span>Sort By:</span>".html_safe) %>
|
17
17
|
<%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort]))) %>
|
18
18
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<span class="sr-only"><%= t('blacklight.search.view_title') %></span>
|
4
4
|
<div class="view-type-group btn-group">
|
5
5
|
<% document_index_views.each do |view, config| %>
|
6
|
-
<%= link_to collections.collection_path(
|
6
|
+
<%= link_to collections.collection_path(params[:id], view: view), title: t("blacklight.search.view_title.#{view}", default: t("blacklight.search.view.#{view}", default: blacklight_config.view[view].title)), class: "btn btn-default view-type-#{ view.to_s.parameterize } #{"active" if document_index_view_type == view}" do %>
|
7
7
|
<%= render_view_type_group_icon view %>
|
8
8
|
<span class="caption"><%= t("blacklight.search.view.#{view}") %></span>
|
9
9
|
<% end %>
|
@@ -5,11 +5,11 @@
|
|
5
5
|
<div itemscope itemtype="http://schema.org/CollectionPage" class="row">
|
6
6
|
<div class="col-sm-10 pull-right">
|
7
7
|
<header>
|
8
|
-
<h1><%= @
|
9
|
-
<p class="collection_description"
|
8
|
+
<h1><%= @presenter.title %></h1>
|
9
|
+
<p class="collection_description"><%= @presenter.description %></p>
|
10
10
|
</header>
|
11
11
|
<% unless has_collection_search_parameters? %>
|
12
|
-
<%= render
|
12
|
+
<%= render 'collections/show_descriptions' %>
|
13
13
|
<% end %>
|
14
14
|
</div>
|
15
15
|
<div class="col-sm-2">
|
@@ -1,6 +1,6 @@
|
|
1
1
|
The file(s)
|
2
2
|
<% generic_files.first(20).each do |gf|%>
|
3
|
-
<%= link_to(gf, generic_file_url(gf
|
3
|
+
<%= link_to(gf, generic_file_url(gf)) %><%= ',' unless gf == generic_files.last %>
|
4
4
|
<% end %>
|
5
5
|
<%= '...' if generic_files.length > 20 %>
|
6
6
|
could not be updated. You do not have sufficient privileges to edit it.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
The file(s)
|
2
2
|
<% generic_files.first(20).each do |gf|%>
|
3
|
-
<%= link_to(gf, generic_file_url(gf
|
3
|
+
<%= link_to(gf, generic_file_url(gf)) %><%= ',' unless gf == generic_files.last %>
|
4
4
|
<% end %>
|
5
5
|
<%= '...' if generic_files.length > 20 %>
|
6
6
|
have been saved.
|
@@ -1 +1 @@
|
|
1
|
-
The file <%= link_to(generic_file, sufia.generic_file_url(generic_file
|
1
|
+
The file <%= link_to(generic_file, sufia.generic_file_url(generic_file)) %> has been updated.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="well">
|
4
4
|
<%= form_tag(sufia.generic_files_path, id: 'browse_everything_form', method: 'post') do %>
|
5
5
|
<%= render partial: 'generic_files/upload/tos_checkbox' %>
|
6
|
-
<%= hidden_field_tag(:batch_id, @
|
6
|
+
<%= hidden_field_tag(:batch_id, @batch_id) %>
|
7
7
|
<%= button_tag(t('sufia.upload.browse_everything.browse_files_button'), type: 'button', class: 'btn btn-lg btn-success', id: "browse-btn",
|
8
8
|
'data-toggle' => 'browse-everything', 'data-route' => browse_everything_engine.root_path,
|
9
9
|
'data-target' => '#browse_everything_form' ) %>
|
@@ -16,9 +16,9 @@
|
|
16
16
|
// Update the count in #status element when user selects files.
|
17
17
|
$(document).ready(function() {
|
18
18
|
$('#browse-btn').browseEverything()
|
19
|
-
.done(function(data) {
|
20
|
-
$('#status').html(data.length.toString() + " <%= t('sufia.upload.browse_everything.files_selected')%>")
|
21
|
-
$('#submit-btn').html("Submit "+data.length.toString() + " selected files")
|
19
|
+
.done(function(data) {
|
20
|
+
$('#status').html(data.length.toString() + " <%= t('sufia.upload.browse_everything.files_selected')%>")
|
21
|
+
$('#submit-btn').html("Submit "+data.length.toString() + " selected files")
|
22
22
|
})
|
23
23
|
});
|
24
24
|
</script>
|
@@ -3,31 +3,31 @@
|
|
3
3
|
<%= render_download_icon "Download the full-sized image" %>
|
4
4
|
|
5
5
|
<% elsif @generic_file.video? %>
|
6
|
-
|
6
|
+
|
7
7
|
<video controls="controls" class="video-js vjs-default-skin" data-setup="{}" preload="auto">
|
8
|
-
<source src="<%= sufia.download_path(@generic_file,
|
9
|
-
<source src="<%= sufia.download_path(@generic_file,
|
8
|
+
<source src="<%= sufia.download_path(@generic_file, file: 'webm') %>" type="video/webm" />
|
9
|
+
<source src="<%= sufia.download_path(@generic_file, file: 'mp4') %>" type="video/mp4" />
|
10
10
|
Your browser does not support the video tag.
|
11
11
|
</video>
|
12
12
|
|
13
13
|
<% elsif @generic_file.audio? %>
|
14
|
-
|
14
|
+
|
15
15
|
<audio controls="controls" class="audiojs" preload="auto">
|
16
|
-
<source src="<%= sufia.download_path(@generic_file,
|
17
|
-
<source src="<%= sufia.download_path(@generic_file,
|
16
|
+
<source src="<%= sufia.download_path(@generic_file, file: 'ogg') %>" type="audio/ogg" />
|
17
|
+
<source src="<%= sufia.download_path(@generic_file, file: 'mp3') %>" type="audio/mpeg" />
|
18
18
|
Your browser does not support the audio tag.
|
19
19
|
</audio>
|
20
20
|
|
21
|
-
<% elsif @generic_file.pdf
|
21
|
+
<% elsif @generic_file.pdf? %>
|
22
22
|
|
23
23
|
<%= render_download_icon "Download the full-sized PDF" %>
|
24
24
|
|
25
|
-
<% elsif @generic_file.office_document
|
25
|
+
<% elsif @generic_file.office_document? %>
|
26
26
|
|
27
27
|
<%= render_download_icon "Download the full-sized Document" %>
|
28
28
|
|
29
29
|
<% else %>
|
30
30
|
|
31
31
|
<%= render_download_icon %>
|
32
|
-
|
32
|
+
|
33
33
|
<% end %>
|
@@ -108,7 +108,7 @@
|
|
108
108
|
<div class="col-sm-8">
|
109
109
|
<%= permission_fields.select :access, Sufia.config.permission_levels, {}, class: 'form-control select_perm' %>
|
110
110
|
</div>
|
111
|
-
<button class="btn close remove_perm">X</button>
|
111
|
+
<button class="btn close remove_perm" data-index="<%= permission_fields.index %>">X</button>
|
112
112
|
</td>
|
113
113
|
</tr>
|
114
114
|
<% end %>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<% end %>
|
25
25
|
</p>
|
26
26
|
<p>Export to:
|
27
|
-
<%= link_to 'EndNote', sufia.generic_file_path(@generic_file
|
27
|
+
<%= link_to 'EndNote', sufia.generic_file_path(@generic_file, format: 'endnote') %>
|
28
28
|
|
|
29
29
|
<%= link_to 'Zotero', sufia.static_path('zotero'), {id: 'zoteroLink', name: 'zotero', class: 'lightboxLink'} %>
|
30
30
|
|
|
@@ -7,8 +7,8 @@
|
|
7
7
|
<tbody>
|
8
8
|
<% @generic_file.collections.each do |collection| %>
|
9
9
|
<tr class="collection attributes">
|
10
|
-
<%= content_tag :td, class: 'attribute title', data: {
|
11
|
-
<%= link_to collection.title, collections.collection_path(collection
|
10
|
+
<%= content_tag :td, class: 'attribute title', data: { id: collection.id } do %>
|
11
|
+
<%= link_to collection.title, collections.collection_path(collection) %>
|
12
12
|
<% end %>
|
13
13
|
</tr>
|
14
14
|
<% end %>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="versioning_display" class="tab-pane">
|
2
2
|
<h2>Versions</h2>
|
3
3
|
<div class="well">
|
4
|
+
|
4
5
|
<%= form_for [sufia, @generic_file], html: { multipart: true } do |f| %>
|
5
6
|
<%= hidden_field_tag('redirect_tab', 'versions') %>
|
6
7
|
<h3>Upload New Version</h3>
|
@@ -8,20 +9,22 @@
|
|
8
9
|
<div class="col-xs-12">
|
9
10
|
<p>Upload a new version of this file from your computer.</p>
|
10
11
|
<p id="upload_field">
|
11
|
-
<%= file_field_tag "filedata"
|
12
|
+
<%= file_field_tag "filedata", required: 'required' %>
|
12
13
|
</p>
|
13
14
|
<%= f.button '<i class="glyphicon glyphicon-upload"></i> Upload New Version'.html_safe, name: "update_versioning", id: "upload_submit", onclick: "confirmation_needed = false;", class: "btn btn-primary" %>
|
14
15
|
</div>
|
15
16
|
</div>
|
16
|
-
|
17
|
+
<% end %>
|
17
18
|
|
19
|
+
<%= form_for [sufia, @generic_file], html: { multipart: true } do |f| %>
|
18
20
|
<h3>Restore Previous Version</h3>
|
19
21
|
<% @version_list.each do |version| %>
|
20
22
|
<div class="form-group">
|
21
23
|
<div class="col-xs-12">
|
22
|
-
<label class="radio">
|
23
|
-
<%= radio_button_tag(:revision, version.label, version.current
|
24
|
-
|
24
|
+
<label class="radio <%= version.current? ? 'disabled' : '' %>">
|
25
|
+
<%= radio_button_tag(:revision, version.label, false, disabled: version.current?, required: 'required') %>
|
26
|
+
<%= version.current? ? 'Current version:' : 'Restore from' %>
|
27
|
+
<%= version.created %> [by <%= version.committer %>]
|
25
28
|
</label>
|
26
29
|
</div>
|
27
30
|
</div>
|
@@ -29,5 +32,6 @@
|
|
29
32
|
<div id="save_version_note" class="alert hide">You must click "Save Revision" to revert a previous version of this file</div>
|
30
33
|
<%= f.button '<i class="glyphicon glyphicon-save"></i> Save Revision'.html_safe, type: 'submit', class: 'btn btn-primary', onclick: "confirmation_needed = false;", name: "revert_submit", id: "revert_submit" %>
|
31
34
|
<% end %>
|
35
|
+
|
32
36
|
</div> <!-- /well -->
|
33
37
|
</div> <!-- /row -->
|
@@ -1,7 +1,7 @@
|
|
1
1
|
json.array! [@generic_file] do |generic_file|
|
2
2
|
json.name generic_file.title.first
|
3
3
|
json.size generic_file.file_size.first
|
4
|
-
json.url "/files/#{generic_file.
|
4
|
+
json.url "/files/#{generic_file.id}"
|
5
5
|
json.thumbnail_url generic_file.id
|
6
6
|
json.delete_url "deleteme"
|
7
7
|
json.delete_type "DELETE"
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<h2>Upload</h2>
|
2
2
|
<%# using partials rather than inlining, so implementers can add or change stuff on this page without much duplication %>
|
3
3
|
<ul class="nav nav-tabs" role="tablist" title="Data Source Selectors" id="upload_tabs">
|
4
|
-
<li class="active"
|
4
|
+
<li class="active" id="computer_tab" title="<%= t('sufia.upload.my_computer.sr_tab_label')+' '+ t('sufia.upload.my_computer.tab_label') %>"><a role="tab" href="#local" data-toggle="tab"><i class="glyphicon glyphicon-folder-open" aria-hidden="true"></i> <%= t('sufia.upload.my_computer.tab_label')%></a></li>
|
5
5
|
<% if Sufia.config.browse_everything %>
|
6
|
-
<li
|
6
|
+
<li id="browse_everything_tab" title="<%= t('sufia.upload.browse_everything.sr_tab_label')+' '+ t('sufia.upload.browse_everything.tab_label') %>" aria-activedescendant="browse_everything_link"><a role="tab" href="#browse_everything" data-toggle="tab" id="browse_everything_link" ><i class="glyphicon glyphicon-cloud-download" aria-hidden="true"></i> <%= t('sufia.upload.browse_everything.tab_label')%></a></li>
|
7
7
|
<% end %>
|
8
8
|
<% if Sufia.config.enable_local_ingest %>
|
9
9
|
<li role="tab" id="local_ingest_tab"><a href="#ingest" data-toggle="tab"><i class="glyphicon glyphicon-hdd" aria-hidden="true"></i> <%= t('sufia.upload.local_ingest.tab_label')%></a></li>
|
@@ -22,7 +22,6 @@
|
|
22
22
|
</div>
|
23
23
|
<% end %>
|
24
24
|
|
25
|
-
|
26
25
|
<% if Sufia.config.enable_local_ingest %>
|
27
26
|
<div class="tab-pane" id="ingest" aria-labelledby="local_ingest_tab">
|
28
27
|
<%= render partial: 'generic_files/local_file_import' %>
|
@@ -1,29 +1,26 @@
|
|
1
1
|
<% content_for(:twitter_meta) do %>
|
2
|
-
<%
|
3
|
-
tweeter = User.find_by_user_key(@generic_file.depositor).twitter_handle
|
4
|
-
tweeter = tweeter.present? ? "@#{tweeter}" : t('sufia.product_twitter_handle') %>
|
5
2
|
<meta name="twitter:card" content="product">
|
6
3
|
<meta name="twitter:site" content="<%= t('sufia.product_twitter_handle') %>"/>
|
7
|
-
<meta name="twitter:creator" content="<%= tweeter %>"/>
|
4
|
+
<meta name="twitter:creator" content="<%= @presenter.tweeter %>"/>
|
8
5
|
<meta property="og:site_name" content="<%= t('sufia.product_name') %>"/>
|
9
6
|
<meta property="og:type" content="object"/>
|
10
|
-
<meta property="og:title" content="<%= @
|
11
|
-
<meta property="og:description" content="<%= @
|
12
|
-
<meta property="og:image" content="<%= sufia.download_url(@
|
13
|
-
<meta property="og:url" content="<%= sufia.generic_file_url(@
|
14
|
-
<meta name="twitter:data1" content="<%= @
|
7
|
+
<meta property="og:title" content="<%= @presenter.title.first %>"/>
|
8
|
+
<meta property="og:description" content="<%= @presenter.description.first.truncate(200) rescue @presenter.title.first %>"/>
|
9
|
+
<meta property="og:image" content="<%= sufia.download_url(@presenter, file: 'thumbnail') %>"/>
|
10
|
+
<meta property="og:url" content="<%= sufia.generic_file_url(@presenter) %>"/>
|
11
|
+
<meta name="twitter:data1" content="<%= @presenter.tag.join(', ') %>"/>
|
15
12
|
<meta name="twitter:label1" content="Keywords"/>
|
16
|
-
<meta name="twitter:data2" content="<%= @
|
13
|
+
<meta name="twitter:data2" content="<%= @presenter.rights.first %>"/>
|
17
14
|
<meta name="twitter:label2" content="Rights"/>
|
18
15
|
<% end %>
|
19
16
|
|
20
17
|
<% content_for(:gscholar_meta) do %>
|
21
|
-
<meta name="citation_title" content="<%= @
|
22
|
-
<% @
|
18
|
+
<meta name="citation_title" content="<%= @presenter.title.first %>"/>
|
19
|
+
<% @presenter.creator.each do |creator| %>
|
23
20
|
<meta name="citation_author" content="<%= creator %>"/>
|
24
21
|
<% end %>
|
25
|
-
<meta name="citation_publication_date" content="<%= @
|
26
|
-
<meta name="citation_pdf_url" content="<%= sufia.download_url(@
|
22
|
+
<meta name="citation_publication_date" content="<%= @presenter.date_created.first %>"/>
|
23
|
+
<meta name="citation_pdf_url" content="<%= sufia.download_url(@presenter) %>"/>
|
27
24
|
<!-- Sufia does not yet support these metadata -->
|
28
25
|
<!--
|
29
26
|
<meta name="citation_journal_title" content=""/>
|
@@ -49,8 +46,8 @@
|
|
49
46
|
<%= render 'show_actions' %>
|
50
47
|
<%= render 'show_collections' %>
|
51
48
|
</div>
|
52
|
-
<div itemscope itemtype="<%= @
|
53
|
-
<h1 class="visibility"><%= @
|
49
|
+
<div itemscope itemtype="<%= @presenter.itemtype %>" class="col-xs-12 col-sm-8">
|
50
|
+
<h1 class="visibility"><%= @presenter %> <%= render_visibility_badge %></h1>
|
54
51
|
<%= render 'show_descriptions' %>
|
55
52
|
<%= render 'show_details' %>
|
56
53
|
<%= render 'users/activity_log', events: @events %>
|