curate 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (250) hide show
  1. data/LICENSE +14 -0
  2. data/app/controllers/application_controller.rb +69 -0
  3. data/app/controllers/catalog_controller.rb +336 -0
  4. data/app/controllers/classify_concerns_controller.rb +29 -0
  5. data/app/controllers/common_objects_controller.rb +27 -0
  6. data/app/controllers/curation_concern/base_controller.rb +26 -0
  7. data/app/controllers/curation_concern/generic_files_controller.rb +82 -0
  8. data/app/controllers/dashboard_controller.rb +85 -0
  9. data/app/controllers/downloads_controller.rb +22 -0
  10. data/app/controllers/errors_controller.rb +19 -0
  11. data/app/controllers/help_requests_controller.rb +38 -0
  12. data/app/controllers/terms_of_service_agreements_controller.rb +44 -0
  13. data/app/controllers/welcome_controller.rb +14 -0
  14. data/app/helpers/application_helper.rb +89 -0
  15. data/app/helpers/blacklight_helper.rb +19 -0
  16. data/app/helpers/common_objects_helper.rb +5 -0
  17. data/app/inputs/multi_value_input.rb +71 -0
  18. data/app/models/access_right.rb +53 -0
  19. data/app/models/classify_concern.rb +30 -0
  20. data/app/models/contributor_agreement.rb +58 -0
  21. data/app/models/digital_object_identifier.rb +83 -0
  22. data/app/models/doi_config.rb +26 -0
  23. data/app/models/help_request.rb +34 -0
  24. data/app/models/mint_doi.rb +51 -0
  25. data/app/models/mint_purl.rb +40 -0
  26. data/app/models/object_access.rb +17 -0
  27. data/app/models/purl.rb +18 -0
  28. data/app/models/purl_config.rb +10 -0
  29. data/app/models/repo_object.rb +24 -0
  30. data/app/models/solr_document.rb +35 -0
  31. data/app/repository_datastreams/file_content_datastream.rb +36 -0
  32. data/app/repository_models/curation_concern/embargoable.rb +43 -0
  33. data/app/repository_models/curation_concern/with_access_right.rb +31 -0
  34. data/app/repository_models/generic_file.rb +36 -0
  35. data/app/services/anti_virus_scanner.rb +28 -0
  36. data/app/services/curation_concern.rb +22 -0
  37. data/app/services/curation_concern/base_actor.rb +48 -0
  38. data/app/services/curation_concern/generic_file_actor.rb +38 -0
  39. data/app/validators/future_date_validator.rb +19 -0
  40. data/app/views/_footer.html.erb +19 -0
  41. data/app/views/_ga.html.erb +6 -0
  42. data/app/views/_logo.html.erb +34 -0
  43. data/app/views/_masthead.html.erb +34 -0
  44. data/app/views/catalog/_bookmark_control.html.erb +25 -0
  45. data/app/views/catalog/_bookmark_form.html.erb +8 -0
  46. data/app/views/catalog/_citation.html.erb +11 -0
  47. data/app/views/catalog/_constraints.html.erb +6 -0
  48. data/app/views/catalog/_constraints_element.html.erb +20 -0
  49. data/app/views/catalog/_delete_partials/_default.html.erb +29 -0
  50. data/app/views/catalog/_did_you_mean.html.erb +10 -0
  51. data/app/views/catalog/_document.html.erb +19 -0
  52. data/app/views/catalog/_document_list.html.erb +2 -0
  53. data/app/views/catalog/_edit_partials/_default.html.erb +58 -0
  54. data/app/views/catalog/_edit_partials/_default_details.html.erb +13 -0
  55. data/app/views/catalog/_email_form.html.erb +11 -0
  56. data/app/views/catalog/_facet_layout.html.erb +12 -0
  57. data/app/views/catalog/_facet_limit.html.erb +19 -0
  58. data/app/views/catalog/_facet_selected.html.erb +12 -0
  59. data/app/views/catalog/_facets.html.erb +5 -0
  60. data/app/views/catalog/_folder_control.html.erb +12 -0
  61. data/app/views/catalog/_home.html.erb +2 -0
  62. data/app/views/catalog/_home_text.html.erb +10 -0
  63. data/app/views/catalog/_index_default.html.erb +11 -0
  64. data/app/views/catalog/_index_partials/_default_group.html.erb +37 -0
  65. data/app/views/catalog/_marc_view.html.erb +33 -0
  66. data/app/views/catalog/_opensearch_response_metadata.html.erb +2 -0
  67. data/app/views/catalog/_previous_next_doc.html.erb +6 -0
  68. data/app/views/catalog/_refworks_form.html.erb +7 -0
  69. data/app/views/catalog/_results_pagination.html.erb +6 -0
  70. data/app/views/catalog/_search_form.html.erb +20 -0
  71. data/app/views/catalog/_show_default.html.erb +9 -0
  72. data/app/views/catalog/_show_partials/_default.html.erb +22 -0
  73. data/app/views/catalog/_show_partials/_default_details.html.erb +15 -0
  74. data/app/views/catalog/_show_partials/_facets.html.erb +52 -0
  75. data/app/views/catalog/_show_sidebar.html.erb +1 -0
  76. data/app/views/catalog/_show_tools.html.erb +46 -0
  77. data/app/views/catalog/_sms_form.html.erb +21 -0
  78. data/app/views/catalog/_sort_and_per_page.html.erb +38 -0
  79. data/app/views/catalog/_uva_tabs.html.erb +10 -0
  80. data/app/views/catalog/about.html.erb +0 -0
  81. data/app/views/catalog/citation.html.erb +1 -0
  82. data/app/views/catalog/email.erb +1 -0
  83. data/app/views/catalog/endnote.endnote.erb +1 -0
  84. data/app/views/catalog/index.atom.builder +109 -0
  85. data/app/views/catalog/index.html.erb +55 -0
  86. data/app/views/catalog/index.rss.builder +19 -0
  87. data/app/views/catalog/librarian_view.html.erb +3 -0
  88. data/app/views/catalog/opensearch.json.erb +0 -0
  89. data/app/views/catalog/opensearch.xml.builder +10 -0
  90. data/app/views/catalog/send_email_record.erb +0 -0
  91. data/app/views/catalog/show.endnote.erb +1 -0
  92. data/app/views/catalog/show.html.erb +40 -0
  93. data/app/views/catalog/show.refworks.erb +1 -0
  94. data/app/views/catalog/sms.erb +1 -0
  95. data/app/views/classify_concerns/new.html.erb +24 -0
  96. data/app/views/common_objects/_generic_file.html.erb +0 -0
  97. data/app/views/common_objects/_senior_thesis.html.erb +2 -0
  98. data/app/views/common_objects/show.html.erb +11 -0
  99. data/app/views/common_objects/show_stub_information.html.erb +13 -0
  100. data/app/views/curation_concern/_content_license.html.erb +16 -0
  101. data/app/views/curation_concern/_contributor_agreement.html.erb +27 -0
  102. data/app/views/curation_concern/_doi.html.erb +43 -0
  103. data/app/views/curation_concern/_media_display.html.erb +1 -0
  104. data/app/views/curation_concern/_permission.html.erb +39 -0
  105. data/app/views/curation_concern/_related_files.html.erb +46 -0
  106. data/app/views/curation_concern/generic_files/_attributes.html.erb +63 -0
  107. data/app/views/curation_concern/generic_files/_form.html.erb +57 -0
  108. data/app/views/curation_concern/generic_files/edit.html.erb +5 -0
  109. data/app/views/curation_concern/generic_files/new.html.erb +5 -0
  110. data/app/views/curation_concern/generic_files/show.html.erb +12 -0
  111. data/app/views/curation_concern/senior_theses/_attributes.html.erb +13 -0
  112. data/app/views/curation_concern/senior_theses/_form.html.erb +88 -0
  113. data/app/views/curation_concern/senior_theses/edit.html.erb +15 -0
  114. data/app/views/curation_concern/senior_theses/new.html.erb +14 -0
  115. data/app/views/curation_concern/senior_theses/show.html.erb +18 -0
  116. data/app/views/dashboard/_constraints.html.erb +22 -0
  117. data/app/views/dashboard/_did_you_mean.html.erb +26 -0
  118. data/app/views/dashboard/_document_list.html.erb +20 -0
  119. data/app/views/dashboard/_facet_layout.html.erb +27 -0
  120. data/app/views/dashboard/_facet_limit.html.erb +35 -0
  121. data/app/views/dashboard/_facet_pagination.html.erb +25 -0
  122. data/app/views/dashboard/_facet_selected.html.erb +28 -0
  123. data/app/views/dashboard/_facets.html.erb +22 -0
  124. data/app/views/dashboard/_index_partials/_default_group.html.erb +37 -0
  125. data/app/views/dashboard/_index_partials/_list_files.html.erb +66 -0
  126. data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +0 -0
  127. data/app/views/dashboard/_results_pagination.html.erb +22 -0
  128. data/app/views/dashboard/_search_form.html.erb +36 -0
  129. data/app/views/dashboard/_show_partials/_default.html.erb +38 -0
  130. data/app/views/dashboard/_show_partials/_default_details.html.erb +31 -0
  131. data/app/views/dashboard/_show_partials/_facets.html.erb +103 -0
  132. data/app/views/dashboard/_sort_and_per_page.html.erb +18 -0
  133. data/app/views/dashboard/facet.html.erb +38 -0
  134. data/app/views/dashboard/get_related_file.html.erb +4 -0
  135. data/app/views/dashboard/index.html.erb +60 -0
  136. data/app/views/errors/401.html.erb +5 -0
  137. data/app/views/errors/404.html.erb +16 -0
  138. data/app/views/errors/500.html.erb +10 -0
  139. data/app/views/help_requests/new.html.erb +60 -0
  140. data/app/views/layouts/application.html.erb +14 -0
  141. data/app/views/layouts/boilerplate.html.erb +28 -0
  142. data/app/views/layouts/common_objects.html.erb +45 -0
  143. data/app/views/layouts/curate_nd.html.erb +55 -0
  144. data/app/views/layouts/curate_nd/1_column.html.erb +22 -0
  145. data/app/views/layouts/curate_nd/2_column.html.erb +26 -0
  146. data/app/views/layouts/curate_nd/catalog.html.erb +22 -0
  147. data/app/views/layouts/curate_nd/dashboard.html.erb +22 -0
  148. data/app/views/layouts/hydra-head.html.erb +95 -0
  149. data/app/views/shared/_action_bar.html.erb +30 -0
  150. data/app/views/shared/_flash_message.html.erb +9 -0
  151. data/app/views/shared/_site_search.html.erb +18 -0
  152. data/app/views/terms_of_service_agreements/new.html.erb +136 -0
  153. data/app/views/welcome/index.html.erb +21 -0
  154. data/app/workers/characterize_job.rb +4 -0
  155. data/app/workers/doi_worker.rb +16 -0
  156. data/config/routes.rb +35 -0
  157. data/lib/curate.rb +6 -0
  158. data/lib/curate/engine.rb +46 -0
  159. data/lib/curate/version.rb +1 -1
  160. data/spec/abilities/generic_file_abilities_spec.rb +55 -0
  161. data/spec/controllers/application_controller_spec.rb +38 -0
  162. data/spec/controllers/classify_concerns_controller_spec.rb +36 -0
  163. data/spec/controllers/common_objects_controller_spec.rb +112 -0
  164. data/spec/controllers/curation_concern/base_controller_spec.rb +14 -0
  165. data/spec/controllers/curation_concern/generic_files_controller_spec.rb +156 -0
  166. data/spec/controllers/dashboard_controller_spec.rb +85 -0
  167. data/spec/controllers/downloads_controller_spec.rb +42 -0
  168. data/spec/controllers/help_requests_controller_spec.rb +42 -0
  169. data/spec/controllers/terms_of_service_agreements_controller_spec.rb +30 -0
  170. data/spec/controllers/welcome_controller_spec.rb +10 -0
  171. data/spec/dummy/app/models/solr_document.rb +4 -0
  172. data/spec/dummy/app/models/user.rb +13 -0
  173. data/spec/dummy/config/application.rb +8 -1
  174. data/spec/dummy/config/database.yml +21 -22
  175. data/spec/dummy/config/doi.yml +11 -0
  176. data/spec/dummy/config/fedora.yml +20 -0
  177. data/spec/dummy/config/initializers/devise.rb +232 -0
  178. data/spec/dummy/config/initializers/hydra_config.rb +41 -0
  179. data/spec/dummy/config/initializers/mailboxer.rb +17 -0
  180. data/spec/dummy/config/initializers/redis_config.rb +45 -0
  181. data/spec/dummy/config/initializers/sufia.rb +66 -0
  182. data/spec/dummy/config/purl.yml +15 -0
  183. data/spec/dummy/config/redis.yml +6 -0
  184. data/spec/dummy/config/role_map_ci.yml +15 -0
  185. data/spec/dummy/config/role_map_cucumber.yml +10 -0
  186. data/spec/dummy/config/role_map_development.yml +12 -0
  187. data/spec/dummy/config/role_map_pre_production.yml +2 -0
  188. data/spec/dummy/config/role_map_production.yml +2 -0
  189. data/spec/dummy/config/role_map_test.yml +15 -0
  190. data/spec/dummy/config/routes.rb +4 -55
  191. data/spec/dummy/config/solr.yml +17 -0
  192. data/spec/dummy/db/migrate/20130130142162_create_purl.rb +55 -0
  193. data/spec/dummy/db/migrate/20130312135359_create_help_requests.rb +22 -0
  194. data/spec/dummy/db/migrate/20130408165008_create_users.rb +11 -0
  195. data/spec/dummy/db/migrate/20130408165009_acts_as_follower_migration.rb +31 -0
  196. data/spec/dummy/db/migrate/20130408165010_add_social_to_users.rb +27 -0
  197. data/spec/dummy/db/migrate/20130408165011_create_single_use_links.rb +12 -0
  198. data/spec/dummy/db/migrate/20130408165012_add_ldap_attrs_to_user.rb +41 -0
  199. data/spec/dummy/db/migrate/20130408165013_add_avatars_to_users.rb +23 -0
  200. data/spec/dummy/db/migrate/20130408165014_create_checksum_audit_logs.rb +34 -0
  201. data/spec/dummy/db/migrate/20130408165015_create_version_committers.rb +29 -0
  202. data/spec/dummy/db/migrate/20130408165016_add_groups_to_users.rb +25 -0
  203. data/spec/dummy/db/migrate/20130408165017_create_local_authorities.rb +64 -0
  204. data/spec/dummy/db/migrate/20130408165018_create_trophies.rb +10 -0
  205. data/spec/dummy/db/migrate/20130408165022_create_mailboxer.mailboxer_engine.rb +62 -0
  206. data/spec/dummy/db/migrate/20130408165023_add_notified_object.mailboxer_engine.rb +18 -0
  207. data/spec/dummy/db/migrate/20130408165024_add_notification_code.mailboxer_engine.rb +14 -0
  208. data/spec/dummy/db/migrate/20130408165025_add_attachments.mailboxer_engine.rb +10 -0
  209. data/spec/dummy/db/migrate/20130408165026_rename_receipts_read.mailboxer_engine.rb +10 -0
  210. data/spec/dummy/db/schema.rb +197 -0
  211. data/spec/dummy/db/test.sqlite3 +0 -0
  212. data/spec/dummy/fedora_conf/conf/development/fedora.fcfg +953 -0
  213. data/spec/dummy/fedora_conf/conf/test/fedora.fcfg +953 -0
  214. data/spec/dummy/log/development.log +1791 -0
  215. data/spec/dummy/log/test.log +176333 -0
  216. data/spec/dummy/solr_conf/conf/schema.xml +692 -0
  217. data/spec/dummy/solr_conf/conf/solrconfig.xml +299 -0
  218. data/spec/dummy/solr_conf/solr.xml +35 -0
  219. data/spec/factories/create_curation_concern.rb +11 -0
  220. data/spec/factories/create_generic_file.rb +36 -0
  221. data/spec/factories/help_requests.rb +10 -0
  222. data/spec/factories/mock_curation_concerns.rb +4 -0
  223. data/spec/factories/users.rb +8 -0
  224. data/spec/helpers/application_helper_spec.rb +139 -0
  225. data/spec/helpers/common_objects_helper_spec.rb +9 -0
  226. data/spec/models/access_right_spec.rb +47 -0
  227. data/spec/models/classify_concern_spec.rb +30 -0
  228. data/spec/models/contributor_agreement_spec.rb +45 -0
  229. data/spec/models/digital_object_identifier_spec.rb +50 -0
  230. data/spec/models/help_request_spec.rb +5 -0
  231. data/spec/models/mint_doi_spec.rb +79 -0
  232. data/spec/models/mint_purl_spec.rb +38 -0
  233. data/spec/models/object_access_spec.rb +24 -0
  234. data/spec/models/purl_spec.rb +22 -0
  235. data/spec/models/repo_object_spec.rb +39 -0
  236. data/spec/repository_models/curation_concern/embargoable_spec.rb +69 -0
  237. data/spec/repository_models/generic_file_spec.rb +38 -0
  238. data/spec/services/anti_virus_scanner_spec.rb +26 -0
  239. data/spec/services/curation_concern/base_actor_spec.rb +28 -0
  240. data/spec/services/curation_concern/generic_file_actor_spec.rb +75 -0
  241. data/spec/services/curation_concern_spec.rb +34 -0
  242. data/spec/spec_helper.rb +54 -1
  243. data/spec/support/environment_override.rb +17 -0
  244. data/spec/support/matchers/raise_rescue_response_type_matcher.rb +42 -0
  245. data/spec/support/mock_curation_concern.rb +61 -0
  246. data/spec/support/shared/shared_examples_is_embargoable.rb +9 -0
  247. data/spec/support/shared/shared_examples_with_access_rights.rb +33 -0
  248. data/spec/workers/characterize_job_spec.rb +26 -0
  249. metadata +686 -10
  250. data/MIT-LICENSE +0 -20
@@ -0,0 +1,19 @@
1
+ xml.instruct! :xml, :version=>"1.0"
2
+ xml.rss(:version=>"2.0") {
3
+
4
+ xml.channel {
5
+
6
+ xml.title(application_name + " Search Results")
7
+ xml.link(catalog_index_url(params))
8
+ xml.description(application_name + " Search Results")
9
+ xml.language('en-us')
10
+ @document_list.each do |doc|
11
+ xml.item do
12
+ xml.title( doc.to_semantic_values[:title][0] || doc.id )
13
+ xml.link(catalog_url(doc[:id]))
14
+ xml.author( doc.to_semantic_values[:author][0] ) if doc.to_semantic_values[:author][0]
15
+ end
16
+ end
17
+
18
+ }
19
+ }
@@ -0,0 +1,3 @@
1
+ <%- if @document.respond_to?(:to_marc) -%>
2
+ <%= render "marc_view" %>
3
+ <%- end -%>
File without changes
@@ -0,0 +1,10 @@
1
+ xml.instruct! :xml, :version=>'1.0'
2
+ xml.OpenSearchDescription(:xmlns=>'http://a9.com/-/spec/opensearch/1.1/') {
3
+ xml.ShortName application_name
4
+ xml.Description "#{application_name} Search"
5
+ xml.Image "#{asset_url('favicon.ico')}", :height=>16, :width=>16, :type=>'image/x-icon'
6
+ xml.Contact
7
+ xml.Url :type=>'text/html', :method=>'get', :template=>"#{url_for :controller=>'catalog', :only_path => false}?q={searchTerms}"
8
+ xml.Url :type=>'application/rss+xml', :method=>'get', :template=>"#{url_for :controller=>'catalog', :only_path => false}.rss?q={searchTerms}"
9
+ xml.Url :type=>'application/x-suggestions+json', :method=>'get', :template=>"#{url_for :controller=>'catalog',:action => 'opensearch', :format=> 'json', :only_path => false}?q={searchTerms}"
10
+ }
@@ -0,0 +1 @@
1
+ <%= render_endnote_text(@document) %>
@@ -0,0 +1,40 @@
1
+ <%-
2
+ doc_title = document_show_html_title.blank? ? @document[:id] : document_show_html_title.first
3
+ @page_title = "#{doc_title} - #{application_name}"
4
+ -%>
5
+ <div id="showHead">
6
+ <div id="showUtils">
7
+ <span class="back_to_cat"><%= link_back_to_catalog :label=>'← Return to search results' %></span>
8
+ <%- if @previous_document || @next_document -%>
9
+ <div id="previousNextDocument">
10
+ <span class="previous"><%= link_to_previous_document(@previous_document) %></span>
11
+ <%- end -%>
12
+ <%- if session[:search][:counter].to_i > 0 -%>
13
+ <span class="result-num">
14
+ <%= session[:search][:counter].to_i %> of <%= format_num(session[:search][:total]) %>
15
+ </span>
16
+ <%- end -%>
17
+ <%- if @previous_document || @next_document -%>
18
+ <span class="next"><%= link_to_next_document(@next_document)%></span>
19
+ </div>
20
+ <%- end -%>
21
+ <%- if editor? && controller.action_name != "delete" -%>
22
+ <span class="edit-browse">
23
+ <%= edit_and_browse_links %>
24
+ </span>
25
+ <%- end -%>
26
+ </div>
27
+ </div>
28
+ <div id="document" class="<%= controller.action_name == "edit" ? "document_edit" : "document_show" %> <%= "combined_document_view" if session[:scripts] %>">
29
+ <div id="<%= format_pid(@document[:id]) %>">
30
+ <%= "<h1>Add Your Work</h1>".html_safe if controller.action_name == "edit" %>
31
+ <div class="document">
32
+ <%= render_document_partial @document, params["action"] %>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ <% if controller.action_name == "edit" %>
37
+ <div class="delete-asset">
38
+ <%= button_to("Delete This Item", {:action => :destroy, :controller => :assets, :id => @document_fedora.pid}, :confirm => 'Are you sure?', :method => :delete )%>
39
+ </div>
40
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= render_refworks_text(@document) %>
@@ -0,0 +1 @@
1
+ <%= render :partial => 'sms_form' %>
@@ -0,0 +1,24 @@
1
+ <% content_for :page_header do %>
2
+
3
+ <h2>What are you uploading?</h2>
4
+ <p>Before we can begin we need to know a little about what you're uploading.</p>
5
+
6
+ <% end %>
7
+
8
+ <%= simple_form_for classify_concern do |f| %>
9
+ <fieldset>
10
+ <legend>Describe Your Files</legend>
11
+
12
+ <%= f.input :curation_concern_type,
13
+ as: :select,
14
+ collection: classify_concern.possible_curation_concern_types,
15
+ label: "What are you uploading?"
16
+ %>
17
+
18
+ <div class="form-actions">
19
+ <%= f.submit('Continue', class: "btn btn-primary") %>
20
+ <%= link_to 'Cancel', dashboard_index_path, class: "btn btn-link" %>
21
+ </div>
22
+
23
+ </fieldset>
24
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= render 'curation_concern/senior_theses/attributes', curation_concern: curation_concern %>
2
+ <%= render 'curation_concern/related_files', curation_concern: curation_concern, with_actions: false %>
@@ -0,0 +1,11 @@
1
+ <% content_for :page_header do %>
2
+ <h1><%= curation_concern %><span class="human_readable_type">(<%= curation_concern.human_readable_type %>)</span></h1>
3
+ <% end %>
4
+
5
+ <%= render common_object_partial_for(curation_concern) %>
6
+
7
+ <% if can?(:edit, curation_concern) %>
8
+ <div class="form-actions">
9
+ <%= link_to %(Edit #{curation_concern}), edit_polymorphic_path([:curation_concern, curation_concern]), class: 'btn btn-primary' %>
10
+ </div>
11
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <% content_for :page_header do %>
2
+ <h1>Object Not Available</h1>
3
+ <% end %>
4
+ <% if curation_concern.identifier %>
5
+ <p><%= curation_concern %> is presently not available.</p>
6
+ <p>Digital Object Identifier (DOI): <%= curation_concern.identifier %></p>
7
+ <% else %>
8
+ <p>This object is presently not available.</p>
9
+ <%- end -%>
10
+
11
+ <div class="form-actions">
12
+ <%= link_to "Login", new_user_session_path, class: 'btn btn-primary' %>
13
+ </div>
@@ -0,0 +1,16 @@
1
+ <fieldset>
2
+ <legend>Choose a Licence for your Content</legend>
3
+ <p>
4
+ What do you want others to be able to do with your work?
5
+ </p>
6
+ <p>
7
+ <a href="http://creativecommons.org/licenses/" target="_blank">Here's some help</a> if you don't know which licence to choose.
8
+ </p>
9
+
10
+ <%= f.input :rights,
11
+ as: :select,
12
+ collection: Sufia::Engine::config.cc_licenses,
13
+ input_html: { class: 'input-xxxlarge' },
14
+ label: 'Content License'
15
+ %>
16
+ </fieldset>
@@ -0,0 +1,27 @@
1
+ <% unless curation_concern.persisted? %>
2
+ <fieldset class="row contributor_agreement with-headroom">
3
+ <div class="span12">
4
+ <legend>
5
+ CurateND Content Submission Terms
6
+ </legend>
7
+ </div>
8
+
9
+ <div class="span12">
10
+ <article class="lawyer_readable contributor_agreement wide-text">
11
+ <%= contributor_agreement.legally_binding_text.html_safe %>
12
+ </article>
13
+ </div>
14
+
15
+ <div class="span12">
16
+ <%= label_tag contributor_agreement.param_key, class: 'checkbox' do %>
17
+ <%= check_box_tag(
18
+ contributor_agreement.param_key,
19
+ contributor_agreement.acceptance_value,
20
+ contributor_agreement.param_value
21
+ )
22
+ %>
23
+ I have read and accept the contributor licence agreement
24
+ <% end %>
25
+ </div>
26
+ </fieldset>
27
+ <%- end -%>
@@ -0,0 +1,43 @@
1
+ <%- if curation_concern.identifier.present? -%>
2
+ <%# Please forgive this questionably semantic markup -- it should just _look_ the same as a legend/fieldset %>
3
+ <fieldset>
4
+ <legend>Digital Object Identifier</legend>
5
+ <p>
6
+ This
7
+ <%= classify_for_display(curation_concern) %>
8
+ has a <abbr title="Digital Object Identifier">DOI</abbr>.
9
+ </p>
10
+ <p class="doi centered">
11
+ <%# TODO: Include a link to the _actual_ DOI. %>
12
+ <a href="<%= curation_concern.doi_url %>"><%= curation_concern.doi_url %></a>
13
+ </p>
14
+ <p>
15
+ This <abbr title="Digital Object Identifier">DOI</abbr> link is the best way for others to cite your work.
16
+ </p>
17
+ </fieldset>
18
+ <%- else -%>
19
+ <fieldset class="promote promote-doi">
20
+ <legend>
21
+ Assign a Digital Object Identifier (DOI)
22
+ </legend>
23
+
24
+ <p>
25
+ A <abbr title="Digital Object Identifier">DOI</abbr> is a permanent link to your
26
+ <%= classify_for_display(curation_concern) %>.
27
+ It's an easy way for other people to cite your work.
28
+ </p>
29
+ <p>
30
+ Want more information on <abbr title="Digital Object Identifier">DOI</abbr>s?
31
+ Here's a <a href="http://simple.wikipedia.org/wiki/Doi" target="_blank">brief summary</a> and the <a href="http://www.doi.org/faq.html" target="_blank">DOI FAQ</a>.
32
+ </p>
33
+
34
+ <%= f.label :assign_doi, class: 'label label-success label-large label-checkbox' do %>
35
+ <%= f.check_box :assign_doi %>
36
+ <span class="label-text">
37
+ Yes, I would like to assign this
38
+ <%= classify_for_display(curation_concern) %>
39
+ a <abbr title="Digital Object Identifier">DOI</abbr>.
40
+ </span>
41
+ <% end %>
42
+ </fieldset>
43
+ <%- end -%>
@@ -0,0 +1 @@
1
+ <%= link_to 'Download', download_path(generic_file.noid),{class: 'btn', title: "Download #{generic_file.to_s.inspect}", :target => "_blank"}%>
@@ -0,0 +1,39 @@
1
+ <div id="permissions_display">
2
+ <fieldset class="control-group">
3
+ <legend>
4
+ Embargo Date
5
+ <small>When to release it for public viewing</small>
6
+ </legend>
7
+ <p class="help-block">
8
+ Need to provide some help text
9
+ </p>
10
+ <%= f.input :embargo_release_date, as: :string, input_html: { class: 'datepicker' } %>
11
+ </fieldset>
12
+
13
+ <fieldset class="control-group">
14
+ <legend>
15
+ Access Rights
16
+ <small>Applied to the attached files and their metadata</small>
17
+ </legend>
18
+
19
+ <p class="help-block">
20
+ Who should be able to read and download your files?
21
+ </p>
22
+
23
+ <div class="controls">
24
+ <label class="radio">
25
+ <input type="radio" id="visibility_open" name="<%= f.object_name %>[visibility]" value="<%= AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC %>" <% if curation_concern.open_access? %> checked="true"<% end %>/>
26
+ <span class="label label-success">Open Access</span> Visible to the world.
27
+ </label>
28
+ <label class="radio">
29
+ <input type="radio" id="visibility_ndu" name="<%= f.object_name %>[visibility]" value="<%= AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED %>" <% if curation_concern.authenticated_only_access? %> checked="true"<% end %> />
30
+ <span class="label label-info"><%=t('sufia.institution_name') %></span> Visible to all <%=t('sufia.institution_name') %> users.
31
+ </label>
32
+ <label class="radio">
33
+ <input type="radio" id="visibility_restricted" name="<%= f.object_name %>[visibility]" value="<%= AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE%>" <% if curation_concern.private_access? %> checked="true"<% end %>/>
34
+ <span class="label label-important">Private</span> Only visible to you.
35
+ </label>
36
+ </div><!-- /.controls -->
37
+
38
+ </fieldset>
39
+ </div>
@@ -0,0 +1,46 @@
1
+ <table class="table table-striped <%= dom_class(curation_concern) %> related_files with-headroom">
2
+ <caption class="table-heading">
3
+ <h2>Files</h2>
4
+ </caption>
5
+ <thead>
6
+ <tr>
7
+ <th>File</th>
8
+ <th>Filename</th>
9
+ <th>Date Uploaded</th>
10
+ <th>Visibility</th>
11
+ <th>Actions</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <% curation_concern.generic_files.each do |generic_file| %>
16
+ <tr class="<%= dom_class(generic_file) %> attributes">
17
+ <td class="attribute title"><%= generic_file %></td>
18
+ <td class="attribute filename"><%= generic_file.filename %></td>
19
+ <td class="attribute date_uploaded"><%= generic_file.date_uploaded %></td>
20
+ <td class="attribute permission"><%= link_to_edit_permissions(generic_file) %></td>
21
+ <td>
22
+ <%- if with_actions -%>
23
+ <%- if can?(:edit, generic_file) -%>
24
+ <%= link_to(
25
+ 'Edit',
26
+ edit_polymorphic_path([:curation_concern, generic_file]),
27
+ { class: 'btn', title: "Edit #{generic_file}" }
28
+ ) %>
29
+ <%- end -%>
30
+ <%- if can?(:destroy, generic_file) -%>
31
+ <%= link_to(
32
+ 'Delete',
33
+ polymorphic_path([:curation_concern, generic_file]),
34
+ class: 'btn', method: :delete, title: "Delete #{generic_file.to_s.inspect}",
35
+ confirm: "Deleting #{generic_file.to_s.inspect} from #{t('sufia.product_name')} is permanent. Click OK to delete this from #{t('sufia.product_name')}, or Cancel to cancel this operation"
36
+ )%>
37
+ <%- end -%>
38
+ <%- end -%>
39
+ <%- if can?(:read, generic_file) -%>
40
+ <%= render '/curation_concern/media_display', generic_file: generic_file %>
41
+ <%- end -%>
42
+ </td>
43
+ </tr>
44
+ <% end %>
45
+ </tbody>
46
+ </table>
@@ -0,0 +1,63 @@
1
+ <table class="table table-striped <%= dom_class(curation_concern) %> attributes">
2
+ <tbody>
3
+ <tr>
4
+ <th>Title</th>
5
+ <td><%= curation_concern %></td>
6
+ </tr>
7
+ <tr>
8
+ <th>Filename</th>
9
+ <td><%= curation_concern.filename %></td>
10
+ </tr>
11
+ <tr>
12
+ <th>Depositor</th>
13
+ <td><%= curation_concern.depositor %></td>
14
+ </tr>
15
+ <tr>
16
+ <th>Date Uploaded</th>
17
+ <td>
18
+ <%= curation_concern.date_uploaded %>
19
+ </td>
20
+ </tr>
21
+ <tr>
22
+ <th>Date Modified</th>
23
+ <td>
24
+ <%= curation_concern.date_modified %>
25
+ </td>
26
+ </tr>
27
+ <tr>
28
+ <th>Audit Status</th>
29
+ <%- stat= curation_concern.audit_stat(false) %>
30
+ <td> <%= (stat == 1 ? 'passing' : (stat == 0 ? 'failing' : stat)) %></td>
31
+ </tr>
32
+ <tr>
33
+ <th>Characterization</th>
34
+ <td>
35
+ <%= "not yet characterized" if curation_concern.characterization_terms.values.flatten.map(&:empty?).reduce(true) { |sum, value| sum && value } %>
36
+ <% curation_concern.characterization_terms.each_pair do |term, values| %>
37
+ <div>
38
+ <% label = term.to_s %>
39
+ <% if label == "format_label" %>
40
+ <% label = "File Format" %>
41
+ <% values = curation_concern.file_format %>
42
+ <% end %>
43
+ <% label = label.humanize %>
44
+ <% if values.is_a? Array %>
45
+ <% length = values.length %>
46
+ <% length = Sufia::Engine.config.fits_message_length-1 if term == :status_message && values.length > Sufia::Engine.config.fits_message_length-1 %>
47
+ <% values[0..length].each_with_index do |value, idx| %>
48
+ <% next if value.empty? %>
49
+ <%= "#{label}: #{value.truncate(250)}" %>
50
+ <%= "<br />".html_safe unless idx == length %>
51
+ <% end %>
52
+ <% if length != values.length %>
53
+ <%= render :partial => "generic_files/extra_fields_modal", :locals=>{:name=>term, :values=> values, :start=>Sufia::Engine.config.fits_message_length}%>
54
+ <% end %>
55
+ <% else %>
56
+ <%= "#{label}: #{values.truncate(250)}" %><br />
57
+ <% end %>
58
+ </div>
59
+ <% end %>
60
+ </td>
61
+ </tr>
62
+ </tbody>
63
+ </table>
@@ -0,0 +1,57 @@
1
+ <%= simple_form_for [:curation_concern, curation_concern] do |f| %>
2
+ <div class="row">
3
+ <div class="span6">
4
+ <fieldset class="required">
5
+ <legend>Your File&#8217;s Title</legend>
6
+ <%= f.input :title,
7
+ input_html: { class: 'input-xlarge' }
8
+ %>
9
+ </fieldset>
10
+ <fieldset class="required">
11
+ <legend>
12
+ Attach Your File
13
+ <small>A PDF copy is preferred.</small>
14
+ </legend>
15
+ <%= f.input :file,
16
+ as: :file,
17
+ label: 'Upload a file'
18
+ %>
19
+ </fieldset>
20
+ <% if curation_concern.persisted? %>
21
+ <fieldset>
22
+ <legend> Versioning</legend>
23
+ <%#
24
+ TODO - Cleanup up this violation of Law of Demeter
25
+ curation_concern.versions should yield a version object
26
+ * version#created_on
27
+ * version#committer
28
+ * version#number
29
+ %>
30
+ <%= "Current version uploaded on #{curation_concern.content.latest_version.dsCreateDate.localtime.to_formatted_s(:long_ordinal)} [by #{curation_concern.content.version_committer(curation_concern.content.latest_version)}]"%>
31
+ <%= f.input :version , label: "Restore Previous Version from" do %>
32
+ <%= f.select :version, curation_concern.versions.map { |version| ["Restore from #{version.dsCreateDate.localtime.to_formatted_s(:long_ordinal)} [ by #{curation_concern.content.version_committer(version)}]", version.versionID, { class: curation_concern.content.version_committer(version) }] }, include_blank: true %>
33
+ <% end %>
34
+ </fieldset>
35
+ <%- end -%>
36
+ </div>
37
+
38
+ <div class="span6">
39
+ <%= render "/curation_concern/permission", curation_concern: curation_concern, f: f %>
40
+ </div>
41
+ </div>
42
+
43
+ <div class="row">
44
+ <div class="span12 form-actions">
45
+ <%= f.submit(
46
+ (curation_concern.persisted? ? "Update Attached File" : %(Attach to #{parent.human_readable_type})),
47
+ class: 'btn btn-primary'
48
+ ) %>
49
+ <%# TODO Cancel button behavior should be context aware.
50
+ Going back to the dashboard isn't always the expected behavior. %>
51
+ <%= link_to 'Cancel', dashboard_index_path, class: 'btn btn-link' %>
52
+ <% unless curation_concern.new_record? -%>
53
+ <%= link_to 'Go to File Record View', polymorphic_path([:curation_concern, curation_concern]), class: 'btn btn-info pull-right' %>
54
+ <% end -%>
55
+ </div>
56
+ </div>
57
+ <% end %>