sufia 7.2.0 → 7.3.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +2 -0
  3. data/.rubocop.yml +3 -0
  4. data/.rubocop_todo.yml +1 -2
  5. data/.travis.yml +0 -1
  6. data/Gemfile +2 -1
  7. data/README.md +23 -106
  8. data/app/actors/sufia/apply_permission_template_actor.rb +19 -0
  9. data/app/actors/sufia/create_with_remote_files_actor.rb +2 -2
  10. data/app/actors/sufia/default_admin_set_actor.rb +42 -0
  11. data/app/actors/sufia/interpret_visibility_actor.rb +115 -0
  12. data/app/assets/images/collection.png +0 -0
  13. data/app/assets/javascripts/sufia.js +6 -0
  14. data/app/assets/javascripts/sufia/admin/admin_set/participants.es6 +9 -0
  15. data/app/assets/javascripts/sufia/admin/admin_set/visibility.es6 +134 -0
  16. data/app/assets/javascripts/sufia/admin/admin_set_controls.es6 +11 -0
  17. data/app/assets/javascripts/sufia/app.js +27 -5
  18. data/app/assets/javascripts/sufia/autocomplete.es6 +15 -0
  19. data/app/assets/javascripts/sufia/autocomplete/work.es6 +29 -0
  20. data/app/assets/javascripts/sufia/dashboard_actions.js +2 -4
  21. data/app/assets/javascripts/sufia/save_work/save_work_control.es6 +14 -2
  22. data/app/assets/javascripts/sufia/save_work/uploaded_files.es6 +7 -2
  23. data/app/assets/javascripts/sufia/save_work/visibility_component.es6 +245 -4
  24. data/app/assets/javascripts/sufia/select_work_type.es6 +38 -0
  25. data/app/assets/javascripts/sufia/workflow_actions_affix.js +14 -0
  26. data/app/assets/stylesheets/sufia/_dashboard.scss +50 -29
  27. data/app/assets/stylesheets/sufia/_footer.scss +30 -0
  28. data/app/assets/stylesheets/sufia/_header.scss +3 -4
  29. data/app/assets/stylesheets/sufia/_home-page.scss +10 -8
  30. data/app/assets/stylesheets/sufia/_select_work_type.scss +43 -0
  31. data/app/assets/stylesheets/sufia/_sufia.scss +4 -1
  32. data/app/assets/stylesheets/sufia/_variables.scss +3 -0
  33. data/app/assets/stylesheets/sufia/admin.scss +66 -169
  34. data/app/assets/stylesheets/sufia/blacklight_gallery.scss +17 -0
  35. data/app/authorities/qa/authorities/find_works.rb +15 -0
  36. data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +2 -1
  37. data/app/controllers/concerns/sufia/batch_uploads_controller_behavior.rb +26 -13
  38. data/app/controllers/concerns/sufia/collections_controller_behavior.rb +25 -0
  39. data/app/controllers/concerns/sufia/controller.rb +8 -0
  40. data/app/controllers/concerns/sufia/deny_access_override_behavior.rb +1 -1
  41. data/app/controllers/concerns/sufia/file_sets_controller_behavior.rb +5 -14
  42. data/app/controllers/concerns/sufia/homepage_controller_behavior.rb +2 -0
  43. data/app/controllers/concerns/sufia/users_controller_behavior.rb +18 -7
  44. data/app/controllers/concerns/sufia/works_controller_behavior.rb +13 -10
  45. data/app/controllers/my/collections_controller.rb +5 -0
  46. data/app/controllers/my/shares_controller.rb +5 -0
  47. data/app/controllers/my/works_controller.rb +5 -0
  48. data/app/controllers/stats_controller.rb +1 -1
  49. data/app/controllers/sufia/admin/admin_sets_controller.rb +20 -2
  50. data/app/controllers/sufia/admin/permission_template_accesses_controller.rb +15 -0
  51. data/app/controllers/sufia/admin/permission_templates_controller.rb +29 -0
  52. data/app/controllers/sufia/admin_controller.rb +2 -0
  53. data/app/controllers/sufia/trophies_controller.rb +0 -2
  54. data/app/forms/sufia/forms/admin_set_form.rb +19 -0
  55. data/app/forms/sufia/forms/batch_edit_form.rb +16 -6
  56. data/app/forms/sufia/forms/batch_upload_form.rb +3 -2
  57. data/app/forms/sufia/forms/permission_template_form.rb +115 -0
  58. data/app/forms/sufia/forms/work_form.rb +6 -0
  59. data/app/helpers/batch_edits_helper.rb +1 -1
  60. data/app/helpers/sufia/citations_behavior.rb +0 -5
  61. data/app/helpers/sufia/citations_behaviors/formatters.rb +0 -1
  62. data/app/helpers/sufia/sufia_helper_behavior.rb +38 -6
  63. data/app/indexers/sufia/collection_indexer.rb +6 -0
  64. data/app/jobs/batch_create_job.rb +7 -15
  65. data/app/models/batch_upload_item.rb +2 -0
  66. data/app/models/concerns/sufia/ability.rb +12 -1
  67. data/app/models/sufia/permission_template.rb +102 -0
  68. data/app/models/sufia/permission_template_access.rb +18 -0
  69. data/app/presenters/sufia/admin_set_presenter.rb +1 -1
  70. data/app/presenters/sufia/model_icon.rb +7 -0
  71. data/app/presenters/sufia/select_type_list_presenter.rb +37 -0
  72. data/app/presenters/sufia/select_type_presenter.rb +35 -0
  73. data/app/presenters/sufia/work_show_presenter.rb +0 -2
  74. data/app/search_builders/collection_search_builder.rb +0 -2
  75. data/app/search_builders/sufia/admin_set_search_builder.rb +24 -0
  76. data/app/search_builders/sufia/catalog_search_builder.rb +10 -4
  77. data/app/search_builders/sufia/find_works_search_builder.rb +44 -0
  78. data/app/search_builders/sufia/my_search_builder_behavior.rb +0 -4
  79. data/app/search_builders/sufia/my_works_search_builder.rb +1 -1
  80. data/app/services/sufia/actor_factory.rb +6 -2
  81. data/app/services/sufia/admin_set_create_service.rb +22 -0
  82. data/app/services/sufia/admin_set_service.rb +46 -16
  83. data/app/services/sufia/collection_thumbnail_path_service.rb +10 -0
  84. data/app/services/sufia/workflow/abstract_notification.rb +39 -0
  85. data/app/services/sufia/workflow/changes_required_notification.rb +22 -0
  86. data/app/services/sufia/workflow/complete_notification.rb +22 -0
  87. data/app/services/sufia/workflow/pending_review_notification.rb +21 -0
  88. data/app/services/sufia/workflow/workflow_by_admin_set_strategy.rb +15 -0
  89. data/app/views/_masthead.html.erb +4 -4
  90. data/app/views/_toolbar.html.erb +31 -9
  91. data/app/views/_user_util_links.html.erb +7 -7
  92. data/app/views/batch_edits/edit.html.erb +24 -12
  93. data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
  94. data/app/views/collections/_form.html.erb +2 -2
  95. data/app/views/collections/_media_display.html.erb +1 -1
  96. data/app/views/curation_concerns/base/_find_work_widget.html.erb +16 -0
  97. data/app/views/curation_concerns/base/_form.html.erb +6 -0
  98. data/app/views/curation_concerns/base/_form_child_work_relationships.html.erb +1 -1
  99. data/app/views/curation_concerns/base/_form_metadata.html.erb +1 -1
  100. data/app/views/curation_concerns/base/_form_parent_work_relationships.html.erb +43 -0
  101. data/app/views/curation_concerns/base/_form_progress.html.erb +7 -4
  102. data/app/views/curation_concerns/base/_form_relationships.html.erb +6 -6
  103. data/app/views/curation_concerns/base/_form_share.html.erb +1 -2
  104. data/app/views/curation_concerns/base/_guts4form.html.erb +1 -1
  105. data/app/views/curation_concerns/base/_social_media.html.erb +1 -1
  106. data/app/views/curation_concerns/base/_workflow_actions_widget.erb +3 -0
  107. data/app/views/curation_concerns/base/edit.html.erb +1 -1
  108. data/app/views/curation_concerns/base/new.html.erb +1 -1
  109. data/app/views/curation_concerns/base/show.html.erb +4 -1
  110. data/app/views/curation_concerns/file_sets/_show_actions.html.erb +0 -3
  111. data/app/views/dashboard/_create_work_action.html.erb +20 -0
  112. data/app/views/dashboard/_index_partials/_heading_actions.html.erb +9 -22
  113. data/app/views/layouts/admin.html.erb +8 -68
  114. data/app/views/layouts/curation_concerns/1_column.html.erb +4 -31
  115. data/app/views/layouts/homepage.html.erb +15 -45
  116. data/app/views/layouts/sufia-dashboard.html.erb +1 -36
  117. data/app/views/layouts/sufia.html.erb +49 -0
  118. data/app/views/my/_document_list.html.erb +1 -1
  119. data/app/views/my/_facet_limit.html.erb +2 -2
  120. data/app/views/my/_index_partials/_default_group.html.erb +10 -10
  121. data/app/views/my/_index_partials/_list_collections.html.erb +1 -1
  122. data/app/views/my/_sort_and_per_page.html.erb +8 -8
  123. data/app/views/records/edit_fields/_rights.html.erb +0 -1
  124. data/app/views/shared/_footer.html.erb +1 -1
  125. data/app/views/shared/_select_work_type_modal.html.erb +34 -0
  126. data/app/views/sufia/admin/_collections.html.erb +31 -0
  127. data/app/views/sufia/admin/_sidebar.html.erb +35 -23
  128. data/app/views/sufia/admin/admin_sets/_form.html.erb +38 -15
  129. data/app/views/sufia/admin/admin_sets/_form_metadata.html.erb +2 -0
  130. data/app/views/sufia/admin/admin_sets/_form_participant_table.html.erb +21 -0
  131. data/app/views/sufia/admin/admin_sets/_form_participants.html.erb +68 -0
  132. data/app/views/sufia/admin/admin_sets/_form_visibility.html.erb +58 -0
  133. data/app/views/sufia/admin/admin_sets/index.html.erb +29 -33
  134. data/app/views/sufia/admin/admin_sets/show.html.erb +3 -0
  135. data/app/views/sufia/admin/show.html.erb +22 -19
  136. data/app/views/sufia/batch_uploads/_form.html.erb +2 -1
  137. data/app/views/sufia/homepage/index.html.erb +11 -3
  138. data/app/views/sufia/uploads/_js_templates.html.erb +15 -11
  139. data/app/views/users/_user_row.html.erb +10 -0
  140. data/app/views/users/index.html.erb +1 -12
  141. data/config/features.rb +2 -0
  142. data/config/locales/sufia.en.yml +122 -37
  143. data/config/routes.rb +4 -1
  144. data/db/migrate/20161021175854_create_permission_template.rb +11 -0
  145. data/db/migrate/20161021180154_create_permission_template_access.rb +11 -0
  146. data/db/migrate/20161116222307_add_release_to_permission_templates.rb +6 -0
  147. data/lib/generators/sufia/install_generator.rb +12 -3
  148. data/lib/generators/sufia/templates/catalog_controller.rb +3 -13
  149. data/lib/generators/sufia/templates/workflow.json.erb +65 -0
  150. data/lib/generators/sufia/upgrade700_generator.rb +1 -1
  151. data/lib/generators/sufia/work/templates/locale.en.yml.erb +37 -0
  152. data/lib/generators/sufia/{work_generator.rb → work/work_generator.rb} +25 -5
  153. data/lib/sufia.rb +0 -1
  154. data/lib/sufia/engine.rb +7 -0
  155. data/lib/sufia/move_all_works_to_admin_set.rb +8 -0
  156. data/lib/sufia/version.rb +1 -1
  157. data/lib/tasks/migrate.rake +8 -0
  158. data/spec/actors/sufia/apply_permission_template_actor_spec.rb +64 -0
  159. data/spec/actors/sufia/create_with_remote_files_actor_spec.rb +8 -0
  160. data/spec/actors/sufia/default_admin_set_actor_spec.rb +43 -0
  161. data/spec/actors/sufia/interpret_visibility_actor_spec.rb +266 -0
  162. data/spec/authorities/qa/authorities/find_works_spec.rb +55 -0
  163. data/spec/controllers/batch_edits_controller_spec.rb +1 -6
  164. data/spec/controllers/citations_controller_spec.rb +49 -10
  165. data/spec/controllers/collections_controller_spec.rb +39 -0
  166. data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +22 -1
  167. data/spec/controllers/dashboard_controller_spec.rb +0 -8
  168. data/spec/controllers/depositors_controller_spec.rb +2 -2
  169. data/spec/controllers/downloads_controller_spec.rb +2 -2
  170. data/spec/controllers/my/collections_controller_spec.rb +5 -0
  171. data/spec/controllers/my/shares_controller_spec.rb +5 -0
  172. data/spec/controllers/my/works_controller_spec.rb +5 -0
  173. data/spec/controllers/stats_controller_spec.rb +1 -1
  174. data/spec/controllers/sufia/admin/admin_sets_controller_spec.rb +33 -5
  175. data/spec/controllers/sufia/admin/permission_template_accesses_controller_spec.rb +36 -0
  176. data/spec/controllers/sufia/admin/permission_templates_controller_spec.rb +46 -0
  177. data/spec/controllers/sufia/admin_controller_spec.rb +6 -0
  178. data/spec/controllers/sufia/batch_uploads_controller_spec.rb +40 -42
  179. data/spec/controllers/sufia/homepage_controller_spec.rb +14 -0
  180. data/spec/controllers/sufia/trophies_controller_spec.rb +17 -4
  181. data/spec/controllers/users_controller_spec.rb +13 -4
  182. data/spec/factories/permission_template_accesses.rb +5 -0
  183. data/spec/factories/permission_templates.rb +5 -0
  184. data/spec/factories/sipity_entities.rb +7 -0
  185. data/spec/factories/users.rb +4 -0
  186. data/spec/factories/workflow_states.rb +6 -0
  187. data/spec/factories/workflows.rb +5 -0
  188. data/spec/features/admin_admin_set_spec.rb +6 -4
  189. data/spec/features/batch_edit_spec.rb +0 -1
  190. data/spec/features/collection_spec.rb +4 -4
  191. data/spec/features/edit_work_spec.rb +1 -0
  192. data/spec/features/work_show_spec.rb +10 -0
  193. data/spec/forms/sufia/forms/admin_set_form_spec.rb +2 -1
  194. data/spec/forms/sufia/forms/batch_edit_form_spec.rb +30 -0
  195. data/spec/forms/sufia/forms/permission_template_form_spec.rb +196 -0
  196. data/spec/forms/sufia/forms/work_form_spec.rb +35 -1
  197. data/spec/helpers/batch_edits_helper_spec.rb +4 -4
  198. data/spec/helpers/blacklight_helper_spec.rb +1 -1
  199. data/spec/helpers/sufia_helper_spec.rb +39 -7
  200. data/spec/indexers/sufia/collection_indexer_spec.rb +12 -0
  201. data/spec/javascripts/autocomplete_spec.js.coffee +46 -6
  202. data/spec/javascripts/visibility_component_spec.js +491 -0
  203. data/spec/jobs/batch_create_job_spec.rb +27 -28
  204. data/spec/lib/sufia/arkivo_spec.rb +14 -0
  205. data/spec/lib/sufia/controlled_vocabulary/importer/downloader_spec.rb +31 -0
  206. data/spec/lib/sufia/move_all_works_to_admin_set_spec.rb +13 -0
  207. data/spec/lib/sufia/zotero_spec.rb +8 -0
  208. data/spec/models/sufia/ability_spec.rb +54 -14
  209. data/spec/models/sufia/permission_template_spec.rb +144 -0
  210. data/spec/models/sufia/user_usage_stats_spec.rb +8 -2
  211. data/spec/presenters/sufia/homepage_presenter_spec.rb +1 -1
  212. data/spec/presenters/sufia/select_type_list_presenter_spec.rb +26 -0
  213. data/spec/presenters/sufia/select_type_presenter_spec.rb +21 -0
  214. data/spec/search_builder/sufia/admin_set_search_builder_spec.rb +57 -0
  215. data/spec/search_builder/sufia/catalog_search_builder_spec.rb +40 -14
  216. data/spec/search_builder/sufia/find_works_search_builder_spec.rb +60 -0
  217. data/spec/search_builder/sufia/my_shares_search_builder_spec.rb +4 -1
  218. data/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb +5 -1
  219. data/spec/services/sufia/actor_factory_spec.rb +13 -5
  220. data/spec/services/sufia/admin_set_create_service_spec.rb +27 -0
  221. data/spec/services/sufia/admin_set_service_spec.rb +104 -17
  222. data/spec/services/sufia/workflow/changes_required_notification_spec.rb +32 -0
  223. data/spec/services/sufia/workflow/complete_notification_spec.rb +32 -0
  224. data/spec/services/sufia/workflow/pending_review_notification_spec.rb +31 -0
  225. data/spec/services/sufia/workflow/workflow_by_admin_set_strategy_spec.rb +22 -0
  226. data/spec/spec_helper.rb +24 -5
  227. data/spec/support/proxies.rb +1 -1
  228. data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -0
  229. data/spec/views/_toolbar.html.erb_spec.rb +23 -6
  230. data/spec/views/batch_edits/edit.html.erb_spec.rb +7 -1
  231. data/spec/views/collections/_form_for_select_collection.html.erb_spec.rb +1 -3
  232. data/spec/views/curation_concerns/base/_find_work_widget.html.erb_spec.rb +22 -0
  233. data/spec/views/curation_concerns/base/_form.html.erb_spec.rb +7 -0
  234. data/spec/views/curation_concerns/base/_form_child_work_relationships.html.erb_spec.rb +1 -0
  235. data/spec/views/curation_concerns/base/_form_parent_work_relationships.html.erb_spec.rb +114 -0
  236. data/spec/views/curation_concerns/base/_form_progress.html.erb_spec.rb +3 -2
  237. data/spec/views/curation_concerns/base/_social_media.html.erb_spec.rb +1 -1
  238. data/spec/views/curation_concerns/base/edit.html.erb_spec.rb +1 -1
  239. data/spec/views/curation_concerns/base/show.html.erb_spec.rb +5 -1
  240. data/spec/views/curation_concerns/file_sets/_show_actions.html.erb_spec.rb +2 -2
  241. data/spec/views/dashboard/create_work_action.html.erb_spec.rb +27 -0
  242. data/spec/views/dashboard/index_spec.rb +7 -2
  243. data/spec/views/my/_sort_and_per_page.html.erb_spec.rb +33 -0
  244. data/spec/views/shared/select_work_type_modal.html.erb_spec.rb +32 -0
  245. data/spec/views/sufia/admin/admin_sets/_form.html.erb_spec.rb +18 -0
  246. data/spec/views/sufia/admin/admin_sets/_form_participants.html.erb_spec.rb +13 -0
  247. data/spec/views/sufia/admin/admin_sets/_form_visibility.html.erb_spec.rb +23 -0
  248. data/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb +2 -12
  249. data/spec/views/sufia/homepage/index.html.erb_spec.rb +29 -8
  250. data/sufia.gemspec +5 -6
  251. data/tasks/sufia-dev.rake +6 -10
  252. data/template.rb +15 -0
  253. metadata +140 -28
  254. data/app/assets/stylesheets/sufia/widgets.css +0 -288
  255. data/app/helpers/sufia/citations_behaviors/formatters/endnote_formatter.rb +0 -49
  256. data/app/models/domain_term.rb +0 -4
  257. data/app/views/citations/file.html.erb +0 -0
  258. data/app/views/records/_rights_modal.html.erb +0 -1
  259. data/db/migrate/20160328222160_create_local_authorities.rb +0 -50
@@ -11,6 +11,9 @@
11
11
  <%= link_to sufia.edit_admin_admin_set_path(@presenter), class: 'btn btn-primary' do %>
12
12
  <span class="fa fa-edit"></span> <%= t(:'helpers.action.edit') %>
13
13
  <% end %>
14
+ <%= link_to sufia.admin_admin_set_path(@presenter), class: 'btn btn-danger', data: { confirm: t('.confirm_delete'), method: :delete } do %>
15
+ <span class="fa fa-remove"></span> <%= t(:'helpers.action.delete') %>
16
+ <% end %>
14
17
  </div>
15
18
  </div>
16
19
 
@@ -1,36 +1,39 @@
1
- <!-- START WIDGETS -->
2
1
  <div class="row">
3
2
  <div class="col-md-3">
4
- <div class="widget widget-default">
5
- <div class="widget-title">Registered users</div>
6
- <div class="widget-subtitle">Current</div>
7
- <div class="widget-int num-count"><%= @presenter.user_count %></div>
3
+ <div class="panel panel-default">
4
+ <div class="panel-heading"><div class="h3 panel-title text-center"><%= t('.registered_users') %></div></div>
5
+ <div class="panel-body text-center">
6
+ Current
7
+ <div class="h3"><%= @presenter.user_count %></div>
8
+ </div>
8
9
  </div>
9
10
  </div>
10
11
 
11
12
  <div class="col-md-3">
12
- <div class="widget widget-default">
13
- <div class="widget-title">Total Visitors</div>
14
- <div class="widget-subtitle">Past 30 days</div>
15
- <div class="widget-int">n/a</div>
13
+ <div class="panel panel-default">
14
+ <div class="panel-heading"><div class="h3 panel-title text-center"><%= t('.total_visitors') %></div></div>
15
+ <div class="panel-body text-center">Past 30 days
16
+ <div class="h3">n/a</div>
17
+ </div>
16
18
  </div>
17
19
  </div>
18
20
 
19
21
  <div class="col-md-3">
20
- <div class="widget widget-default">
21
- <div class="widget-title">Returning Visitors</div>
22
- <div class="widget-subtitle">Past 30 days</div>
23
- <div class="widget-int">n/a</div>
22
+ <div class="panel panel-default">
23
+ <div class="panel-heading"><div class="h3 panel-title text-center"><%= t('.returning_visitors') %></div></div>
24
+ <div class="panel-body text-center">Past 30 days
25
+ <div class="h3">n/a</div>
26
+ </div>
24
27
  </div>
25
28
  </div>
26
29
 
27
-
28
30
  <div class="col-md-3">
29
- <div class="widget widget-default">
30
- <div class="widget-title">New Vistors</div>
31
- <div class="widget-subtitle">Past 30 days</div>
32
- <div class="widget-int">n/a</div>
31
+ <div class="panel panel-default">
32
+ <div class="panel-heading"><div class="h3 panel-title text-center"><%= t('.new_visitors') %></div></div>
33
+ <div class="panel-body text-center">Past 30 days
34
+ <div class="h3">n/a</div>
35
+ </div>
33
36
  </div>
34
37
  </div>
35
38
  </div>
36
- <!-- END WIDGETS -->
39
+ <%= render 'collections' %>
@@ -1,10 +1,11 @@
1
1
  <%= simple_form_for [sufia, @form], html: { multipart: true } do |f| %>
2
2
  <% content_for :files_tab do %>
3
3
  <p class="switch-upload-type">To create a single work for all the files, go to <%= link_to "New Work", [:new, Sufia.primary_work_type.model_name.singular_route_key] %></p>
4
- <p class="instructions"><%= t("sufia.batch_uploads.files.instructions") %></p>
4
+ <p class="instructions"><%= t("sufia.batch_uploads.files.instructions") %></p>
5
5
  <% end %>
6
6
  <%= render 'curation_concerns/base/guts4form', f: f, tabs: %w[files metadata relationships share] do %>
7
7
  <% end %>
8
+ <%= f.hidden_field :payload_concern, value: @form.payload_concern %>
8
9
  <% end %>
9
10
 
10
11
  <script type="text/javascript">
@@ -3,9 +3,17 @@
3
3
  <% if @presenter.display_share_button? %>
4
4
  <div class="home_share_work row">
5
5
  <div class="col-sm-12 text-center">
6
- <%= link_to [:new, Sufia.primary_work_type.model_name.singular_route_key],
7
- class: "btn btn-primary btn-lg" do %>
8
- <i class="glyphicon glyphicon-upload"></i> <%= t('sufia.share_button') %>
6
+ <% if signed_in? %>
7
+ <%= link_to '#',
8
+ class: "btn btn-primary btn-lg",
9
+ data: { behavior: 'select-work', target: '#worktypes-to-create', 'create-type' => 'single' } do %>
10
+ <i class="glyphicon glyphicon-upload"></i> <%= t('sufia.share_button') %>
11
+ <% end %>
12
+ <% else %>
13
+ <%= link_to sufia.dashboard_index_path,
14
+ class: "btn btn-primary btn-lg" do %>
15
+ <i class="glyphicon glyphicon-upload"></i> <%= t('sufia.share_button') %>
16
+ <% end %>
9
17
  <% end %>
10
18
  <p><a href="/terms/">Terms of Use</a></p>
11
19
  </div>
@@ -33,10 +33,19 @@
33
33
 
34
34
  <!-- function used by the following template -->
35
35
  <script type="text/javascript">
36
- function setAllResourceTypes() {
37
- var firstResourceType = $(".resource_type_dropdown")[0].value;
36
+ function setAllResourceTypes(resourceTypeId) {
37
+ var firstResourceType = $("#resource_type_" + resourceTypeId.toString())[0];
38
+ var selected_options = [];
39
+ for (var i = 0; i < firstResourceType.length; i++) {
40
+ if (firstResourceType.options[i].selected) {
41
+ selected_options.push(firstResourceType.options[i].value);
42
+ }
43
+ }
38
44
  $(".resource_type_dropdown").each(function(index, element) {
39
- element.value = firstResourceType;
45
+ for(var i=0; i< this.length; i++) {
46
+ this.options[i].selected =
47
+ $.inArray(this.options[i].value, selected_options) > -1 ? true : false;
48
+ }
40
49
  });
41
50
  }
42
51
  </script>
@@ -71,15 +80,10 @@
71
80
  </div>
72
81
  <label for="resource_type_{%=file.id%}" class="col-sm-5 control-label">Resource Type</label>
73
82
  <div class="col-sm-7">
74
- <select class="form-control resource_type_dropdown" name="resource_type[{%=file.id%}]" id="resource_type_{%=file.id%}" value="{%=file.name%}">
75
- <% ResourceTypesService.select_options.each do |type| %>
76
- <option value="<%= type[0] %>"><%= type[1] %></option>
77
- <% end %>
83
+ <select class="form-control resource_type_dropdown" multiple="multiple" size="6" name="resource_type[{%=file.id%}][]" id="resource_type_{%=file.id%}" value="{%=file.name%}">
84
+ <%= options_for_select(ResourceTypesService.select_options) %>
78
85
  </select>
79
- <!-- TODO: Why is the button drawn for all files? -->
80
- {% if (i == 0) { %}
81
- <button class="btn pull-right resource_type_button" onClick="setAllResourceTypes(); return false;">Set all to this Resource Type</button>
82
- {% } %}
86
+ <button class="btn pull-right resource_type_button" onClick="setAllResourceTypes({%= file.id %}); return false;">Set all to this Resource Type</button>
83
87
  </div>
84
88
  </div>
85
89
  </div>
@@ -0,0 +1,10 @@
1
+ <tr>
2
+ <td><%= link_to sufia.profile_path(user) do %>
3
+ <%= image_tag(user.avatar.url(:thumb), width: 30) if user.avatar.file %>
4
+ <% end %>
5
+ </td>
6
+ <td><%= link_to user.name, sufia.profile_path(user) %></td>
7
+ <td><%= link_to user.user_key, sufia.profile_path(user) %></td>
8
+ <td><%= user.department %></td>
9
+ <td><%= number_of_works(user) %></td>
10
+ </tr>
@@ -13,18 +13,7 @@
13
13
  </tr>
14
14
  </thead>
15
15
  <tbody>
16
- <% @users.each do |user| %>
17
- <tr>
18
- <td><%= link_to sufia.profile_path(user) do %>
19
- <%= image_tag(user.avatar.url(:thumb), width: 30) if user.avatar.file %>
20
- <% end %>
21
- </td>
22
- <td><%= link_to user.name, sufia.profile_path(user) %></td>
23
- <td><%= link_to user.user_key, sufia.profile_path(user) %></td>
24
- <td><%= user.department %></td>
25
- <td><%= number_of_works(user) %></td>
26
- </tr>
27
- <% end %>
16
+ <%= render partial: 'user_row', collection: @users, as: :user %>
28
17
  </tbody>
29
18
  </table>
30
19
  <div class="pager">
data/config/features.rb CHANGED
@@ -4,6 +4,8 @@ Flipflop.configure do
4
4
  strategy :active_record, class: Sufia::Feature
5
5
  strategy :default
6
6
 
7
+ # Note, if this is deactivated, a default admin set will be created and all
8
+ # works will be assigned to it when they are created.
7
9
  feature :assign_admin_set,
8
10
  default: true,
9
11
  description: "Ability to assign uploaded items to an admin set"
@@ -10,6 +10,9 @@ en:
10
10
  contact: "Contact"
11
11
  product_name: "Sufia"
12
12
  product_twitter_handle: "@HydraSphere"
13
+ icons:
14
+ collection: 'fa fa-cubes'
15
+ default: 'fa fa-cube'
13
16
  institution_name: "Institution Name"
14
17
  institution_name_full: "The Institution Name"
15
18
  sort_label: "Sort the listing of items"
@@ -48,6 +51,10 @@ en:
48
51
  button:
49
52
  html: '<span class="glyphicon glyphicon-search"></span> Go'
50
53
  text: "Search"
54
+ select_type:
55
+ name: "Work"
56
+ description: "General purpose worktype"
57
+ icon_class : 'fa fa-file-text-o'
51
58
  upload:
52
59
  my_computer:
53
60
  sr_tab_label: "Access Files from"
@@ -104,14 +111,26 @@ en:
104
111
  shares: "Shares"
105
112
  works:
106
113
  menu: "Works"
107
- new: "New"
114
+ new: "New Work"
108
115
  my: "My Works"
109
116
  batch: "Batch Create"
110
117
  collections:
111
118
  menu: "Collections"
112
119
  my: "My Collections"
113
120
  new: "New Collection"
121
+ notifications: "Notifications"
122
+ profile:
123
+ sr_action: "View"
124
+ sr_target: "profile"
125
+ view: "View Profile"
126
+ edit: "Edit Profile"
127
+ logout: "Logout"
128
+ login: "Login"
114
129
  dashboard:
130
+ heading_actions:
131
+ close: "Close"
132
+ create_work: "Create work"
133
+ select_type_of_work: "Select type of work"
115
134
  title: "My Dashboard"
116
135
  view_collections: "View Collections"
117
136
  create_collection: "Create Collection"
@@ -219,14 +238,12 @@ en:
219
238
  title: "Filename will be the default title. Please provide a more meaningful title, and filenames will still be preserved by the system."
220
239
  resource_type: "You may select multiple types to apply to all files"
221
240
  works:
222
- new:
223
- header: Add New Work
224
- in_collections: This Work in Collections
225
- in_this_work: Other Works in this Work
226
- in_other_works: This Work in Other Works
241
+ create:
242
+ header: "Add New %{type}"
227
243
  after_create_html: "Your files are being processed by %{application_name} in the background. The metadata and access controls you specified are being applied. Files will be marked <span class=\"label label-danger\" title=\"Private\">Private</span> until this process is complete (shouldn't take too long, hang in there!). You may need to refresh this page to see these updates."
228
244
  edit:
229
- header: Edit Work
245
+ breadcrumb: 'Edit'
246
+ form:
230
247
  in_collections: This Work in Collections
231
248
  in_this_work: Other Works in this Work
232
249
  in_other_works: This Work in Other Works
@@ -236,8 +253,10 @@ en:
236
253
  files: "Files"
237
254
  relationships: "Relationships"
238
255
  share: "Share"
256
+ update:
257
+ header: Edit Work
239
258
  progress:
240
- header: Save Work
259
+ header: "Save Work"
241
260
  show:
242
261
  no_preview: No preview available
243
262
  batch_uploads:
@@ -265,13 +284,14 @@ en:
265
284
  label: "Delete"
266
285
  desc: "Delete this collection"
267
286
  confirmation: "Delete this collection?"
287
+ document_list:
288
+ edit: "Edit"
289
+ no_visible_works: "The collection is either empty or does not contain items to which you have access."
268
290
  edit:
269
291
  manage_items: "Manage Items in this Collection"
292
+ form:
270
293
  description: "Descriptions"
271
294
  additional_fields: "Additional fields"
272
- document_list:
273
- edit: "Edit"
274
- no_visible_works: "The collection is either empty or does not contain items to which you have access."
275
295
  select_form:
276
296
  title: "Add to collection"
277
297
  no_collections: "You do not have access to any existing collections. You may create a new collection."
@@ -290,8 +310,6 @@ en:
290
310
  browse_view: "Browse View"
291
311
  show:
292
312
  download: "Download the file"
293
- work:
294
- browse_view: "Browse View"
295
313
  footer:
296
314
  copyright_html: "<strong>Copyright &copy; 2016 Project Hydra</strong> Licensed under the Apache License, Version 2.0"
297
315
  admin:
@@ -300,13 +318,85 @@ en:
300
318
  header: "Edit Administrative Set"
301
319
  new:
302
320
  header: "Create New Administrative Set"
321
+ delete:
322
+ notification: "Administrative set successfully deleted"
323
+ form:
324
+ tabs:
325
+ description: "Description"
326
+ participants: "Participants"
327
+ visibility: "Release and Visibility"
328
+ form_participants:
329
+ add_group: "Add group:"
330
+ add_user: "Add user:"
331
+ add_participants: "Add Participants"
332
+ current_participants: "Current Participants"
333
+ form_participant_table:
334
+ managers:
335
+ title: "Managers"
336
+ help: "Managers of this administrative set can edit the set metadata, participants, and release and visibility settings. Managers can also edit work metadata, add to or remove files from a work, and add new works to the set."
337
+ agent_name: "Managers of This Set"
338
+ type: "Type"
339
+ action: "Action"
340
+ remove: "Remove"
341
+ depositors:
342
+ title: "Depositors"
343
+ help: "Depositors can add new works to this administrative set."
344
+ agent_name: "Depositors of This Set"
345
+ type: "Type"
346
+ action: "Action"
347
+ remove: "Remove"
348
+ viewers:
349
+ title: "Viewers"
350
+ help: "Viewers of this administrative set can view works in the set regardless of the visibility settings applied to the work. For example, viewers can view works in this set even if the works are currently embargoed or restricted."
351
+ agent_name: "Viewers of This Set"
352
+ type: "Type"
353
+ action: "Action"
354
+ remove: "Remove"
355
+ form_visibility:
356
+ page_description: "Release and visibility settings control when works added to this set are made available for discovery and download and who can discover and download them."
357
+ release:
358
+ title: "Release"
359
+ description: "You can impose a delay (embargo) before works in this administrative set are released for discovery and download."
360
+ no_delay: "No delay -- release all works as soon as they are deposited"
361
+ varies:
362
+ description: "Varies -- depositors can set the release date for an individual work:"
363
+ between: "Between \"now\" and"
364
+ embargo:
365
+ select: "Select embargo period.."
366
+ 6mos: "6 months after deposit"
367
+ 1yr: "1 year after deposit"
368
+ 2yrs: "2 years after deposit"
369
+ 3yrs: "3 years after deposit"
370
+ fixed: "Fixed -- delay release of all works until"
371
+ visibility:
372
+ title: "Visibility"
373
+ description: "After its release date, works in this set can be discovered and downloaded by:"
374
+ everyone: "Everyone -- all works in this set will be public"
375
+ varies: "Varies -- default is public, but depositors can restrict the visibility of individual works"
376
+ institution: "Institution -- all works will be visible only to authenticated users of this institution"
377
+ restricted: "Restricted -- all works will be visible only to repository managers and managers and reviewers of this administrative set"
378
+ cancel: "Cancel"
303
379
  show:
304
380
  header: "Administrative Set"
305
381
  item_list_header: "Works in This Set"
382
+ confirm_delete: "Are you sure you wish to delete this Administrative Set? This action cannot be undone."
383
+ collections:
384
+ collection: "Collection"
385
+ subtitle: "Recent collection activity"
386
+ title: "Collections"
387
+ works: "Works"
388
+ show:
389
+ registered_users: "Registered users"
390
+ total_visitors: "Total Visitors"
391
+ returning_visitors: "Returning Visitors"
392
+ new_visitors: "New Visitors"
306
393
  sidebar:
307
394
  admin_sets: "Administrative Sets"
308
395
  settings: "Settings"
309
396
  statistics: "Statistics"
397
+ workflow: "Workflows"
398
+ workflow_review: "Review"
399
+ workflow_roles: "Roles"
310
400
  stats:
311
401
  registered: "Registered"
312
402
  deposited_form:
@@ -323,7 +413,9 @@ en:
323
413
 
324
414
  simple_form:
325
415
  labels:
326
- generic_work: &work_labels
416
+ collection:
417
+ total_items: "Total Items"
418
+ size: "Size"
327
419
  based_near: "Location"
328
420
  description: "Abstract or Summary"
329
421
  keyword: "Keyword"
@@ -332,27 +424,7 @@ en:
332
424
  files: "Upload a new version of this file from your computer"
333
425
  collection_ids: "Add as member of collection"
334
426
  admin_set_id: "Add as member of administrative set"
335
- collection:
336
- total_items: "Total Items"
337
- size: "Size"
338
- <<: *work_labels
339
-
340
427
  hints:
341
- generic_work:
342
- resource: "Pre-defined categories to describe the type of content being uploaded, such as &quot;article&quot; or &quot;dataset.&quot; More than one type may be selected."
343
- title: "A name to aid in identifying a work."
344
- keyword: "Words or phrases you select to describe what the work is about. These are used to search for content."
345
- subject: "Headings or index terms describing what the work is about; these do need to conform to an existing vocabulary."
346
- creator: "The person or group responsible for the work. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. &quot;Smith, John.&quot;."
347
- related_url: "A link to a website or other specific content (audio, video, PDF document) related to the work. An example is the URL of a research project from which the work was derived."
348
- based_near: "A place name related to the work, such as its site of publication, or the city, state, or country the work contents are about. Calls upon the <a href='http://www.geonames.org'>GeoNames web service</a>."
349
- contributor: "A person or group you want to recognize for playing a role in the creation of the work, but not the primary role."
350
- date_created: "The date on which the work was generated."
351
- description: "Free-text notes about the work. Examples include abstracts of a paper or citation information for a journal article."
352
- identifier: "A unique handle identifying the work. An example would be a DOI for a journal article, or an ISBN or OCLC number for a book."
353
- language: "The language of the work's content."
354
- publisher: "The person or group making the work available. Generally this is the institution."
355
- rights: "Licensing and distribution information governing access to the work. Select from the provided drop-down list."
356
428
  collection:
357
429
  resource_type: "Pre-defined categories to describe the type of content being uploaded, such as &quot;article&quot; or &quot;dataset.&quot; More than one type may be selected."
358
430
  title: "A name to aid in identifying a collection."
@@ -379,6 +451,8 @@ en:
379
451
  relationships_parent_row_empty:
380
452
  label: "In %{type}:"
381
453
  empty: "There are no %{type} relationships."
454
+ show:
455
+ last_modified: "Last modified: %{value}"
382
456
  metadata:
383
457
  header: Descriptions
384
458
  attribute_name_label: Attribute Name
@@ -387,6 +461,10 @@ en:
387
461
  local_upload: Add Local Files
388
462
  external_upload: Cloud Providers
389
463
  dropzone: "Drop files here."
464
+ form_progress:
465
+ requirements: Requirements
466
+ required_descriptions: Describe your work
467
+ required_files: Add files
390
468
  items:
391
469
  header: Items
392
470
  thumbnail: Thumbnail
@@ -406,7 +484,7 @@ en:
406
484
  groups_description:
407
485
  description_html: >
408
486
  The list of groups in the drop-down marked "Select a group" is a list of User Managed Groups that
409
- you are a member of. You may select a specific group and assign an access level for a file
487
+ you are a member of. You may select a specific group and assign an access level for a file
410
488
  within %{application_name}, similarly to adding user access levels.
411
489
  visibility:
412
490
  open:
@@ -420,7 +498,7 @@ en:
420
498
  private:
421
499
  label_html: Private
422
500
  single_use_links:
423
- copy:
501
+ copy:
424
502
  button: Copy
425
503
  blacklight:
426
504
  search:
@@ -430,14 +508,21 @@ en:
430
508
  contributor: Contributors
431
509
  keyword: Keyword
432
510
 
433
-
434
511
  helpers:
435
512
  action:
436
513
  admin_set:
437
514
  new: "Create new administrative set"
438
515
  cancel: "Cancel"
516
+ delete: "Delete"
439
517
  edit: "Edit"
440
518
  submit:
441
519
  admin_set:
442
520
  create: 'Save'
443
521
  update: 'Save'
522
+ sufia_permission_template:
523
+ create: 'Save'
524
+ update: 'Save'
525
+ sufia_permission_template_access:
526
+ create: 'Add'
527
+ create: 'Save'
528
+ update: 'Save'