sufia 7.1.0 → 7.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (393) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +49 -0
  3. data/.engine_cart.yml +1 -0
  4. data/.eslintignore +1 -0
  5. data/.eslintrc +213 -0
  6. data/.gitignore +2 -0
  7. data/.hound.yml +5 -0
  8. data/.rubocop.yml +27 -17
  9. data/.rubocop_todo.yml +6 -3
  10. data/.scss-lint.yml +253 -0
  11. data/.travis.yml +3 -2
  12. data/Gemfile +5 -1
  13. data/README.md +30 -16
  14. data/app/assets/javascripts/sufia.js +6 -0
  15. data/app/assets/javascripts/sufia/app.js +13 -5
  16. data/app/assets/javascripts/sufia/fileupload.js.erb +12 -0
  17. data/app/assets/javascripts/sufia/initialize.js +3 -0
  18. data/app/assets/javascripts/sufia/save_work/required_fields.es6 +5 -1
  19. data/app/assets/javascripts/sufia/save_work/save_work_control.es6 +12 -0
  20. data/app/assets/javascripts/sufia/trophy.js +14 -14
  21. data/app/assets/javascripts/sufia/uploader.js +32 -3
  22. data/app/assets/stylesheets/fileupload/jquery.fileupload-ui.scss +29 -35
  23. data/app/assets/stylesheets/sufia/_batch-edit.scss +0 -5
  24. data/app/assets/stylesheets/sufia/_browse_everything_overrides.scss +1 -1
  25. data/app/assets/stylesheets/sufia/_buttons.scss +6 -1
  26. data/app/assets/stylesheets/sufia/_catalog.scss +6 -0
  27. data/app/assets/stylesheets/sufia/_collections.scss +29 -13
  28. data/app/assets/stylesheets/sufia/_dashboard.scss +27 -19
  29. data/app/assets/stylesheets/sufia/_file-listing.scss +7 -0
  30. data/app/assets/stylesheets/sufia/_file_upload.scss +20 -0
  31. data/app/assets/stylesheets/sufia/_form.scss +30 -0
  32. data/app/assets/stylesheets/sufia/_home-page.scss +87 -33
  33. data/app/assets/stylesheets/sufia/_representative-media.scss +4 -0
  34. data/app/assets/stylesheets/sufia/_styles.scss +0 -23
  35. data/app/assets/stylesheets/sufia/_sufia.scss +10 -7
  36. data/app/assets/stylesheets/sufia/_variables.scss +14 -0
  37. data/app/assets/stylesheets/sufia/_work-show.scss +1 -1
  38. data/app/assets/stylesheets/sufia/admin.scss +203 -0
  39. data/app/assets/stylesheets/sufia/widgets.css +288 -0
  40. data/app/controllers/api/items_controller.rb +1 -1
  41. data/app/controllers/concerns/sufia/admin/stats_behavior.rb +7 -1
  42. data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +1 -1
  43. data/app/controllers/concerns/sufia/batch_uploads_controller_behavior.rb +0 -1
  44. data/app/controllers/concerns/sufia/collections_controller_behavior.rb +1 -1
  45. data/app/controllers/concerns/sufia/contact_form_controller_behavior.rb +19 -5
  46. data/app/controllers/concerns/sufia/deny_access_override_behavior.rb +13 -0
  47. data/app/controllers/concerns/sufia/depositors_controller_behavior.rb +1 -10
  48. data/app/controllers/concerns/sufia/file_sets_controller_behavior.rb +1 -1
  49. data/app/controllers/concerns/sufia/homepage_controller_behavior.rb +11 -2
  50. data/app/controllers/concerns/sufia/my_controller_behavior.rb +7 -16
  51. data/app/controllers/concerns/sufia/singular_subresource_controller.rb +1 -10
  52. data/app/controllers/concerns/sufia/transfers_controller_behavior.rb +1 -1
  53. data/app/controllers/concerns/sufia/users_controller_behavior.rb +2 -25
  54. data/app/controllers/concerns/sufia/works_controller_behavior.rb +27 -3
  55. data/app/controllers/content_blocks_controller.rb +12 -2
  56. data/app/controllers/curation_concerns/file_sets_controller.rb +0 -1
  57. data/app/controllers/curation_concerns/permissions_controller.rb +8 -16
  58. data/app/controllers/my/highlights_controller.rb +1 -1
  59. data/app/controllers/stats_controller.rb +2 -2
  60. data/app/controllers/sufia/admin/admin_sets_controller.rb +114 -0
  61. data/app/controllers/sufia/admin/features_controller.rb +13 -0
  62. data/app/controllers/sufia/admin/stats_controller.rb +5 -0
  63. data/app/controllers/sufia/admin/strategies_controller.rb +14 -0
  64. data/app/controllers/sufia/admin_controller.rb +11 -0
  65. data/app/controllers/sufia/admin_sets_controller.rb +25 -0
  66. data/app/controllers/sufia/resource_sync_controller.rb +11 -15
  67. data/app/forms/sufia/forms/admin_set_form.rb +30 -0
  68. data/app/forms/sufia/forms/batch_edit_form.rb +1 -1
  69. data/app/forms/sufia/forms/work_form.rb +2 -2
  70. data/app/helpers/sufia/citations_behaviors/title_behavior.rb +1 -1
  71. data/app/helpers/sufia/dashboard_helper_behavior.rb +6 -0
  72. data/app/helpers/sufia/permissions_helper.rb +19 -0
  73. data/app/helpers/sufia/sufia_helper_behavior.rb +13 -6
  74. data/app/indexers/sufia/work_indexer.rb +4 -0
  75. data/app/jobs/attach_files_to_work_job.rb +3 -1
  76. data/app/jobs/content_depositor_change_event_job.rb +0 -7
  77. data/app/jobs/content_event_job.rb +0 -7
  78. data/app/jobs/event_job.rb +1 -11
  79. data/app/jobs/inherit_permissions_job.rb +24 -0
  80. data/app/mailers/sufia/contact_mailer.rb +11 -0
  81. data/app/models/concerns/sufia/ability.rb +12 -1
  82. data/app/models/concerns/sufia/content_block_behavior.rb +47 -0
  83. data/app/models/concerns/sufia/solr_document/export.rb +6 -0
  84. data/app/models/concerns/sufia/solr_document_behavior.rb +4 -0
  85. data/app/models/concerns/sufia/user.rb +7 -8
  86. data/app/models/concerns/sufia/with_events.rb +5 -1
  87. data/app/models/concerns/sufia/works/featured.rb +1 -1
  88. data/app/models/concerns/sufia/works/trophies.rb +1 -1
  89. data/app/models/content_block.rb +1 -39
  90. data/app/models/featured_work_list.rb +0 -1
  91. data/app/models/file_download_stat.rb +18 -7
  92. data/app/models/file_view_stat.rb +5 -2
  93. data/app/models/sufia/contact_form.rb +33 -0
  94. data/app/models/sufia/feature.rb +5 -0
  95. data/app/models/sufia/statistic.rb +6 -5
  96. data/app/presenters/sufia/admin_dashboard_presenter.rb +8 -0
  97. data/app/presenters/sufia/admin_set_presenter.rb +7 -0
  98. data/app/presenters/sufia/admin_stats_presenter.rb +0 -4
  99. data/app/presenters/sufia/collection_presenter.rb +5 -4
  100. data/app/presenters/sufia/file_set_presenter.rb +16 -3
  101. data/app/presenters/sufia/file_usage.rb +37 -0
  102. data/app/presenters/sufia/stats_usage_presenter.rb +43 -0
  103. data/app/presenters/sufia/trophy_presenter.rb +2 -0
  104. data/app/presenters/sufia/work_show_presenter.rb +3 -1
  105. data/app/presenters/sufia/work_usage.rb +30 -0
  106. data/app/search_builders/collection_search_builder.rb +1 -1
  107. data/app/search_builders/sufia/admin_set_member_search_builder.rb +12 -0
  108. data/app/search_builders/sufia/single_admin_set_search_builder.rb +9 -0
  109. data/app/services/sufia/admin_set_service.rb +22 -0
  110. data/app/services/sufia/analytics.rb +51 -26
  111. data/app/services/sufia/collection_size_service.rb +1 -1
  112. data/app/services/sufia/file_set_csv_service.rb +1 -1
  113. data/app/services/sufia/statistics/system_stats.rb +0 -6
  114. data/app/views/_controls.html.erb +8 -4
  115. data/app/views/_logo.html.erb +1 -1
  116. data/app/views/_toolbar.html.erb +1 -1
  117. data/app/views/catalog/_facet_limit.html.erb +2 -2
  118. data/app/views/catalog/_search_form.html.erb +0 -4
  119. data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -3
  120. data/app/views/catalog/index.html.erb +1 -1
  121. data/app/views/collections/_dashboard_document_list.html.erb +1 -3
  122. data/app/views/collections/_document_list.html.erb +0 -2
  123. data/app/views/collections/_form.html.erb +1 -1
  124. data/app/views/collections/_form_for_select_collection.html.erb +1 -1
  125. data/app/views/collections/_media_display.html.erb +1 -3
  126. data/app/views/collections/_show_descriptions.html.erb +1 -1
  127. data/app/views/collections/_show_document_list.html.erb +3 -1
  128. data/app/views/collections/_show_document_list_menu.html.erb +12 -12
  129. data/app/views/collections/_show_document_list_row.html.erb +6 -4
  130. data/app/views/contact_form/new.html.erb +1 -1
  131. data/app/views/curation_concerns/base/_attribute_rows.html.erb +12 -10
  132. data/app/views/curation_concerns/base/_citations.html.erb +2 -2
  133. data/app/views/curation_concerns/base/_form_files.html.erb +11 -3
  134. data/app/views/curation_concerns/base/_form_metadata.html.erb +1 -1
  135. data/app/views/curation_concerns/base/_form_progress.html.erb +2 -2
  136. data/app/views/curation_concerns/base/_form_relationships.html.erb +8 -0
  137. data/app/views/curation_concerns/base/_guts4form.html.erb +8 -4
  138. data/app/views/curation_concerns/base/_items.html.erb +7 -7
  139. data/app/views/curation_concerns/base/_relationships.html.erb +0 -1
  140. data/app/views/curation_concerns/base/_show_actions.html.erb +3 -0
  141. data/app/views/curation_concerns/base/_social_media.html.erb +49 -15
  142. data/app/views/curation_concerns/file_sets/_actions.html.erb +1 -9
  143. data/app/views/curation_concerns/file_sets/_groups_description.html.erb +1 -5
  144. data/app/views/curation_concerns/file_sets/media_display/_default.html.erb +3 -0
  145. data/app/views/curation_concerns/permissions/confirm_access.html.erb +12 -0
  146. data/app/views/dashboard/_index_partials/_heading_greetings.html.erb +1 -1
  147. data/app/views/layouts/admin.html.erb +71 -0
  148. data/app/views/layouts/{sufia-one-column.html.erb → curation_concerns/1_column.html.erb} +1 -1
  149. data/app/views/layouts/homepage.html.erb +35 -2
  150. data/app/views/layouts/sufia-dashboard.html.erb +1 -1
  151. data/app/views/my/_facet_pagination.html.erb +5 -5
  152. data/app/views/my/_index_partials/_list_collections.html.erb +1 -3
  153. data/app/views/my/_scripts.js.erb +1 -2
  154. data/app/views/my/index.html.erb +3 -3
  155. data/app/views/records/edit_fields/_description.html.erb +2 -2
  156. data/app/views/records/edit_fields/_rights.html.erb +3 -2
  157. data/app/views/records/show_fields/_rights.html.erb +2 -1
  158. data/app/views/shared/_footer.html.erb +1 -1
  159. data/app/views/sufia/admin/_menu.html.erb +5 -0
  160. data/app/views/sufia/admin/_sidebar.html.erb +23 -0
  161. data/app/views/sufia/admin/admin_sets/_form.html.erb +18 -0
  162. data/app/views/sufia/admin/admin_sets/_sort_and_per_page.html.erb +5 -0
  163. data/app/views/sufia/admin/admin_sets/edit.html.erb +9 -0
  164. data/app/views/sufia/admin/admin_sets/index.html.erb +46 -0
  165. data/app/views/sufia/admin/admin_sets/new.html.erb +9 -0
  166. data/app/views/sufia/admin/admin_sets/show.html.erb +43 -0
  167. data/app/views/sufia/admin/features/index.html.erb +57 -0
  168. data/app/views/sufia/admin/show.html.erb +36 -0
  169. data/app/views/{admin → sufia/admin}/stats/_date_form.html.erb +0 -0
  170. data/app/views/{admin → sufia/admin}/stats/_deposits.html.erb +0 -0
  171. data/app/views/{admin → sufia/admin}/stats/_new_users.html.erb +0 -0
  172. data/app/views/{admin → sufia/admin}/stats/_stats_by_date.html.erb +4 -4
  173. data/app/views/{admin → sufia/admin}/stats/_top_data.html.erb +2 -2
  174. data/app/views/{admin → sufia/admin}/stats/_works.html.erb +0 -0
  175. data/app/views/sufia/admin/stats/show.html.erb +7 -0
  176. data/app/views/sufia/admin_sets/_admin_set.html.erb +25 -0
  177. data/app/views/sufia/admin_sets/_document_list.html.erb +30 -0
  178. data/app/views/sufia/admin_sets/_member_document.html.erb +26 -0
  179. data/app/views/sufia/admin_sets/_search_form.html.erb +12 -0
  180. data/app/views/sufia/admin_sets/_sort_and_per_page.html.erb +5 -0
  181. data/app/views/sufia/admin_sets/index.html.erb +2 -0
  182. data/app/views/sufia/admin_sets/show.html.erb +33 -0
  183. data/app/views/sufia/contact_mailer/contact.html.erb +5 -0
  184. data/app/views/sufia/homepage/_explore_collections.html.erb +28 -0
  185. data/app/views/sufia/homepage/_featured_researcher.html.erb +7 -2
  186. data/app/views/sufia/homepage/_featured_works.html.erb +1 -1
  187. data/app/views/sufia/homepage/_home_content.html.erb +21 -3
  188. data/app/views/sufia/homepage/_marketing.html.erb +1 -1
  189. data/app/views/sufia/homepage/_recently_uploaded.html.erb +14 -16
  190. data/app/views/sufia/homepage/index.html.erb +14 -5
  191. data/app/views/users/_activity_log.html.erb +0 -1
  192. data/app/views/users/_contributions.html.erb +1 -1
  193. data/app/views/users/_profile_actions.html.erb +6 -16
  194. data/app/views/users/_vitals.html.erb +0 -5
  195. data/app/views/users/index.html.erb +16 -16
  196. data/config/features.rb +10 -0
  197. data/config/locales/sufia.en.yml +76 -25
  198. data/config/routes.rb +16 -17
  199. data/db/migrate/20160415212015_create_features.rb +10 -0
  200. data/lib/generators/sufia/install_generator.rb +10 -34
  201. data/lib/generators/sufia/templates/catalog_controller.rb +7 -6
  202. data/lib/generators/sufia/templates/config/sufia.rb +7 -0
  203. data/lib/generators/sufia/work_generator.rb +2 -2
  204. data/lib/sufia.rb +0 -1
  205. data/lib/sufia/arkivo/metadata_munger.rb +13 -2
  206. data/lib/sufia/configuration.rb +5 -0
  207. data/lib/sufia/controlled_vocabulary/importer/downloader.rb +17 -0
  208. data/lib/sufia/controlled_vocabulary/importer/language.rb +62 -0
  209. data/lib/sufia/engine.rb +7 -0
  210. data/lib/sufia/redis_event_store.rb +2 -2
  211. data/lib/sufia/resource_sync/resource_list_writer.rb +1 -1
  212. data/lib/sufia/version.rb +1 -1
  213. data/solr/config/solrconfig.xml +26 -15
  214. data/spec/actors/sufia/create_with_files_actor_spec.rb +6 -4
  215. data/spec/actors/sufia/create_with_remote_files_actor_spec.rb +26 -18
  216. data/spec/controllers/api/items_controller_spec.rb +32 -22
  217. data/spec/controllers/api/zotero_controller_spec.rb +2 -2
  218. data/spec/controllers/batch_edits_controller_spec.rb +5 -6
  219. data/spec/controllers/catalog_controller_spec.rb +11 -11
  220. data/spec/controllers/citations_controller_spec.rb +2 -2
  221. data/spec/controllers/collections_controller_spec.rb +57 -36
  222. data/spec/controllers/contact_form_controller_spec.rb +6 -6
  223. data/spec/controllers/content_blocks_controller_spec.rb +8 -8
  224. data/spec/controllers/curation_concerns/audits_controller_spec.rb +2 -2
  225. data/spec/controllers/curation_concerns/file_sets_controller_spec.rb +51 -43
  226. data/spec/controllers/curation_concerns/generic_works_controller_spec.rb +51 -27
  227. data/spec/controllers/curation_concerns/permissions_controller_spec.rb +24 -0
  228. data/spec/controllers/depositors_controller_spec.rb +5 -5
  229. data/spec/controllers/downloads_controller_spec.rb +4 -4
  230. data/spec/controllers/featured_work_lists_controller_spec.rb +5 -3
  231. data/spec/controllers/featured_works_controller_spec.rb +9 -9
  232. data/spec/controllers/mailbox_controller_spec.rb +1 -1
  233. data/spec/controllers/my/collections_controller_spec.rb +3 -7
  234. data/spec/controllers/my/highlights_controller_spec.rb +2 -2
  235. data/spec/controllers/my/shares_controller_spec.rb +2 -2
  236. data/spec/controllers/my/works_controller_spec.rb +5 -14
  237. data/spec/controllers/pages_controller_spec.rb +2 -2
  238. data/spec/controllers/static_controller_spec.rb +2 -2
  239. data/spec/controllers/stats_controller_spec.rb +8 -8
  240. data/spec/controllers/sufia/admin/admin_sets_controller_spec.rb +123 -0
  241. data/spec/controllers/sufia/admin/features_controller_spec.rb +29 -0
  242. data/spec/controllers/{admin → sufia/admin}/stats_controller_spec.rb +10 -6
  243. data/spec/controllers/sufia/admin/strategies_controller_spec.rb +30 -0
  244. data/spec/controllers/sufia/admin_controller_spec.rb +13 -0
  245. data/spec/controllers/sufia/admin_sets_controller_spec.rb +28 -0
  246. data/spec/controllers/sufia/batch_uploads_controller_spec.rb +48 -17
  247. data/spec/controllers/sufia/homepage_controller_spec.rb +21 -0
  248. data/spec/controllers/sufia/trophies_controller_spec.rb +2 -2
  249. data/spec/controllers/sufia/uploads_controller_spec.rb +5 -5
  250. data/spec/controllers/tinymce_assets_controller_spec.rb +5 -5
  251. data/spec/controllers/transfers_controller_spec.rb +23 -16
  252. data/spec/controllers/users_controller_spec.rb +21 -69
  253. data/spec/factories/admin_sets.rb +9 -0
  254. data/spec/factories/collections_factory.rb +5 -3
  255. data/spec/factories/generic_works.rb +3 -1
  256. data/spec/features/admin_admin_set_spec.rb +30 -0
  257. data/spec/features/browse_dashboard_files_spec.rb +3 -3
  258. data/spec/features/contact_form_spec.rb +5 -5
  259. data/spec/features/create_work_spec.rb +1 -1
  260. data/spec/features/display_dashboard_spec.rb +1 -1
  261. data/spec/features/ownership_transfer_spec.rb +29 -30
  262. data/spec/features/search_spec.rb +2 -1
  263. data/spec/features/user_admin_set_spec.rb +55 -0
  264. data/spec/features/work_show_spec.rb +13 -3
  265. data/spec/forms/curation_concerns/generic_work_form_spec.rb +30 -24
  266. data/spec/forms/sufia/forms/admin_set_form_spec.rb +20 -0
  267. data/spec/forms/sufia/forms/batch_edit_form_spec.rb +27 -25
  268. data/spec/forms/sufia/forms/batch_upload_form_spec.rb +29 -26
  269. data/spec/forms/sufia/forms/collection_form_spec.rb +36 -32
  270. data/spec/helpers/sufia_helper_spec.rb +17 -28
  271. data/spec/indexers/sufia/work_indexer_spec.rb +16 -0
  272. data/spec/javascripts/required_field_spec.js +41 -0
  273. data/spec/javascripts/save_work_spec.js +9 -0
  274. data/spec/jobs/attach_files_to_work_job_spec.rb +6 -1
  275. data/spec/jobs/batch_create_job_spec.rb +8 -6
  276. data/spec/jobs/content_delete_event_job_spec.rb +6 -18
  277. data/spec/jobs/content_deposit_event_job_spec.rb +3 -12
  278. data/spec/jobs/content_depositor_change_event_job_spec.rb +3 -8
  279. data/spec/jobs/content_new_version_event_job_spec.rb +3 -12
  280. data/spec/jobs/content_restored_version_event_job_spec.rb +3 -11
  281. data/spec/jobs/content_update_event_job_spec.rb +13 -79
  282. data/spec/jobs/file_set_attached_event_job_spec.rb +2 -10
  283. data/spec/jobs/inherit_permissions_job_spec.rb +96 -0
  284. data/spec/jobs/user_edit_profile_event_job_spec.rb +3 -7
  285. data/spec/lib/sufia/analytics_spec.rb +42 -11
  286. data/spec/lib/sufia/arkivo/actor_spec.rb +4 -4
  287. data/spec/lib/sufia/arkivo/schema_validator_spec.rb +18 -18
  288. data/spec/lib/sufia/controlled_vocabulary/importer/language_spec.rb +24 -0
  289. data/spec/lib/sufia/redis_event_store_spec.rb +8 -0
  290. data/spec/lib/sufia/resource_sync/capability_list_writer_spec.rb +4 -2
  291. data/spec/lib/sufia/resource_sync/resource_list_writer_spec.rb +10 -7
  292. data/spec/models/file_download_stat_spec.rb +35 -12
  293. data/spec/models/file_view_stat_spec.rb +12 -12
  294. data/spec/models/flipflop_spec.rb +8 -0
  295. data/spec/models/generic_work_spec.rb +3 -1
  296. data/spec/models/solr_document_spec.rb +20 -8
  297. data/spec/models/sufia/ability_spec.rb +5 -0
  298. data/spec/models/user_spec.rb +4 -28
  299. data/spec/models/work_view_stat_spec.rb +26 -17
  300. data/spec/presenters/sufia/admin_dashboard_presenter_spec.rb +14 -0
  301. data/spec/presenters/sufia/admin_set_presenter_spec.rb +28 -0
  302. data/spec/presenters/sufia/admin_stats_presenter_spec.rb +0 -8
  303. data/spec/presenters/sufia/collection_presenter_spec.rb +21 -16
  304. data/spec/presenters/sufia/file_set_presenter_spec.rb +44 -1
  305. data/spec/presenters/sufia/file_usage_spec.rb +49 -55
  306. data/spec/presenters/sufia/work_show_presenter_spec.rb +12 -2
  307. data/spec/presenters/sufia/work_usage_spec.rb +37 -36
  308. data/spec/routing/route_spec.rb +19 -21
  309. data/spec/search_builder/sufia/my_shares_search_builder_spec.rb +14 -7
  310. data/spec/search_builder/sufia/single_admin_set_search_builder_spec.rb +17 -0
  311. data/spec/services/sufia/actor_factory_spec.rb +11 -9
  312. data/spec/services/sufia/admin_set_service_spec.rb +27 -0
  313. data/spec/services/sufia/audit_failure_service_spec.rb +1 -1
  314. data/spec/services/sufia/file_set_csv_service_spec.rb +6 -7
  315. data/spec/services/sufia/statistics/system_stats_spec.rb +0 -10
  316. data/spec/services/sufia/user_stat_importer_spec.rb +306 -2
  317. data/spec/spec_helper.rb +43 -4
  318. data/spec/support/backport_test_helpers.rb +19 -0
  319. data/spec/support/selectors.rb +0 -19
  320. data/spec/test_app_templates/Gemfile.extra +1 -0
  321. data/spec/test_app_templates/lib/generators/test_app_generator.rb +0 -2
  322. data/spec/views/_toolbar.html.erb_spec.rb +6 -6
  323. data/spec/views/catalog/_index_list_default.html.erb_spec.rb +10 -1
  324. data/spec/views/catalog/_thumbnail_list_collection.html.erb_spec.rb +10 -0
  325. data/spec/views/citations/work.html.erb_spec.rb +2 -2
  326. data/spec/views/collections/_form_for_select_collection.html.erb_spec.rb +6 -4
  327. data/spec/views/collections/_show_document_list.html.erb_spec.rb +1 -0
  328. data/spec/views/collections/_show_document_list_menu.html.erb_spec.rb +14 -3
  329. data/spec/views/collections/show.html.erb_spec.rb +7 -2
  330. data/spec/views/curation_concerns/base/_attribute_rows.html.erb_spec.rb +19 -0
  331. data/spec/views/curation_concerns/base/_citations.html.erb_spec.rb +2 -2
  332. data/spec/views/curation_concerns/base/_form.html.erb_spec.rb +2 -0
  333. data/spec/views/curation_concerns/base/_form_relationships.html.erb_spec.rb +48 -0
  334. data/spec/views/curation_concerns/base/_items.html.erb_spec.rb +49 -0
  335. data/spec/views/curation_concerns/base/_relationships.html.erb_spec.rb +2 -30
  336. data/spec/views/curation_concerns/base/_show_actions.html.erb_spec.rb +69 -0
  337. data/spec/views/curation_concerns/base/_social_media.html.erb_spec.rb +18 -0
  338. data/spec/views/curation_concerns/file_sets/_permission_form.html.erb_spec.rb +2 -2
  339. data/spec/views/curation_concerns/file_sets/_show_actions.html.erb_spec.rb +18 -3
  340. data/spec/views/curation_concerns/file_sets/media_display/_default.html.erb_spec.rb +26 -0
  341. data/spec/views/dashboard/index_spec.rb +5 -9
  342. data/spec/views/my/_list_collections.html.erb_spec.rb +1 -0
  343. data/spec/views/records/edit_fields/_description.html.erb_spec.rb +66 -0
  344. data/spec/views/stats_file.html.erb_spec.rb +5 -5
  345. data/spec/views/sufia/admin/admin_sets/index.html.erb_spec.rb +27 -0
  346. data/spec/views/{admin/stats/index.html.erb_spec.rb → sufia/admin/stats/show.html.erb_spec.rb} +1 -1
  347. data/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb +3 -1
  348. data/spec/views/sufia/homepage/_featured_works.html.erb_spec.rb +9 -7
  349. data/spec/views/sufia/homepage/{_home_header.html.erb_spec.rb → index.html.erb_spec.rb} +3 -3
  350. data/spec/views/users/_user_util_links.html.erb_spec.rb +1 -1
  351. data/spec/views/users/index.html.erb_spec.rb +2 -1
  352. data/spec/views/users/show.html.erb_spec.rb +5 -1
  353. data/sufia.gemspec +13 -8
  354. data/tasks/controlled_vocabularies.rake +9 -0
  355. data/vendor/assets/stylesheets/sharing_buttons.css +163 -0
  356. metadata +246 -124
  357. data/app/assets/images/old_main_tulips.jpg +0 -0
  358. data/app/assets/javascripts/sufia/fileupload.js +0 -6
  359. data/app/assets/stylesheets/sufia.scss +0 -10
  360. data/app/controllers/admin/stats_controller.rb +0 -3
  361. data/app/controllers/errors_controller.rb +0 -12
  362. data/app/jobs/user_follow_event_job.rb +0 -21
  363. data/app/jobs/user_unfollow_event_job.rb +0 -20
  364. data/app/models/contact_form.rb +0 -28
  365. data/app/models/follow.rb +0 -12
  366. data/app/presenters/file_usage.rb +0 -49
  367. data/app/presenters/sufia/characterization_behavior.rb +0 -80
  368. data/app/presenters/work_usage.rb +0 -51
  369. data/app/views/admin/_menu.html.erb +0 -8
  370. data/app/views/admin/stats/index.html.erb +0 -10
  371. data/app/views/advanced/_advanced_search_facets.html.erb +0 -1
  372. data/app/views/advanced/_advanced_search_fields.html.erb +0 -8
  373. data/app/views/advanced/_advanced_search_form.html.erb +0 -34
  374. data/app/views/advanced/_advanced_search_help.html.erb +0 -13
  375. data/app/views/advanced/_facet_layout.html.erb +0 -5
  376. data/app/views/advanced/_facet_limit.html.erb +0 -7
  377. data/app/views/advanced/index.html.erb +0 -21
  378. data/app/views/collections/_search_collection_dashboard_form.html.erb +0 -11
  379. data/app/views/curation_concerns/base/_relationships_member_rows.html.erb +0 -24
  380. data/app/views/errors/404.html.erb +0 -8
  381. data/app/views/layouts/error.html.erb +0 -27
  382. data/app/views/static/subject_libraries.html.erb +0 -32
  383. data/app/views/sufia/homepage/_home_header.html.erb +0 -13
  384. data/app/views/users/_follower_modal.html.erb +0 -32
  385. data/app/views/users/_following_modal.html.erb +0 -32
  386. data/db/migrate/20160328222155_acts_as_follower_migration.rb +0 -17
  387. data/spec/controllers/my_controller_spec.rb +0 -2
  388. data/spec/jobs/user_follow_event_job_spec.rb +0 -24
  389. data/spec/jobs/user_unfollow_event_job_spec.rb +0 -25
  390. data/spec/lib/sufia/user_stat_importer_spec.rb +0 -309
  391. data/spec/views/catalog/sort_and_per_page.html.erb_spec.rb +0 -33
  392. data/spec/views/users/_follower_modal.html.erb_spec.rb +0 -46
  393. data/spec/views/users/_following_modal.html.erb_spec.rb +0 -55
@@ -2,7 +2,7 @@
2
2
  <% if presenter.trophies.count > 0 %>
3
3
  <table>
4
4
  <% presenter.trophies.each do |t| %>
5
- <tr id="trophyrow_<%= t.id %>">
5
+ <tr id="trophyrow_<%= t.id %>" class='highlighted-works'>
6
6
  <td>
7
7
  <%= link_to t do %>
8
8
  <%= image_tag t.thumbnail_path, width: 90 %>
@@ -1,16 +1,6 @@
1
- <!-- profile and view buttons -->
2
- <% if signed_in? %>
3
- <% if presenter.current_user? %>
4
- <%= link_to sufia.edit_profile_path(@user), class: "btn btn-default" do %>
5
- <i class="glyphicon glyphicon-edit"></i> Edit Your Profile
6
- <% end %>
7
- <% elsif current_user.following?(@user) %>
8
- <%= link_to sufia.unfollow_profile_path(@user), method: :post, class: "btn btn-default" do %>
9
- <i class="glyphicon glyphicon-eye-close"></i> Unfollow
10
- <% end %>
11
- <% else %>
12
- <%= link_to sufia.follow_profile_path(@user), method: :post, class: "btn btn-default" do %>
13
- <i class="glyphicon glyphicon-eye-open"></i> Follow
14
- <% end %>
15
- <% end %>
16
- <% end %>
1
+ <!-- profile and view buttons -->
2
+ <% if signed_in? && presenter.current_user? %>
3
+ <%= link_to sufia.edit_profile_path(@user), class: "btn btn-default" do %>
4
+ <i class="glyphicon glyphicon-edit"></i> Edit Your Profile
5
+ <% end %>
6
+ <% end %>
@@ -16,8 +16,3 @@
16
16
  <li><span class="badge badge-optional"><%= user.total_file_downloads %></span> <%= t("sufia.dashboard.stats.file_downloads").pluralize(user.total_file_downloads) %></li>
17
17
  </ul>
18
18
  </div>
19
-
20
- <div class="list-group-item">
21
- <%= render "users/follower_modal", followers: user.followers, user: user %>
22
- <%= render "users/following_modal", following: user.all_following, user: user %>
23
- </div>
@@ -2,31 +2,31 @@
2
2
  <%= render partial: 'search_form' %>
3
3
  <h1><%= application_name %> Users</h1>
4
4
  </div>
5
- <table class="table table-striped">
6
- <thead>
7
- <tr>
8
- <th>Avatar</th>
5
+ <table class="table table-striped">
6
+ <thead>
7
+ <tr>
8
+ <th>Avatar</th>
9
9
  <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>
10
10
  <th class="sorts"><i id="login" class="<%=params[:sort]== "login desc" ? 'caret' : params[:sort]== "login" ? 'caret up' : ''%>"></i> User Id</th>
11
11
  <th class="sorts"><i id="department" class="<%=params[:sort]== "department desc" ? 'caret' : params[:sort]== "department" ? 'caret up' : ''%>"></i> Department</th>
12
- <th>Files Deposited</th>
13
- </tr>
14
- </thead>
15
- <tbody>
16
- <% @users.each do |user| %>
17
- <tr>
12
+ <th>Works Created</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <% @users.each do |user| %>
17
+ <tr>
18
18
  <td><%= link_to sufia.profile_path(user) do %>
19
- <%= image_tag user.avatar.url(:thumb), width: 30 %>
19
+ <%= image_tag(user.avatar.url(:thumb), width: 30) if user.avatar.file %>
20
20
  <% end %>
21
21
  </td>
22
22
  <td><%= link_to user.name, sufia.profile_path(user) %></td>
23
23
  <td><%= link_to user.user_key, sufia.profile_path(user) %></td>
24
24
  <td><%= user.department %></td>
25
- <td><%= number_of_deposits(user) %></td>
26
- </tr>
27
- <% end %>
28
- </tbody>
29
- </table>
25
+ <td><%= number_of_works(user) %></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+ </table>
30
30
  <div class="pager">
31
31
  <%= paginate @users, theme: 'blacklight', route_set: sufia %>
32
32
  </div>
@@ -0,0 +1,10 @@
1
+ Flipflop.configure do
2
+ # Strategies will be used in the order listed here.
3
+ strategy :cookie
4
+ strategy :active_record, class: Sufia::Feature
5
+ strategy :default
6
+
7
+ feature :assign_admin_set,
8
+ default: true,
9
+ description: "Ability to assign uploaded items to an admin set"
10
+ end
@@ -1,5 +1,13 @@
1
1
  en:
2
2
  sufia:
3
+ admin_sets:
4
+ index:
5
+ header: "Administrative Collections"
6
+ controls:
7
+ home: "Home"
8
+ about: "About"
9
+ help: "Help"
10
+ contact: "Contact"
3
11
  product_name: "Sufia"
4
12
  product_twitter_handle: "@HydraSphere"
5
13
  institution_name: "Institution Name"
@@ -15,7 +23,7 @@ en:
15
23
  view_profile: "View Profile"
16
24
  edit_profile: "Edit Profile"
17
25
  single_use_links:
18
- button: "Single-Use Link to File"
26
+ button: "Single-Use Link to File"
19
27
  expiration_message: "Link %{link} expires %{time}"
20
28
  directory:
21
29
  suffix: "@example.org"
@@ -34,9 +42,6 @@ en:
34
42
  my_collections:
35
43
  label_short: "My Collections"
36
44
  label_long: "My Collections"
37
- my_highlights:
38
- label_short: "My Highlights"
39
- label_long: "My Highlights"
40
45
  my_shares:
41
46
  label_short: "My Shares"
42
47
  label_long: "My Shares"
@@ -58,6 +63,10 @@ en:
58
63
  processing: "File is being processed; you may edit when processing has completed"
59
64
  permissions_message: "Updating file permissions. This may take a few minutes. You may want to refresh your browser or return to this record later to see the updated file permissions."
60
65
  change_permissions_message_html: "<p>You have changed the permissions on this %{curation_concern_human_readable_type}, <i>%{curation_concern}</i>, making it visible to <b>%{visibility_badge}</b>.</p><p>Would you like change all of the files within the %{curation_concern_human_readable_type} to <b>%{visibility_badge}</b> as well?</p>"
66
+ change_access_message_html: "<p>You have changed the access level on work <i>%{curation_concern}</i>, making it accessible to other users or groups to view or edit.</p><p>Would you like change all of the files within the work to have the same access users, groups and visibility as well?</p>"
67
+ change_access_yes_message: "Yes please."
68
+ change_access_no_message: "No. I'll update it manually."
69
+ change_access_flash_message: "Updating file access levels. This may take a few minutes. You may want to refresh your browser or return to this record later to see the updated file acess levels."
61
70
  alert:
62
71
  fail_html: "There was a problem during upload, none of your files uploaded correctly. Please %{reload_href}. Use the %{contact_href} to report the error if it persists."
63
72
  fail_restart_href_text: "start over"
@@ -71,15 +80,22 @@ en:
71
80
  title: 'Featured Works'
72
81
  no_works: 'No works have been featured'
73
82
  drag: 'Drag'
83
+ featured_researcher:
84
+ tab_label: 'Featured Researcher'
85
+ title: 'Featured Researcher'
74
86
  recently_uploaded:
75
87
  depositor: 'Depositor'
76
88
  details: 'Details'
77
89
  tab_label: 'Recently Uploaded'
90
+ title: 'Recently Uploaded'
78
91
  no_public: 'No public work has been contributed.'
92
+ admin_sets:
93
+ link: 'View all administrative collections'
94
+ tab_label: 'Explore Collections'
95
+ title: 'Explore Collections'
79
96
  toolbar:
80
97
  admin:
81
- menu: "Admin"
82
- statistics: "Repository Statistics"
98
+ menu: "Administration"
83
99
  dashboard:
84
100
  menu: "Dashboard"
85
101
  my: "My Dashboard"
@@ -125,13 +141,11 @@ en:
125
141
  file_downloads: "Download"
126
142
  works: "Works created"
127
143
  collections: "Collections created"
128
- following: "People you follow"
129
- followers: "People who are following you"
130
144
  my:
131
145
  works: "My Works"
132
146
  collections: "My Collections"
133
147
  highlights: "My Highlights"
134
- shares: "Files Shared with Me"
148
+ shares: "Works Shared with Me"
135
149
  facet_label:
136
150
  files: "Filter your files"
137
151
  collections: "Filter your collections"
@@ -180,7 +194,7 @@ en:
180
194
  keyword: "could not be updated. You do not have sufficient privileges to edit them."
181
195
  title: "Files failed"
182
196
  subject: "Batch upload permission denied"
183
- background_attribution: "Background image courtesy of Penn State University"
197
+ background_attribution_html: "Background image CC by-nc-sa by <a href=\"https://flic.kr/p/eirxaf\">f2b1610</a>"
184
198
  bread_crumb:
185
199
  search_results: "Back to search results"
186
200
  visibility:
@@ -189,10 +203,6 @@ en:
189
203
  open_title_attr: "Change the visibility of this resource"
190
204
  private_title_attr: "Change the visibility of this resource"
191
205
  user_profile:
192
- no_followers: "No one is following you."
193
- no_following: "You are not following anyone."
194
- no_followers_other: "No one is following this user."
195
- no_following_other: "This user is not following anyone."
196
206
  orcid:
197
207
  alt: "ORCID icon"
198
208
  label: "ORCID Profile"
@@ -278,11 +288,25 @@ en:
278
288
  notifications_deleted: "Notifications have been deleted"
279
289
  file_set:
280
290
  browse_view: "Browse View"
291
+ show:
292
+ download: "Download the file"
281
293
  work:
282
294
  browse_view: "Browse View"
283
295
  footer:
284
296
  copyright_html: "<strong>Copyright &copy; 2016 Project Hydra</strong> Licensed under the Apache License, Version 2.0"
285
297
  admin:
298
+ admin_sets:
299
+ edit:
300
+ header: "Edit Administrative Set"
301
+ new:
302
+ header: "Create New Administrative Set"
303
+ show:
304
+ header: "Administrative Set"
305
+ item_list_header: "Works in This Set"
306
+ sidebar:
307
+ admin_sets: "Administrative Sets"
308
+ settings: "Settings"
309
+ statistics: "Statistics"
286
310
  stats:
287
311
  registered: "Registered"
288
312
  deposited_form:
@@ -307,6 +331,7 @@ en:
307
331
  related_url: "Related URL"
308
332
  files: "Upload a new version of this file from your computer"
309
333
  collection_ids: "Add as member of collection"
334
+ admin_set_id: "Add as member of administrative set"
310
335
  collection:
311
336
  total_items: "Total Items"
312
337
  size: "Size"
@@ -314,14 +339,14 @@ en:
314
339
 
315
340
  hints:
316
341
  generic_work:
317
- resource_type_html: "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."
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."
318
343
  title: "A name to aid in identifying a work."
319
344
  keyword: "Words or phrases you select to describe what the work is about. These are used to search for content."
320
345
  subject: "Headings or index terms describing what the work is about; these do need to conform to an existing vocabulary."
321
- creator_html: "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;."
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;."
322
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."
323
- based_near_html: "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>."
324
- contributor_html: "A person or group you want to recognize for playing a role in the creation of the work, but not the primary role."
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."
325
350
  date_created: "The date on which the work was generated."
326
351
  description: "Free-text notes about the work. Examples include abstracts of a paper or citation information for a journal article."
327
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."
@@ -329,14 +354,14 @@ en:
329
354
  publisher: "The person or group making the work available. Generally this is the institution."
330
355
  rights: "Licensing and distribution information governing access to the work. Select from the provided drop-down list."
331
356
  collection:
332
- resource_type_html: "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."
357
+ 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."
333
358
  title: "A name to aid in identifying a collection."
334
359
  keyword: "Words or phrases you select to describe what the collection is about. These are used to search for content."
335
360
  subject: "Headings or index terms describing what the collection is about; these do need to conform to an existing vocabulary."
336
- creator_html: "The person or group responsible for the collection. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. &quot;Smith, John.&quot;."
361
+ creator: "The person or group responsible for the collection. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. &quot;Smith, John.&quot;."
337
362
  related_url: "A link to a website or other specific content (audio, video, PDF document) related to the collection. An example is the URL of a research project from which the collection was derived."
338
- based_near_html: "A place name related to the collection, such as its site of publication, or the city, state, or country the collection contents are about. Calls upon the <a href='http://www.geonames.org'>GeoNames web service</a>."
339
- contributor_html: "A person or group you want to recognize for playing a role in the creation of the collection, but not the primary role."
363
+ based_near: "A place name related to the collection, such as its site of publication, or the city, state, or country the collection contents are about. Calls upon the <a href='http://www.geonames.org'>GeoNames web service</a>."
364
+ contributor: "A person or group you want to recognize for playing a role in the creation of the collection, but not the primary role."
340
365
  date_created: "The date on which the collection was created."
341
366
  description: "Free-text notes about the collection. Examples include abstracts of a paper or citation information for a journal article."
342
367
  identifier: "A unique handle identifying the collection. An example would be a DOI for a journal article, or an ISBN or OCLC number for a book."
@@ -354,18 +379,35 @@ en:
354
379
  relationships_parent_row_empty:
355
380
  label: "In %{type}:"
356
381
  empty: "There are no %{type} relationships."
357
- relationships_member_rows:
358
- label: "Has related %{type}:"
359
- empty: "This %{type} does not have any related works."
360
382
  metadata:
361
383
  header: Descriptions
362
384
  attribute_name_label: Attribute Name
363
385
  attribute_values_label: Values
386
+ form_files:
387
+ local_upload: Add Local Files
388
+ external_upload: Cloud Providers
389
+ dropzone: "Drop files here."
364
390
  items:
365
391
  header: Items
392
+ thumbnail: Thumbnail
393
+ title: Title
394
+ date_uploaded: "Date Uploaded"
395
+ visibility: Visibility
396
+ actions: Actions
366
397
  empty: "This %{type} has no files associated with it. Click \"edit\" to add more files."
367
398
  citations:
368
399
  header: 'Citations:'
400
+ social_media:
401
+ facebook: 'Facebook'
402
+ twitter: 'Twitter'
403
+ tumblr: 'Tumblr'
404
+ google: 'Google+'
405
+ file_sets:
406
+ groups_description:
407
+ description_html: >
408
+ 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
410
+ within %{application_name}, similarly to adding user access levels.
369
411
  visibility:
370
412
  open:
371
413
  label_html: Public
@@ -384,9 +426,18 @@ en:
384
426
  search:
385
427
  fields:
386
428
  show:
429
+ based_near: Location
430
+ contributor: Contributors
387
431
  keyword: Keyword
388
432
 
389
433
 
390
434
  helpers:
391
435
  action:
436
+ admin_set:
437
+ new: "Create new administrative set"
392
438
  cancel: "Cancel"
439
+ edit: "Edit"
440
+ submit:
441
+ admin_set:
442
+ create: 'Save'
443
+ update: 'Save'
data/config/routes.rb CHANGED
@@ -69,13 +69,8 @@ Sufia::Engine.routes.draw do
69
69
  end
70
70
  end
71
71
 
72
- # User profile & follows
73
- resources :users, only: [:index, :show, :edit, :update], as: :profiles do
74
- member do
75
- post 'follow' => 'users#follow'
76
- post 'unfollow' => 'users#unfollow'
77
- end
78
- end
72
+ # User profile
73
+ resources :users, only: [:index, :show, :edit, :update], as: :profiles
79
74
 
80
75
  resources :users, only: [] do
81
76
  resources :operations, only: [:index, :show], controller: 'sufia/operations'
@@ -115,9 +110,6 @@ Sufia::Engine.routes.draw do
115
110
  get '/shares/facet/:id', controller: 'my/shares', action: :facet, as: 'dashboard_shares_facet'
116
111
  end
117
112
 
118
- # advanced routes for advanced search
119
- get 'search' => 'advanced#index', as: :advanced
120
-
121
113
  # Contact form routes
122
114
  post 'contact' => 'contact_form#create', as: :contact_form_index
123
115
  get 'contact' => 'contact_form#new'
@@ -128,6 +120,8 @@ Sufia::Engine.routes.draw do
128
120
  member do
129
121
  get :confirm
130
122
  post :copy
123
+ get :confirm_access
124
+ post :copy_access
131
125
  end
132
126
  end
133
127
  end
@@ -146,8 +140,15 @@ Sufia::Engine.routes.draw do
146
140
  end
147
141
  end
148
142
 
149
- namespace :admin do
150
- get 'stats' => 'stats#index', as: :stats
143
+ resources :admin_sets, controller: 'sufia/admin_sets'
144
+
145
+ resource :admin, controller: 'sufia/admin', only: [:show]
146
+ scope 'admin', module: 'sufia/admin', as: 'admin' do
147
+ resources :admin_sets
148
+ resource 'stats', only: [:show]
149
+ resources :features, only: [:index] do
150
+ resources :strategies, only: [:update, :destroy]
151
+ end
151
152
  end
152
153
 
153
154
  resources :content_blocks, only: ['create', 'update']
@@ -155,11 +156,9 @@ Sufia::Engine.routes.draw do
155
156
  post '/tinymce_assets' => 'tinymce_assets#create'
156
157
 
157
158
  get 'about' => 'pages#show', id: 'about_page'
158
- # Static page routes (workaround)
159
- get ':action' => 'static#:action', constraints: { action: /help|terms|zotero|mendeley|agreement|subject_libraries|versions/ }, as: :static
160
159
 
161
- # Catch-all (for routing errors)
162
- unless Rails.env.development? || Rails.env.test?
163
- match '*error' => 'errors#routing', via: [:get, :post]
160
+ # Static page routes
161
+ %w(help terms zotero mendeley agreement versions).each do |action|
162
+ get action, controller: 'static', action: action, as: action
164
163
  end
165
164
  end
@@ -0,0 +1,10 @@
1
+ class CreateFeatures < ActiveRecord::Migration
2
+ def change
3
+ create_table :sufia_features do |t|
4
+ t.string :key, null: false
5
+ t.boolean :enabled, null: false, default: false
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -20,6 +20,7 @@ module Sufia
20
20
  8. Installs hydra:batch_edit
21
21
  9. Updates simple_form to use browser validations
22
22
  10. Installs Blacklight gallery (and removes it's scss)
23
+ 11. Runs the jquery-datatables generator
23
24
  """
24
25
 
25
26
  def banner
@@ -40,15 +41,16 @@ module Sufia
40
41
  end
41
42
 
42
43
  # Add behaviors to the user model
43
- def inject_sufia_user_behavior
44
+ def inject_sufia_user_behaviors
44
45
  file_path = "app/models/#{model_name.underscore}.rb"
45
46
  if File.exist?(file_path)
46
47
  inject_into_file file_path, after: /include CurationConcerns\:\:User.*$/ do
47
48
  "\n # Connects this user object to Sufia behaviors." \
48
- "\n include Sufia::User\n"
49
+ "\n include Sufia::User" \
50
+ "\n include Sufia::UserUsageStats\n"
49
51
  end
50
52
  else
51
- puts " \e[31mFailure\e[0m Sufia requires a user object. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g sufia client"
53
+ puts " \e[31mFailure\e[0m Sufia requires a user object. This generators assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails -g sufia:install client"
52
54
  end
53
55
  end
54
56
 
@@ -66,25 +68,6 @@ module Sufia
66
68
  copy_file 'config/analytics.yml', 'config/analytics.yml'
67
69
  end
68
70
 
69
- def solr_config
70
- say_status("info", "GENERATING SUFIA FULL-TEXT", :blue)
71
- source = File.expand_path("../../../../solr/config/solrconfig.xml", __FILE__)
72
- copy_file source, 'solr/conf/solrconfig.xml', force: true
73
- end
74
-
75
- # Adds user stats-related methods
76
- def user_stats
77
- file_path = "app/models/#{model_name.underscore}.rb"
78
-
79
- if File.exist?(file_path)
80
- inject_into_file file_path, after: /include Sufia\:\:User.*$/ do
81
- "\n include Sufia::UserUsageStats"
82
- end
83
- else
84
- puts " \e[31mFailure\e[0m Sufia requires a user object. This generator assumes that the model is defined in the file #{file_path}, which does not exist. If you used a different name, please re-run the generator and provide that name as an argument. Such as \b rails g sufia:user_stats client"
85
- end
86
- end
87
-
88
71
  def insert_abilities
89
72
  insert_into_file 'app/models/ability.rb', after: /CurationConcerns::Ability/ do
90
73
  "\n include Sufia::Ability\n"
@@ -104,12 +87,6 @@ module Sufia
104
87
  end
105
88
  end
106
89
 
107
- def use_blacklight_layout_theme
108
- file_path = "app/controllers/application_controller.rb"
109
- return unless File.exist?(file_path)
110
- gsub_file file_path, /with_themed_layout '1_column'/, "layout 'sufia-one-column'"
111
- end
112
-
113
90
  def catalog_controller
114
91
  copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb"
115
92
  end
@@ -122,12 +99,7 @@ module Sufia
122
99
  def inject_routes
123
100
  gsub_file 'config/routes.rb', /root (:to =>|to:) "catalog#index"/, ''
124
101
  gsub_file 'config/routes.rb', /'welcome#index'/, "'sufia/homepage#index'" # Replace the root path injected by CurationConcerns
125
-
126
- routing_code = "\n Hydra::BatchEdit.add_routes(self)\n" \
127
- " # This must be the very last route in the file because it has a catch-all route for 404 errors.\n" \
128
- " # This behavior seems to show up only in production mode.\n" \
129
- " mount Sufia::Engine => '/'\n"
130
-
102
+ routing_code = "\n mount Sufia::Engine => '/'\n"
131
103
  sentinel = /end\Z/
132
104
  inject_into_file 'config/routes.rb', routing_code, before: sentinel, verbose: false
133
105
  end
@@ -169,5 +141,9 @@ module Sufia
169
141
  # includes to sufia.scss
170
142
  remove_file 'app/assets/stylesheets/blacklight_gallery.css.scss'
171
143
  end
144
+
145
+ def datatables
146
+ generate 'jquery:datatables:install bootstrap3'
147
+ end
172
148
  end
173
149
  end