sufia 3.7.2 → 4.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile +3 -0
- data/README.md +88 -11
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/old_main_tulips.jpg +0 -0
- data/app/assets/javascripts/contact_form.js +0 -16
- data/app/assets/javascripts/jquery.blacklightTagCloud.js +44 -0
- data/app/assets/javascripts/jquery.tagcloud.js +116 -0
- data/app/assets/javascripts/jquery.tinysort.min.js +7 -0
- data/app/assets/javascripts/sufia.js +41 -44
- data/app/assets/javascripts/sufia/edit_metadata.js +1 -1
- data/app/assets/javascripts/sufia/editor.js +12 -0
- data/app/assets/javascripts/sufia/featured_works.js +64 -0
- data/app/assets/javascripts/sufia/fileupload.js +1 -1
- data/app/assets/javascripts/sufia/multiForm.js +1 -1
- data/app/assets/javascripts/sufia/permissions.js +4 -8
- data/app/assets/javascripts/sufia/single_use_link.js +1 -2
- data/app/assets/javascripts/sufia/trophy.js +42 -27
- data/app/assets/javascripts/terms_of_service.js +1 -1
- data/app/assets/stylesheets/dashboard.css.scss +81 -40
- data/app/assets/stylesheets/featured.css.scss +16 -0
- data/app/assets/stylesheets/fileupload/{jquery.fileupload-ui.css → jquery.fileupload-ui.css.erb} +2 -2
- data/app/assets/stylesheets/{generic_files.css → generic_files.css.erb} +6 -7
- data/app/assets/stylesheets/header.css.scss +93 -0
- data/app/assets/stylesheets/home-page.css.scss +50 -0
- data/app/assets/stylesheets/nestable.css.scss +111 -0
- data/app/assets/stylesheets/styles.css.scss +106 -0
- data/app/assets/stylesheets/sufia.css.scss +13 -8
- data/app/assets/stylesheets/tagcloud.css +83 -0
- data/app/assets/stylesheets/usage-stats.css +30 -0
- data/app/controllers/batch_controller.rb +0 -1
- data/app/controllers/concerns/sufia/catalog.rb +64 -0
- data/app/controllers/concerns/sufia/dashboard_controller_behavior.rb +16 -13
- data/app/controllers/content_blocks_controller.rb +8 -0
- data/app/controllers/featured_work_lists_controller.rb +16 -0
- data/app/controllers/featured_works_controller.rb +26 -0
- data/app/controllers/mailbox_controller.rb +1 -1
- data/app/controllers/pages_controller.rb +7 -0
- data/app/controllers/single_use_links_viewer_controller.rb +2 -5
- data/app/controllers/tinymce_assets_controller.rb +12 -0
- data/app/helpers/content_block_helper.rb +21 -0
- data/app/helpers/generic_file_helper.rb +2 -2
- data/app/helpers/sufia_helper.rb +8 -4
- data/app/helpers/trophy_helper.rb +15 -7
- data/app/models/content_block.rb +2 -0
- data/app/models/featured_work_list.rb +42 -0
- data/app/models/tinymce_asset.rb +3 -0
- data/app/uploaders/tinymce_asset_uploader.rb +51 -0
- data/app/views/_add_assets_links.html.erb +0 -16
- data/app/views/_controls.html.erb +17 -0
- data/app/views/_flash_msg.html.erb +2 -18
- data/app/views/_footer.html.erb +10 -15
- data/app/views/_ga.html.erb +0 -16
- data/app/views/_logo.html.erb +2 -2
- data/app/views/_masthead.html.erb +9 -36
- data/app/views/_user_util_links.html.erb +16 -11
- data/app/views/advanced/_advanced_search_facets.html.erb +0 -16
- data/app/views/advanced/_advanced_search_fields.html.erb +0 -16
- data/app/views/advanced/_advanced_search_help.html.erb +0 -16
- data/app/views/advanced/_facet_layout.html.erb +0 -16
- data/app/views/advanced/_facet_limit.html.erb +0 -16
- data/app/views/advanced/index.html.erb +2 -18
- data/app/views/batch/_metadata.html.erb +3 -3
- data/app/views/batch/edit.html.erb +4 -21
- data/app/views/catalog/_facet_limit.html.erb +11 -12
- data/app/views/catalog/_featured_researcher.html.erb +2 -0
- data/app/views/catalog/_home.html.erb +6 -2
- data/app/views/catalog/_home_content.html.erb +36 -0
- data/app/views/catalog/_home_header.html.erb +15 -0
- data/app/views/catalog/_recent_document.html.erb +1 -1
- data/app/views/catalog/_recents.html.erb +3 -4
- data/app/views/catalog/_search_form.html.erb +13 -9
- data/app/views/catalog/_tagcloud.html.erb +7 -0
- data/app/views/catalog/index.html.erb +4 -10
- data/app/views/contact_form/create.html.erb +0 -16
- data/app/views/contact_form/new.html.erb +0 -16
- data/app/views/dashboard/_constraints.html.erb +3 -19
- data/app/views/dashboard/_did_you_mean.html.erb +0 -16
- data/app/views/dashboard/_document_list.html.erb +0 -16
- data/app/views/dashboard/_facet_layout.html.erb +1 -17
- data/app/views/dashboard/_facet_limit.html.erb +5 -5
- data/app/views/dashboard/_facet_selected.html.erb +1 -17
- data/app/views/dashboard/_facets.html.erb +0 -18
- data/app/views/dashboard/_heading.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_default_group.html.erb +7 -23
- data/app/views/dashboard/_index_partials/_list_files.html.erb +62 -57
- data/app/views/dashboard/_search_form.html.erb +10 -7
- data/app/views/dashboard/_show_partials/_default.html.erb +0 -18
- data/app/views/dashboard/_show_partials/_default_details.html.erb +0 -16
- data/app/views/dashboard/_show_partials/_facets.html.erb +0 -16
- data/app/views/dashboard/_sort_and_per_page.html.erb +10 -9
- data/app/views/dashboard/facet.html.erb +4 -19
- data/app/views/dashboard/index.html.erb +27 -49
- data/app/views/error/401.html.erb +1 -17
- data/app/views/error/404.html.erb +0 -16
- data/app/views/error/500.html.erb +0 -16
- data/app/views/error/single_use_error.html.erb +1 -17
- data/app/views/generic_files/_asset_deleted_flash.html.erb +0 -16
- data/app/views/generic_files/_asset_permissions_denial_flash.html.erb +0 -16
- data/app/views/generic_files/_asset_saved_flash.html.erb +0 -16
- data/app/views/generic_files/_asset_updated_flash.html.erb +0 -16
- data/app/views/generic_files/_breadcrumbs.html.erb +0 -16
- data/app/views/generic_files/_browse_everything.html.erb +24 -0
- data/app/views/generic_files/_descriptions.html.erb +1 -1
- data/app/views/generic_files/_field_form.html.erb +5 -5
- data/app/views/generic_files/_media_display.html.erb +3 -3
- data/app/views/generic_files/_permission_form.html.erb +5 -5
- data/app/views/generic_files/_rights_modal.html.erb +13 -29
- data/app/views/generic_files/_show_actions.html.erb +13 -1
- data/app/views/generic_files/_versioning.html.erb +14 -10
- data/app/views/generic_files/citation.html.erb +0 -16
- data/app/views/generic_files/edit.html.erb +10 -12
- data/app/views/generic_files/edit_fields/_default.html.erb +1 -1
- data/app/views/generic_files/edit_fields/_description.html.erb +1 -1
- data/app/views/generic_files/edit_fields/_resource_type.html.erb +2 -3
- data/app/views/generic_files/edit_fields/_rights.html.erb +1 -1
- data/app/views/generic_files/new.html.erb +11 -26
- data/app/views/generic_files/show.html.erb +7 -25
- data/app/views/generic_files/stats.html.erb +141 -0
- data/app/views/homepage/_featured.html.erb +11 -0
- data/app/views/homepage/_featured_fields.html.erb +18 -0
- data/app/views/homepage/_featured_works.html.erb +17 -0
- data/app/views/homepage/_sortable_featured.html.erb +26 -0
- data/app/views/layouts/_head_tag_content.html.erb +1 -1
- data/app/views/layouts/_homepage_sidebar2.html.erb +14 -0
- data/app/views/layouts/error.html.erb +3 -21
- data/app/views/layouts/homepage.html.erb +8 -37
- data/app/views/layouts/sufia-dashboard.html.erb +46 -0
- data/app/views/layouts/sufia-one-column.html.erb +8 -24
- data/app/views/layouts/sufia-two-column.html.erb +9 -8
- data/app/views/pages/show.html.erb +4 -0
- data/app/views/single_use_links_viewer/show.html.erb +2 -2
- data/app/views/static/agreement.html.erb +0 -17
- data/app/views/static/help.html.erb +0 -17
- data/app/views/static/mendeley.html.erb +0 -16
- data/app/views/static/subject_libraries.html.erb +0 -17
- data/app/views/static/terms.html.erb +0 -16
- data/app/views/static/zotero.html.erb +0 -16
- data/app/views/users/_activity_log.html.erb +2 -2
- data/app/views/users/_contributions.html.erb +6 -2
- data/app/views/users/_follower_modal.html.erb +2 -2
- data/app/views/users/_following_modal.html.erb +2 -2
- data/app/views/users/_left_sidebar.html.erb +1 -1
- data/app/views/users/_notify_link.html.erb +1 -1
- data/app/views/users/_notify_number.html.erb +1 -1
- data/app/views/users/_profile_actions.html.erb +3 -3
- data/app/views/users/_profile_tabs.html.erb +1 -1
- data/app/views/users/_search_form.html.erb +3 -2
- data/app/views/users/_social_media_info.html.erb +3 -3
- data/app/views/users/_trophy_edit.html.erb +2 -2
- data/app/views/users/_user_info.html.erb +27 -27
- data/app/views/users/_vitals.html.erb +2 -2
- data/app/views/users/edit.html.erb +39 -39
- data/app/views/users/index.html.erb +3 -3
- data/app/views/users/show.html.erb +7 -9
- data/config/locales/sufia.en.yml +15 -7
- data/config/routes.rb +12 -9
- data/lib/generators/sufia/sufia_generator.rb +18 -15
- data/lib/generators/sufia/templates/catalog_controller.rb +11 -73
- data/lib/generators/sufia/templates/config/tinymce.yml +7 -0
- data/lib/sufia.rb +7 -0
- data/lib/sufia/downloads_controller_behavior.rb +3 -4
- data/lib/sufia/files_controller_behavior.rb +38 -27
- data/lib/sufia/version.rb +1 -1
- data/spec/controllers/batch_controller_spec.rb +1 -1
- data/spec/controllers/batch_edits_controller_spec.rb +5 -5
- data/spec/controllers/catalog_controller_spec.rb +37 -58
- data/spec/controllers/content_blocks_controller_spec.rb +37 -0
- data/spec/controllers/downloads_controller_spec.rb +3 -11
- data/spec/controllers/featured_work_lists_controller_spec.rb +20 -0
- data/spec/controllers/featured_works_controller_spec.rb +50 -0
- data/spec/controllers/generic_files_controller_spec.rb +74 -9
- data/spec/controllers/mailbox_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +25 -0
- data/spec/controllers/single_use_links_controller_spec.rb +1 -1
- data/spec/controllers/single_use_links_viewer_controller_spec.rb +1 -1
- data/spec/controllers/tinymce_assets_controller_spec.rb +39 -0
- data/spec/controllers/users_controller_spec.rb +3 -8
- data/spec/factories/content_blocks.rb +4 -0
- data/spec/factories/featured_works.rb +4 -0
- data/spec/factories/generic_files.rb +46 -39
- data/spec/factories/users.rb +18 -18
- data/spec/features/browse_dashboard_files_spec.rb +6 -7
- data/spec/features/browse_files_spec.rb +9 -6
- data/spec/features/cloud_upload_spec.rb +18 -0
- data/spec/features/single_use_links_spec.rb +2 -3
- data/spec/helpers/content_block_helper_spec.rb +31 -0
- data/spec/helpers/generic_file_helper_spec.rb +3 -3
- data/spec/helpers/sufia_helper_spec.rb +13 -81
- data/spec/helpers/trophy_helper_spec.rb +39 -0
- data/spec/jobs/import_url_job_spec.rb +1 -1
- data/spec/jobs/ingest_local_file_job_spec.rb +1 -1
- data/spec/lib/sufia/usage_statistics_spec.rb +75 -0
- data/spec/models/ability_spec.rb +31 -0
- data/spec/models/active_fedora_pid_based_job_spec.rb +1 -1
- data/spec/models/audit_job_spec.rb +1 -1
- data/spec/models/batch_spec.rb +1 -1
- data/spec/models/batch_update_job_spec.rb +1 -1
- data/spec/models/event_jobs_spec.rb +1 -1
- data/spec/models/featured_work_list_spec.rb +23 -0
- data/spec/models/featured_work_spec.rb +42 -0
- data/spec/models/fits_datastream_spec.rb +2 -2
- data/spec/models/generic_file/reload_on_save_spec.rb +1 -1
- data/spec/models/generic_file/web_form_spec.rb +4 -4
- data/spec/models/generic_file_spec.rb +41 -40
- data/spec/models/pageview.rb +19 -0
- data/spec/models/properties_datastream_spec.rb +2 -2
- data/spec/models/solr_document_spec.rb +9 -0
- data/spec/models/user_spec.rb +2 -2
- data/spec/routing/featured_works_route_spec.rb +16 -0
- data/spec/routing/route_spec.rb +10 -15
- data/spec/spec_helper.rb +3 -0
- data/spec/support/lib/generators/test_app_generator.rb +19 -8
- data/spec/views/dashboard/facet_limit.html.erb_spec.rb +2 -2
- data/spec/views/generic_file/show.html.erb_spec.rb +44 -0
- data/spec/views/generic_file/stats.html.erb_spec.rb +47 -0
- data/spec/views/users/_follower_modal.html.erb_spec.rb +18 -0
- data/spec/views/users/_following_modal.html.erb_spec.rb +18 -0
- data/spec/views/users/index.html.erb_spec.rb +1 -1
- data/sufia-models/app/models/batch.rb +1 -1
- data/sufia-models/app/models/concerns/sufia/properties_datastream_behavior.rb +30 -0
- data/sufia-models/app/models/concerns/sufia/user.rb +1 -1
- data/sufia-models/app/models/datastreams/batch_rdf_datastream.rb +4 -7
- data/sufia-models/app/models/datastreams/fits_datastream.rb +3 -0
- data/sufia-models/app/models/datastreams/generic_file_rdf_datastream.rb +53 -51
- data/sufia-models/app/models/datastreams/properties_datastream.rb +1 -15
- data/sufia-models/app/models/featured_work.rb +22 -0
- data/sufia-models/app/models/sufia/pageview.rb +9 -0
- data/sufia-models/{lib/sufia/models → app/services/sufia}/id_service.rb +0 -0
- data/sufia-models/{lib/sufia/models → app/services/sufia}/noid.rb +0 -0
- data/sufia-models/app/services/sufia/usage_statistics.rb +73 -0
- data/sufia-models/config/locales/sufia.en.yml +3 -4
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +23 -8
- data/sufia-models/lib/generators/sufia/models/templates/config/analytics.yml +9 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/mime_types.rb +6 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +11 -2
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_content_blocks.rb +10 -0
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_featured_works.rb +12 -0
- data/sufia-models/lib/generators/sufia/models/templates/migrations/create_tinymce_assets.rb +8 -0
- data/sufia-models/lib/generators/sufia/models/usagestats_generator.rb +19 -0
- data/sufia-models/lib/sufia/ability.rb +34 -0
- data/sufia-models/lib/sufia/models/engine.rb +5 -3
- data/sufia-models/lib/sufia/models/generic_file.rb +4 -2
- data/sufia-models/lib/sufia/models/generic_file/export.rb +3 -3
- data/sufia-models/lib/sufia/models/generic_file/featured.rb +14 -0
- data/sufia-models/lib/sufia/models/solr_document_behavior.rb +11 -4
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/sufia-models.gemspec +6 -5
- data/sufia.gemspec +6 -4
- data/tasks/release.rake +1 -0
- data/tasks/sufia-dev.rake +5 -1
- data/vendor/assets/javascripts/flot/excanvas.js +1428 -0
- data/vendor/assets/javascripts/flot/jquery.flot.js +3137 -0
- data/vendor/assets/javascripts/flot/jquery.flot.selection.js +360 -0
- data/vendor/assets/javascripts/flot/jquery.flot.time.js +431 -0
- data/vendor/assets/javascripts/nestable.js +647 -0
- data/vendor/assets/javascripts/video.js +135 -126
- data/{app → vendor}/assets/stylesheets/video-js.css.erb +7 -6
- metadata +155 -33
- data/app/assets/stylesheets/application-bootstrap.css.erb +0 -295
- data/app/assets/stylesheets/audio-js.css +0 -3
- data/app/assets/stylesheets/blacklight_more_facets.css +0 -427
- data/app/assets/stylesheets/bootstrap.min.css.erb +0 -1433
- data/app/assets/stylesheets/contact_form.css +0 -4
- data/app/assets/stylesheets/reset_body.css +0 -4
- data/app/assets/stylesheets/trophy.css +0 -7
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +0 -84
- data/app/helpers/facets_helper.rb +0 -3
- data/app/helpers/sufia/facets_helper_behavior.rb +0 -23
- data/app/views/catalog/_home_text.html.erb +0 -10
- data/app/views/generic_files/_dropbox_import.html.erb +0 -3
- data/app/views/generic_files/upload/_dropbox_chooser.html.erb +0 -39
- data/app/views/static/about.html.erb +0 -21
- data/spec/helpers/render_constraints_helper_behavior_spec.rb +0 -42
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="control-label">
|
2
2
|
<i class="icon-trophy trophy-on" ></i> Remove Highlight Designation
|
3
|
-
<a href="#" id="remove_trophy_help" rel="popover" data-content="If you would like to remove a highlight designation, check the box and save your profile." data-original-title="Remove Highlight Designation"><i class="
|
3
|
+
<a href="#" id="remove_trophy_help" rel="popover" data-content="If you would like to remove a highlight designation, check the box and save your profile." data-original-title="Remove Highlight Designation"><i class="glyphicon glyphicon-question-sign icon-large"></i></a>
|
4
4
|
</div>
|
5
5
|
<div class="control-group">
|
6
6
|
<dl>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<div class="controls">
|
10
10
|
<%= link_to t, sufia.generic_file_path(t) %>
|
11
11
|
<label class="checkbox fleft">
|
12
|
-
<%= check_box_tag "remove_trophy_#{t.
|
12
|
+
<%= check_box_tag "remove_trophy_#{t.noid}" %> Yes
|
13
13
|
</label>
|
14
14
|
</div>
|
15
15
|
</dd>
|
@@ -1,59 +1,59 @@
|
|
1
|
-
<dl id="user_info">
|
2
|
-
<dt><i class="
|
3
|
-
<dd><%= link_to user.facebook_handle, "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
|
1
|
+
<dl id="user_info" class="row">
|
2
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-facebook"></i> Facebook Handle</dt>
|
3
|
+
<dd class="col-xs-7"><%= link_to user.facebook_handle, "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
|
4
4
|
|
5
|
-
<dt><i class="
|
6
|
-
<dd><%= link_to user.twitter_handle, "http://twitter.com/#{user.twitter_handle}", {target:'_blank'} %></dd>
|
5
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-twitter"></i> Twitter Handle</dt>
|
6
|
+
<dd class="col-xs-7"><%= link_to user.twitter_handle, "http://twitter.com/#{user.twitter_handle}", {target:'_blank'} %></dd>
|
7
7
|
|
8
|
-
<dt><i class="
|
9
|
-
<dd><%= link_to user.googleplus_handle, "http://google.com/+#{user.googleplus_handle}", {target:'_blank'} %></dd>
|
8
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-google-plus"></i> Google+ Handle</dt>
|
9
|
+
<dd class="col-xs-7"><%= link_to user.googleplus_handle, "http://google.com/+#{user.googleplus_handle}", {target:'_blank'} %></dd>
|
10
10
|
|
11
|
-
<dt><i class="
|
12
|
-
<dd><%= mail_to user.email %></dd>
|
11
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-envelope-alt"></i> Email</dt>
|
12
|
+
<dd class="col-xs-7"><%= mail_to user.email %></dd>
|
13
13
|
|
14
14
|
<% if user.chat_id %>
|
15
|
-
<dt><i class="
|
16
|
-
<dd><%= user.chat_id %></dd>
|
15
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-bullhorn"></i> Chat ID</dt>
|
16
|
+
<dd class="col-xs-7"><%= user.chat_id %></dd>
|
17
17
|
<% end %>
|
18
18
|
|
19
19
|
<% if user.website %>
|
20
|
-
<dt><i class="
|
21
|
-
<dd><%= iconify_auto_link(user.website) %></dd>
|
20
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-globe"></i> Website(s)</dt>
|
21
|
+
<dd class="col-xs-7"><%= iconify_auto_link(user.website) %></dd>
|
22
22
|
<% end %>
|
23
23
|
|
24
24
|
<% if user.title %>
|
25
|
-
<dt>Title</dt>
|
26
|
-
<dd><%= user.title.titleize %></dd>
|
25
|
+
<dt class="col-xs-5">Title</dt>
|
26
|
+
<dd class="col-xs-7"><%= user.title.titleize %></dd>
|
27
27
|
<% end %>
|
28
28
|
|
29
29
|
<% if user.admin_area %>
|
30
|
-
<dt>Administrative Area</dt>
|
31
|
-
<dd><%= user.admin_area.titleize %></dd>
|
30
|
+
<dt class="col-xs-5">Administrative Area</dt>
|
31
|
+
<dd class="col-xs-7"><%= user.admin_area.titleize %></dd>
|
32
32
|
<% end %>
|
33
33
|
|
34
34
|
<% if user.department %>
|
35
|
-
<dt>Department</dt>
|
36
|
-
<dd><%= user.department.titleize %></dd>
|
35
|
+
<dt class="col-xs-5">Department</dt>
|
36
|
+
<dd class="col-xs-7"><%= user.department.titleize %></dd>
|
37
37
|
<% end %>
|
38
38
|
|
39
39
|
<% if user.office %>
|
40
|
-
<dt>Office</dt>
|
41
|
-
<dd><%= user.office.titleize %></dd>
|
40
|
+
<dt class="col-xs-5">Office</dt>
|
41
|
+
<dd class="col-xs-7"><%= user.office.titleize %></dd>
|
42
42
|
<% end %>
|
43
43
|
|
44
44
|
<% if user.address %>
|
45
|
-
<dt><i class="
|
46
|
-
<dd><%= user.address.titleize %></dd>
|
45
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-map-marker"></i> Address</dt>
|
46
|
+
<dd class="col-xs-7"><%= user.address.titleize %></dd>
|
47
47
|
<% end %>
|
48
48
|
|
49
49
|
<% if user.affiliation %>
|
50
|
-
<dt>Affiliation</dt>
|
51
|
-
<dd><%= user.affiliation.titleize %></dd>
|
50
|
+
<dt class="col-xs-5">Affiliation</dt>
|
51
|
+
<dd class="col-xs-7"><%= user.affiliation.titleize %></dd>
|
52
52
|
<% end %>
|
53
53
|
|
54
54
|
<% if user.telephone %>
|
55
|
-
<dt><i class="
|
56
|
-
<dd><%= link_to user.telephone, "wtai://wp/mc;#{user.telephone}" %><%# user.telephone %></dd>
|
55
|
+
<dt class="col-xs-5"><i class="glyphicon glyphicon-phone"></i> Telephone</dt>
|
56
|
+
<dd class="col-xs-7"><%= link_to user.telephone, "wtai://wp/mc;#{user.telephone}" %><%# user.telephone %></dd>
|
57
57
|
<% end %>
|
58
58
|
|
59
59
|
</dl>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<i class="
|
2
|
-
<i class="
|
1
|
+
<i class="glyphicon glyphicon-time"></i> Joined on <%= @user.created_at.to_date.strftime("%b %d, %Y") %> <br />
|
2
|
+
<i class="glyphicon glyphicon-folder-open"></i> Deposited Files
|
3
3
|
<%= link_to_field('depositor', @user.to_s, number_of_deposits(@user)) %> <br />
|
4
4
|
|
@@ -4,74 +4,74 @@ $("a[rel=popover]").popover({ html: true });
|
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<h1>Edit Profile</h1>
|
7
|
-
<div class="
|
7
|
+
<div class="col-xs-12 col-sm-5 well">
|
8
8
|
<%= form_for @user, :url => sufia.profile_path(@user.to_param), :html => {:multipart => true, :class => 'form-horizontal' } do |f| %>
|
9
|
-
<div class="
|
10
|
-
<%= f.label :avatar, '<i class="
|
11
|
-
<div class="
|
9
|
+
<div class="form-group">
|
10
|
+
<%= f.label :avatar, '<i class="glyphicon glyphicon-camera"></i> Change picture'.html_safe, :class => "col-xs-4 control-label" %>
|
11
|
+
<div class="col-xs-8">
|
12
12
|
<%= image_tag @user.avatar.url(:thumb) if @user.avatar? %>
|
13
13
|
<%= f.file_field :avatar %>
|
14
14
|
<%= f.hidden_field :avatar_cache %>
|
15
|
-
<span class="
|
16
|
-
</div
|
17
|
-
</div
|
15
|
+
<span class="help-block">JPG, GIF, or PNG (less than 2MB)</span>
|
16
|
+
</div><!-- .controls -->
|
17
|
+
</div><!-- .form-group -->
|
18
18
|
|
19
|
-
<div class="
|
20
|
-
<%= f.label :delete_avatar, '<i class="
|
21
|
-
<div class="
|
19
|
+
<div class="form-group">
|
20
|
+
<%= f.label :delete_avatar, '<i class="glyphicon glyphicon-remove"></i> Delete picture'.html_safe, :class => 'col-xs-4 control-label' %>
|
21
|
+
<div class="col-xs-8">
|
22
22
|
<label class="checkbox">
|
23
23
|
<%= f.check_box :remove_avatar %> Yes
|
24
|
-
<a href="#" id="delete_picture_help" rel="popover" data-content="If you would like to remove your picture entirely, check the box and save your profile." data-original-title="Delete Picture"><i class="
|
24
|
+
<a href="#" id="delete_picture_help" rel="popover" data-content="If you would like to remove your picture entirely, check the box and save your profile." data-original-title="Delete Picture"><i class="glyphicon glyphicon-question-sign icon-large"></i></a>
|
25
25
|
</label>
|
26
|
-
</div
|
27
|
-
</div
|
26
|
+
</div><!-- .controls -->
|
27
|
+
</div><!-- .form-group -->
|
28
28
|
|
29
|
-
<div class="
|
30
|
-
<%= f.label :update_directory, '<i class="
|
31
|
-
<div class="
|
29
|
+
<div class="form-group">
|
30
|
+
<%= f.label :update_directory, '<i class="glyphicon glyphicon-refresh"></i> Refresh directory info'.html_safe, :class => 'col-xs-4 control-label' %>
|
31
|
+
<div class="col-xs-8">
|
32
32
|
<label class="checkbox">
|
33
33
|
<%= check_box_tag 'update_directory' %> Yes
|
34
|
-
<a href="#" id="refresh_directory_help" rel="popover" data-content="The information displayed in your profile comes from <%=t('sufia.institution_name') %>'s central directory (LDAP) and is cached by <%=t('sufia.product_name') %>. If you have updated that information and don't see those changes in your <%=t('sufia.product_name') %> profile, check the box and save your profile." data-original-title="Refresh Directory Info"><i class="
|
34
|
+
<a href="#" id="refresh_directory_help" rel="popover" data-content="The information displayed in your profile comes from <%=t('sufia.institution_name') %>'s central directory (LDAP) and is cached by <%=t('sufia.product_name') %>. If you have updated that information and don't see those changes in your <%=t('sufia.product_name') %> profile, check the box and save your profile." data-original-title="Refresh Directory Info"><i class="glyphicon glyphicon-question-sign icon-large"></i></a>
|
35
35
|
</label>
|
36
|
-
</div
|
37
|
-
</div
|
36
|
+
</div><!-- .controls -->
|
37
|
+
</div><!-- .form-group -->
|
38
38
|
|
39
|
-
<div class="
|
40
|
-
<%= f.label :twitter_handle, '<i class="
|
41
|
-
<div class="
|
39
|
+
<div class="form-group">
|
40
|
+
<%= f.label :twitter_handle, '<i class="glyphicon glyphicon-twitter"></i> Twitter Handle'.html_safe, :class => 'col-xs-4 control-label' %>
|
41
|
+
<div class="col-xs-8">
|
42
42
|
<%= f.text_field :twitter_handle, :class =>"input-medium" %>
|
43
|
-
</div
|
44
|
-
</div
|
43
|
+
</div><!-- .controls -->
|
44
|
+
</div><!-- .form-group -->
|
45
45
|
|
46
|
-
<div class="
|
47
|
-
<%= f.label :facebook_handle, '<i class="
|
48
|
-
<div class="
|
46
|
+
<div class="form-group">
|
47
|
+
<%= f.label :facebook_handle, '<i class="glyphicon glyphicon-facebook"></i> Facebook Handle'.html_safe, :class => 'col-xs-4 control-label' %>
|
48
|
+
<div class="col-xs-8">
|
49
49
|
<%= f.text_field :facebook_handle, :class =>"input-medium" %>
|
50
|
-
</div
|
51
|
-
</div
|
50
|
+
</div><!-- .controls -->
|
51
|
+
</div><!-- .form-group -->
|
52
52
|
|
53
|
-
<div class="
|
54
|
-
<%= f.label :googleplus_handle, '<i class="
|
55
|
-
<div class="
|
53
|
+
<div class="form-group">
|
54
|
+
<%= f.label :googleplus_handle, '<i class="glyphicon glyphicon-google-plus"></i> Google+ Handle'.html_safe, :class => 'col-xs-4 control-label' %>
|
55
|
+
<div class="col-xs-8">
|
56
56
|
<%= f.text_field :googleplus_handle, :class =>"input-medium" %>
|
57
|
-
</div
|
58
|
-
</div
|
57
|
+
</div><!-- .controls -->
|
58
|
+
</div><!-- .form-group -->
|
59
59
|
|
60
60
|
<%= render :partial => 'trophy_edit', :locals => {:trophies => @trophies} %>
|
61
61
|
|
62
62
|
<div class="form-actions">
|
63
|
-
<%= f.button '<i class="
|
63
|
+
<%= f.button '<i class="glyphicon glyphicon-save"></i> Save Profile'.html_safe, :type => 'submit', :class => "btn-primary btn-large" %>
|
64
64
|
</div>
|
65
65
|
<% end %>
|
66
|
-
</div><!--
|
66
|
+
</div><!-- .col-xs-5 /well-->
|
67
67
|
|
68
|
-
<div class="
|
69
|
-
<
|
68
|
+
<div class="col-xs-12 col-sm-offset-1 col-sm-6 well">
|
69
|
+
<h2><i class="glyphicon glyphicon-user"></i> Directory Info (LDAP) <%= link_to 'Edit Instructions', 'http://www.psu.edu/directory/#update', :class => 'btn btn-mini btn-primary' %></h3>
|
70
70
|
<%= render :partial => 'user_info', :locals => {:user => @user} %>
|
71
71
|
|
72
72
|
<hr />
|
73
73
|
|
74
|
-
<
|
74
|
+
<h2><i class="glyphicon glyphicon-group"></i> User Managed Groups Info (UMG) <%= link_to 'Manage UMG', 'http://umg.its.psu.edu/', :class => 'btn btn-mini btn-primary' %> </h3>
|
75
75
|
<% current_user.groups.each do |g| %>
|
76
76
|
<i class="icon-caret-right"></i> <%= g %><br />
|
77
77
|
<% end %>
|
@@ -7,9 +7,9 @@
|
|
7
7
|
<thead>
|
8
8
|
<tr>
|
9
9
|
<th>Avatar</th>
|
10
|
-
<th class="sorts"><i id="name" class="<%=params[:sort].blank? ? '
|
11
|
-
<th class="sorts"><i id="login" class="<%=params[:sort]== "login desc" ? '
|
12
|
-
<th class="sorts"><i id="department" class="<%=params[:sort]== "department desc" ? '
|
10
|
+
<th class="sorts"><i id="name" class="<%=params[:sort].blank? ? 'caret up' : params[:sort]== "name desc" ? 'caret' : params[:sort]== "name" ? 'caret up' : ''%>"></i>User Name</th>
|
11
|
+
<th class="sorts"><i id="login" class="<%=params[:sort]== "login desc" ? 'caret' : params[:sort]== "login" ? 'caret up' : ''%>"></i>User Id</th>
|
12
|
+
<th class="sorts"><i id="department" class="<%=params[:sort]== "department desc" ? 'caret' : params[:sort]== "department" ? 'caret up' : ''%>"></i>Department</th>
|
13
13
|
<th>Files Deposited</th>
|
14
14
|
</tr>
|
15
15
|
</thead>
|
@@ -6,21 +6,19 @@ $('#myTab a').click(function (e) {
|
|
6
6
|
})
|
7
7
|
|
8
8
|
<% end %>
|
9
|
-
<div class="
|
10
|
-
<div class="span110">
|
9
|
+
<div class="col-xs-12">
|
11
10
|
<div class="pull-right">
|
12
11
|
<%= render 'profile_actions' %>
|
13
12
|
</div>
|
14
|
-
<span class="
|
13
|
+
<span class="col-xs-3">
|
15
14
|
<%= render 'left_sidebar' %>
|
16
|
-
</span>
|
17
|
-
|
18
|
-
<!-- right col -->
|
19
|
-
<span class="span78 offset2">
|
15
|
+
</span>
|
20
16
|
|
17
|
+
<!-- right col -->
|
18
|
+
<span class="col-xs-9">
|
21
19
|
<%= render 'profile_tabs' %>
|
22
|
-
</span>
|
23
|
-
</div
|
20
|
+
</span>
|
21
|
+
</div>
|
24
22
|
|
25
23
|
|
26
24
|
|
data/config/locales/sufia.en.yml
CHANGED
@@ -1,17 +1,25 @@
|
|
1
1
|
en:
|
2
2
|
sufia:
|
3
|
-
account_name: "
|
4
|
-
deposit_agreement: "
|
3
|
+
account_name: "My Institution Account Id"
|
4
|
+
deposit_agreement: "Sufia's Deposit Agreement"
|
5
5
|
upload_tooltip: "Please accept Deposit Agreement before you can upload."
|
6
6
|
share_button: "Share Your Work"
|
7
7
|
directory:
|
8
|
-
suffix: "@
|
8
|
+
suffix: "@example.org"
|
9
9
|
search:
|
10
10
|
form:
|
11
11
|
q:
|
12
|
-
label: "Search
|
12
|
+
label: "Search Sufia"
|
13
13
|
placeholder: "Type keywords in here"
|
14
|
-
|
14
|
+
upload:
|
15
|
+
my_computer:
|
16
|
+
tab_label: "My Computer"
|
17
|
+
browse_everything:
|
18
|
+
tab_label: "Cloud Providers"
|
19
|
+
browse_files_button: "Browse cloud files"
|
20
|
+
files_selected: "files selected"
|
21
|
+
local_ingest:
|
22
|
+
tab_label: "Network/Server Location"
|
15
23
|
field_label:
|
16
24
|
based_near: "Location"
|
17
25
|
description: "Abstract or Summary"
|
@@ -32,6 +40,6 @@ en:
|
|
32
40
|
description: "Free-text notes about the file itself. Examples include abstracts of a paper, citation information for a journal article, or a tag indicating a larger collection to which the file belongs."
|
33
41
|
identifier: "A unique handle describing the file. An example would be a DOI for a journal article, or an ISBN or OCLC number for a book."
|
34
42
|
language: " The language of the file content."
|
35
|
-
publisher: "The person or group making the file available. Generally this is
|
43
|
+
publisher: "The person or group making the file available. Generally this is the institution."
|
36
44
|
rights: "Licensing and distribution information governing access to the file. Select from the provided drop-down list. <em>This is a required field</em>."
|
37
|
-
|
45
|
+
background_attribution: "Background image courtesy of Penn State University"
|
data/config/routes.rb
CHANGED
@@ -8,21 +8,22 @@ Sufia::Engine.routes.draw do
|
|
8
8
|
|
9
9
|
# Route path-less requests to the index view of catalog
|
10
10
|
root :to => "catalog#index"
|
11
|
-
|
12
|
-
# "Recently added files" route for catalog index view
|
13
|
-
get "catalog/recent" => "catalog#recent", :as => :catalog_recent
|
14
11
|
|
15
12
|
# "Notifications" route for catalog index view
|
16
13
|
get "users/notifications_number" => "users#notifications_number", :as => :user_notify
|
17
14
|
|
18
15
|
# Generic file routes
|
19
|
-
resources :generic_files, :
|
16
|
+
resources :generic_files, path: :files, except: :index do
|
20
17
|
member do
|
21
|
-
|
18
|
+
resource :featured_work, only: [:create, :destroy]
|
19
|
+
get 'citation'
|
20
|
+
get 'stats'
|
22
21
|
post 'audit'
|
23
22
|
end
|
24
23
|
end
|
25
24
|
|
25
|
+
resources :featured_work_lists, path: 'featured_works', only: :create
|
26
|
+
|
26
27
|
# Downloads controller route
|
27
28
|
resources :downloads, :only => "show"
|
28
29
|
|
@@ -50,7 +51,6 @@ Sufia::Engine.routes.draw do
|
|
50
51
|
get 'facet/:id', :action => :facet, :as => :dashboard_facet
|
51
52
|
end
|
52
53
|
end
|
53
|
-
|
54
54
|
|
55
55
|
# advanced routes for advanced search
|
56
56
|
get 'search' => 'advanced#index', :as => :advanced
|
@@ -81,8 +81,12 @@ Sufia::Engine.routes.draw do
|
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
+
resources :content_blocks, only: 'update'
|
85
|
+
post '/tinymce_assets' => 'tinymce_assets#create'
|
86
|
+
|
87
|
+
get 'about' => 'pages#show', id: 'about_page'
|
84
88
|
# Static page routes (workaround)
|
85
|
-
get ':action' => 'static#:action', :constraints => { :action => /
|
89
|
+
get ':action' => 'static#:action', :constraints => { :action => /help|terms|zotero|mendeley|agreement|subject_libraries|versions/ }, :as => :static
|
86
90
|
|
87
91
|
#Single use link errors
|
88
92
|
get 'single_use_link/not_found' => 'errors#single_use_error'
|
@@ -92,6 +96,5 @@ Sufia::Engine.routes.draw do
|
|
92
96
|
unless Rails.env.development? || Rails.env.test?
|
93
97
|
match '*error' => 'errors#routing', via: [:get, :post]
|
94
98
|
end
|
95
|
-
|
96
|
-
end
|
97
99
|
|
100
|
+
end
|
@@ -7,20 +7,27 @@ class SufiaGenerator < Rails::Generators::Base
|
|
7
7
|
|
8
8
|
source_root File.expand_path('../templates', __FILE__)
|
9
9
|
|
10
|
-
argument
|
10
|
+
argument :model_name, :type => :string , :default => "user"
|
11
11
|
desc """
|
12
12
|
This generator makes the following changes to your application:
|
13
13
|
1. Runs sufia-models:install
|
14
|
-
2. Adds
|
15
|
-
3.
|
14
|
+
2. Adds Sufia's abilities into the Ability class
|
15
|
+
3. Adds controller behavior to the application controller
|
16
|
+
4. Copies the catalog controller into the local app
|
16
17
|
"""
|
17
18
|
|
18
19
|
def run_required_generators
|
19
|
-
generate "blacklight --devise"
|
20
|
+
generate "blacklight:install --devise"
|
20
21
|
generate "hydra:head -f"
|
21
22
|
generate "sufia:models:install"
|
22
23
|
end
|
23
24
|
|
25
|
+
def insert_abilities
|
26
|
+
insert_into_file 'app/models/ability.rb', after: /Hydra::Ability/ do
|
27
|
+
"\n include Sufia::Ability\n"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
24
31
|
# Add behaviors to the application controller
|
25
32
|
def inject_sufia_controller_behavior
|
26
33
|
controller_name = "ApplicationController"
|
@@ -32,30 +39,26 @@ This generator makes the following changes to your application:
|
|
32
39
|
end
|
33
40
|
gsub_file file_path, "layout 'blacklight'", "layout :search_layout"
|
34
41
|
else
|
35
|
-
puts " \e[31mFailure\e[0m Could not find #{file_path}. To add Sufia behaviors to your
|
42
|
+
puts " \e[31mFailure\e[0m Could not find #{file_path}. To add Sufia behaviors to your Controllers, you must include the Sufia::Controller module in the Controller class definition."
|
36
43
|
end
|
37
44
|
end
|
38
45
|
|
39
|
-
|
40
46
|
def catalog_controller
|
41
47
|
copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb"
|
42
48
|
end
|
43
49
|
|
50
|
+
def tinymce_config
|
51
|
+
copy_file "config/tinymce.yml", "config/tinymce.yml"
|
52
|
+
end
|
44
53
|
|
45
54
|
# The engine routes have to come after the devise routes so that /users/sign_in will work
|
46
55
|
def inject_routes
|
47
|
-
routing_code = "Hydra::BatchEdit.add_routes(self)"
|
48
|
-
|
49
|
-
inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }
|
50
|
-
|
51
|
-
routing_code = "\n # This must be the very last route in the file because it has a catch all route for 404 errors.
|
56
|
+
routing_code = "\n Hydra::BatchEdit.add_routes(self)\n" +
|
57
|
+
" # This must be the very last route in the file because it has a catch-all route for 404 errors.
|
52
58
|
# This behavior seems to show up only in production mode.
|
53
59
|
mount Sufia::Engine => '/'\n"
|
60
|
+
|
54
61
|
sentinel = /devise_for :users/
|
55
62
|
inject_into_file 'config/routes.rb', routing_code, { :after => sentinel, :verbose => false }
|
56
|
-
|
57
63
|
end
|
58
|
-
|
59
64
|
end
|
60
|
-
|
61
|
-
|
@@ -4,7 +4,7 @@ require 'blacklight/catalog'
|
|
4
4
|
require 'blacklight_advanced_search'
|
5
5
|
|
6
6
|
# bl_advanced_search 1.2.4 is doing unitialized constant on these because we're calling ParseBasicQ directly
|
7
|
-
require 'parslet'
|
7
|
+
require 'parslet'
|
8
8
|
require 'parsing_nesting/tree'
|
9
9
|
|
10
10
|
class CatalogController < ApplicationController
|
@@ -12,43 +12,16 @@ class CatalogController < ApplicationController
|
|
12
12
|
# Extend Blacklight::Catalog with Hydra behaviors (primarily editing).
|
13
13
|
include Hydra::Controller::ControllerBehavior
|
14
14
|
include BlacklightAdvancedSearch::ParseBasicQ
|
15
|
+
include Sufia::Catalog
|
15
16
|
|
16
17
|
# These before_filters apply the hydra access controls
|
17
|
-
before_filter :enforce_show_permissions, :
|
18
|
+
before_filter :enforce_show_permissions, only: :show
|
18
19
|
# This applies appropriate access controls to all solr queries
|
19
20
|
CatalogController.solr_search_params_logic += [:add_access_controls_to_solr_params]
|
20
|
-
# This filters out objects that you want to exclude from search results, like FileAssets
|
21
|
-
CatalogController.solr_search_params_logic += [:exclude_unwanted_models]
|
22
21
|
|
23
22
|
skip_before_filter :default_html_head
|
24
23
|
|
25
|
-
def index
|
26
|
-
super
|
27
|
-
recent
|
28
|
-
#also grab my recent docs too
|
29
|
-
recent_me
|
30
|
-
end
|
31
|
-
|
32
|
-
def recent
|
33
|
-
if user_signed_in?
|
34
|
-
# grab other people's documents
|
35
|
-
(_, @recent_documents) = get_search_results(:q =>filter_not_mine,
|
36
|
-
:sort=>sort_field, :rows=>4)
|
37
|
-
else
|
38
|
-
# grab any documents we do not know who you are
|
39
|
-
(_, @recent_documents) = get_search_results(:q =>'', :sort=>sort_field, :rows=>4)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def recent_me
|
44
|
-
if user_signed_in?
|
45
|
-
(_, @recent_user_documents) = get_search_results(:q =>filter_mine,
|
46
|
-
:sort=>sort_field, :rows=>4)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
24
|
def self.uploaded_field
|
51
|
-
# system_create_dtsi
|
52
25
|
solr_name('desc_metadata__date_uploaded', :stored_sortable, type: :date)
|
53
26
|
end
|
54
27
|
|
@@ -56,22 +29,20 @@ class CatalogController < ApplicationController
|
|
56
29
|
solr_name('desc_metadata__date_modified', :stored_sortable, type: :date)
|
57
30
|
end
|
58
31
|
|
59
|
-
|
60
32
|
configure_blacklight do |config|
|
61
33
|
## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params
|
62
34
|
config.default_solr_params = {
|
63
35
|
:qt => "search",
|
64
36
|
:rows => 10
|
65
37
|
}
|
66
|
-
|
67
|
-
#
|
68
|
-
|
69
|
-
config.
|
38
|
+
|
39
|
+
# Specify which field to use in the tag cloud on the homepage.
|
40
|
+
# To disable the tag cloud, comment out this line.
|
41
|
+
config.tag_cloud_field_name = Solrizer.solr_name("desc_metadata__tag", :facetable)
|
70
42
|
|
71
43
|
# solr field configuration for document/show views
|
72
|
-
config.
|
73
|
-
config.
|
74
|
-
config.show.display_type = solr_name("has_model", :symbol)
|
44
|
+
config.index.title_field = solr_name("desc_metadata__title", :displayable)
|
45
|
+
config.index.display_type_field = solr_name("has_model", :symbol)
|
75
46
|
|
76
47
|
# solr fields that will be treated as facets by the blacklight application
|
77
48
|
# The ordering of the field names is the order of the display
|
@@ -145,15 +116,13 @@ class CatalogController < ApplicationController
|
|
145
116
|
# solr request handler? The one set in config[:default_solr_parameters][:qt],
|
146
117
|
# since we aren't specifying it otherwise.
|
147
118
|
config.add_search_field('all_fields', :label => 'All Fields', :include_in_advanced_search => false) do |field|
|
119
|
+
all_names = config.show_fields.values.map{|val| val.field}.join(" ")
|
148
120
|
title_name = solr_name("desc_metadata__title", :stored_searchable, type: :string)
|
149
|
-
label_name = solr_name("desc_metadata__title", :stored_searchable, type: :string)
|
150
|
-
contributor_name = solr_name("desc_metadata__contributor", :stored_searchable, type: :string)
|
151
121
|
field.solr_parameters = {
|
152
|
-
:qf => "#{
|
122
|
+
:qf => "#{all_names} noid_tsi file_format_tesim",
|
153
123
|
:pf => "#{title_name}"
|
154
124
|
}
|
155
125
|
end
|
156
|
-
|
157
126
|
|
158
127
|
# Now we see how to over-ride Solr request handler defaults, in this
|
159
128
|
# case for a BL "search field", which is really a dismax aggregate
|
@@ -175,8 +144,6 @@ class CatalogController < ApplicationController
|
|
175
144
|
}
|
176
145
|
end
|
177
146
|
|
178
|
-
|
179
|
-
|
180
147
|
config.add_search_field('creator') do |field|
|
181
148
|
field.solr_parameters = { :"spellcheck.dictionary" => "creator" }
|
182
149
|
solr_name = solr_name("desc_metadata__creator", :stored_searchable, type: :string)
|
@@ -327,7 +294,6 @@ class CatalogController < ApplicationController
|
|
327
294
|
}
|
328
295
|
end
|
329
296
|
|
330
|
-
|
331
297
|
# "sort results by" select (pulldown)
|
332
298
|
# label in pulldown is followed by the name of the SOLR field to sort by and
|
333
299
|
# whether the sort is ascending or descending (it must be asc or desc
|
@@ -344,32 +310,4 @@ class CatalogController < ApplicationController
|
|
344
310
|
config.spell_max = 5
|
345
311
|
end
|
346
312
|
|
347
|
-
protected
|
348
|
-
|
349
|
-
# Limits search results just to GenericFiles
|
350
|
-
# @param solr_parameters the current solr parameters
|
351
|
-
# @param user_parameters the current user-subitted parameters
|
352
|
-
def exclude_unwanted_models(solr_parameters, user_parameters)
|
353
|
-
solr_parameters[:fq] ||= []
|
354
|
-
solr_parameters[:fq] << "#{Solrizer.solr_name("has_model", :symbol)}:\"info:fedora/afmodel:GenericFile\""
|
355
|
-
end
|
356
|
-
|
357
|
-
def depositor
|
358
|
-
#Hydra.config[:permissions][:owner] maybe it should match this config variable, but it doesn't.
|
359
|
-
Solrizer.solr_name('depositor', :stored_searchable, type: :string)
|
360
|
-
end
|
361
|
-
|
362
|
-
def filter_not_mine
|
363
|
-
"{!lucene q.op=AND df=#{depositor}}-#{current_user.user_key}"
|
364
|
-
end
|
365
|
-
|
366
|
-
def filter_mine
|
367
|
-
"{!lucene q.op=AND df=#{depositor}}#{current_user.user_key}"
|
368
|
-
end
|
369
|
-
|
370
|
-
def sort_field
|
371
|
-
"#{Solrizer.solr_name('system_create', :sortable)} desc"
|
372
|
-
end
|
373
|
-
|
374
|
-
|
375
313
|
end
|