sufia 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/.travis.yml +6 -0
  4. data/Gemfile +5 -2
  5. data/History.md +6 -0
  6. data/README.md +40 -0
  7. data/Rakefile +4 -0
  8. data/app/assets/javascripts/sufia.js +3 -115
  9. data/app/assets/javascripts/sufia/batch_select_all.js +179 -0
  10. data/app/assets/javascripts/sufia/edit_metadata.js +86 -0
  11. data/app/assets/javascripts/sufia/multiForm.js +57 -0
  12. data/app/assets/javascripts/terms_of_service.js +7 -0
  13. data/app/assets/stylesheets/audio-js.css +3 -0
  14. data/app/assets/stylesheets/dashboard.css.scss +51 -0
  15. data/app/assets/stylesheets/generic_files.css +36 -0
  16. data/app/assets/stylesheets/sufia.css.scss +2 -0
  17. data/app/controllers/batch_controller.rb +11 -0
  18. data/app/controllers/batch_edits_controller.rb +1 -77
  19. data/app/controllers/generic_files_controller.rb +1 -0
  20. data/app/controllers/mailbox_controller.rb +1 -1
  21. data/app/controllers/single_use_link_controller.rb +11 -7
  22. data/app/helpers/generic_file_helper.rb +11 -3
  23. data/app/helpers/sufia_helper.rb +13 -10
  24. data/app/models/batch.rb +1 -1
  25. data/app/models/datastreams/fits_datastream.rb +2 -2
  26. data/app/models/datastreams/generic_file_rdf_datastream.rb +22 -18
  27. data/app/models/datastreams/properties_datastream.rb +2 -2
  28. data/app/views/_user_util_links.html.erb +2 -2
  29. data/app/views/batch/_metadata.html.erb +82 -0
  30. data/app/views/batch/_more_metadata.html.erb +6 -0
  31. data/app/views/batch/edit.html.erb +1 -8
  32. data/app/views/batch_edits/_check_all.html.erb +0 -157
  33. data/app/views/batch_edits/edit.html.erb +0 -29
  34. data/app/views/catalog/_index_partials/_list_files.html.erb +8 -10
  35. data/app/views/catalog/_recent_document.html.erb +9 -18
  36. data/app/views/catalog/_results_pagination.html.erb +1 -1
  37. data/app/views/contact_form/new.html.erb +1 -1
  38. data/app/views/dashboard/_index_partials/_default_group.html.erb +1 -1
  39. data/app/views/dashboard/_index_partials/_list_files.html.erb +12 -14
  40. data/app/views/dashboard/_index_partials/_thumbnail_display.html.erb +9 -19
  41. data/app/views/dashboard/_results_pagination.html.erb +1 -1
  42. data/app/views/dashboard/index.html.erb +6 -82
  43. data/app/views/error/single_use_error.html.erb +35 -0
  44. data/app/views/generic_files/_descriptions.html.erb +2 -2
  45. data/app/views/generic_files/_extra_fields_modal.html.erb +1 -1
  46. data/app/views/generic_files/_field_form.html.erb +2 -5
  47. data/app/views/generic_files/_media_display.html.erb +8 -6
  48. data/app/views/generic_files/_permission.html.erb +2 -2
  49. data/app/views/generic_files/_rights_modal.html.erb +1 -1
  50. data/app/views/generic_files/_show_actions.html.erb +1 -1
  51. data/app/views/generic_files/_show_details.html.erb +11 -6
  52. data/app/views/generic_files/edit.html.erb +0 -8
  53. data/app/views/generic_files/edit_fields/_type.html.erb +1 -1
  54. data/app/views/generic_files/show.html.erb +5 -8
  55. data/app/views/generic_files/show_fields/_based_near.html.erb +4 -1
  56. data/app/views/generic_files/show_fields/_contributor.html.erb +4 -1
  57. data/app/views/generic_files/show_fields/_creator.html.erb +4 -1
  58. data/app/views/generic_files/show_fields/_date_created.html.erb +4 -1
  59. data/app/views/generic_files/show_fields/_description.html.erb +4 -1
  60. data/app/views/generic_files/show_fields/_language.html.erb +1 -1
  61. data/app/views/generic_files/show_fields/_publisher.html.erb +4 -1
  62. data/app/views/generic_files/show_fields/_related_url.html.erb +3 -1
  63. data/app/views/generic_files/show_fields/_resource_type.html.erb +1 -1
  64. data/app/views/generic_files/show_fields/_subject.html.erb +4 -1
  65. data/app/views/generic_files/show_fields/_tag.html.erb +1 -1
  66. data/app/views/generic_files/show_fields/_title.html.erb +4 -1
  67. data/app/views/layouts/error.html.erb +0 -4
  68. data/app/views/layouts/hydra-head.html.erb +2 -6
  69. data/app/views/single_use_link/show.html.erb +1 -1
  70. data/app/views/users/index.html.erb +1 -1
  71. data/app/views/users/show.html.erb +1 -1
  72. data/config/locales/sufia.en.yml +1 -0
  73. data/config/routes.rb +11 -4
  74. data/lib/generators/sufia/sufia_generator.rb +2 -1
  75. data/lib/generators/sufia/templates/catalog_controller.rb +143 -117
  76. data/lib/generators/sufia/templates/config/resque_admin.rb +10 -0
  77. data/lib/generators/sufia/templates/config/sufia.rb +8 -0
  78. data/lib/sufia.rb +4 -14
  79. data/lib/sufia/batch_edits_controller_behavior.rb +89 -0
  80. data/lib/sufia/controller.rb +7 -5
  81. data/lib/sufia/downloads_controller_behavior.rb +14 -19
  82. data/lib/sufia/file_content/extract_metadata.rb +11 -4
  83. data/lib/sufia/files_controller_behavior.rb +63 -44
  84. data/lib/sufia/generic_file.rb +29 -11
  85. data/lib/sufia/generic_file/audit.rb +1 -1
  86. data/lib/sufia/generic_file/thumbnail.rb +51 -26
  87. data/lib/sufia/id_service.rb +28 -11
  88. data/lib/sufia/jobs/batch_update_job.rb +2 -2
  89. data/lib/sufia/jobs/characterize_job.rb +11 -3
  90. data/lib/sufia/jobs/ffmpeg_transcode_job.rb +61 -0
  91. data/lib/sufia/jobs/resolrize_job.rb +1 -1
  92. data/lib/sufia/jobs/transcode_audio_job.rb +40 -0
  93. data/lib/sufia/jobs/transcode_video_job.rb +9 -49
  94. data/lib/sufia/queue/resque.rb +2 -2
  95. data/lib/sufia/single_use_error.rb +4 -0
  96. data/lib/sufia/solr_document_behavior.rb +108 -1
  97. data/lib/sufia/version.rb +1 -1
  98. data/solr_conf/conf/schema.xml +332 -652
  99. data/solr_conf/conf/solrconfig.xml +60 -196
  100. data/spec/controllers/batch_controller_spec.rb +4 -5
  101. data/spec/controllers/catalog_controller_spec.rb +13 -13
  102. data/spec/controllers/dashboard_controller_spec.rb +2 -2
  103. data/spec/controllers/downloads_controller_spec.rb +74 -62
  104. data/spec/controllers/generic_files_controller_spec.rb +10 -8
  105. data/spec/controllers/single_use_link_controller_spec.rb +12 -4
  106. data/spec/fixtures/Example.ogg +0 -0
  107. data/spec/fixtures/piano_note.wav +0 -0
  108. data/spec/fixtures/sufia_generic_stub.descMeta.txt +1 -1
  109. data/spec/helpers/sufia_helper_spec.rb +12 -0
  110. data/spec/models/characterize_job_spec.rb +89 -0
  111. data/spec/models/checksum_audit_log_spec.rb +1 -0
  112. data/spec/models/event_jobs_spec.rb +9 -9
  113. data/spec/models/file_content_datastream_spec.rb +16 -10
  114. data/spec/models/fits_datastream_spec.rb +2 -8
  115. data/spec/models/generic_file_spec.rb +131 -60
  116. data/spec/models/solr_document_spec.rb +21 -0
  117. data/spec/models/transcode_audio_job_spec.rb +81 -0
  118. data/spec/models/transcode_video_job_spec.rb +2 -2
  119. data/spec/models/unzip_job_spec.rb +3 -3
  120. data/spec/spec_helper.rb +21 -0
  121. data/spec/support/Gemfile +7 -3
  122. data/sufia.gemspec +8 -11
  123. data/tasks/cucumber.rake +1 -2
  124. data/tasks/sufia-dev.rake +13 -2
  125. data/tasks/sufia.rake +1 -1
  126. metadata +77 -118
  127. data/app/views/batch_edits/_metadata.html.erb +0 -180
  128. data/lib/generators/sufia/templates/config/hydra_config.rb +0 -32
  129. data/lib/kaminari/helpers/tag.rb +0 -11
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  %>
16
16
 
17
- <table class="table table-striped">
17
+ <table class="table table-striped dashboard">
18
18
  <caption class="accessible-hidden">Listing of files you have deposited in <%= t('sufia.product_name') %></caption>
19
19
  <% unless params[:display_type] == 'list' %>
20
20
  <thead>
@@ -17,8 +17,7 @@ limitations under the License.
17
17
  <!-- scholarsphere over ride -->
18
18
  <!-- the sub on ':' is b.c. jQuery has trouble with '.' or ':'
19
19
  on element ids -->
20
- <% if document.has_key?(:noid_s) %>
21
- <% noid = document[:noid_s].first %>
20
+ <% noid = document.noid %>
22
21
  <tr id="document_<%= noid.gsub(":", "_") %>" class="<%= cycle("","zebra") %>">
23
22
  <% gf = GenericFile.find(document.id) %>
24
23
  <td width="6%"><%= batch_edit_select(document) %>&nbsp;</td>
@@ -32,13 +31,13 @@ on element ids -->
32
31
  <td width="37%">
33
32
  <a href="" title="Click for more details"><i id="expand_<%= noid.gsub(":", "_") %>" class="icon-plus icon-large fleft"></i></a>&nbsp;
34
33
  <%= render :partial => 'dashboard/_index_partials/thumbnail_display', :locals => {:document=>document} %>
35
- <span class=center><%= link_to render_document_show_field_value(:document=>document, :field=>document.title_or_label), sufia.generic_file_path(noid), :id => "src_copy_link#{noid}" %> <br /></span>
34
+ <span class=center><%= link_to document.title_or_label, sufia.generic_file_path(noid), :id => "src_copy_link#{noid}" %> <br /></span>
36
35
  </td>
37
- <td width="17%"><%= document.fetch(:desc_metadata__date_uploaded_dt,'').to_time.strftime("%m/%d/%Y") unless document.fetch(:desc_metadata__date_uploaded_dt,'').blank? %> </td>
36
+ <td width="17%"><%= document.date_uploaded %> </td>
38
37
  <td width="5%" align="center">
39
- <% if !document[:read_access_group_t].blank? and document[:read_access_group_t].include?('registered') %>
38
+ <% if document.registered? %>
40
39
  <a href="<%= sufia.generic_file_path(noid) %>/edit/?tab=permissions" id="permission_<%= noid %>"><span class="label label-info" title="<%=t('sufia.institution_name') %>"><%=t('sufia.institution_name') %></span></a>
41
- <% elsif !document[:read_access_group_t].blank? and document[:read_access_group_t].include?('public') %>
40
+ <% elsif document.public? %>
42
41
  <a href="<%= sufia.generic_file_path(noid) %>/edit/?tab=permissions" id="permission_<%= noid %>"><span class="label label-success" title="Open Access">Open Access</span></a>
43
42
  <% else %>
44
43
  <a href="<%= sufia.generic_file_path(noid) %>/edit/?tab=permissions" id="permission_<%= noid %>"><span class="label label-important" title="Private">Private</span></a>
@@ -59,23 +58,22 @@ on element ids -->
59
58
  <td colspan="6">
60
59
  <table class="expanded-details">
61
60
  <tr>
62
- <td><strong>File Name: </strong> <%= link_to render_document_show_field_value(:document=>document, :field=>"label_t"), sufia.generic_file_path(noid) %> </td>
63
- <td><strong>File Format: </strong> <%= render_document_show_field_value(:document=>document, :field=>"file_format_t") %> </td>
61
+ <td><strong>File Name: </strong> <%= link_to document.label, sufia.generic_file_path(noid) %> </td>
62
+ <td><strong>File Format: </strong> <%= document.file_format %> </td>
64
63
  </tr>
65
64
  <tr>
66
- <td><strong>Creator: </strong> <%= render_document_show_field_value(:document=>document, :field=>"desc_metadata__creator_display") %> </td>
67
- <td><strong>Depositor: </strong> <%= link_to_profile render_document_show_field_value(:document=>document, :field=>"depositor_t") %> </td>
65
+ <td><strong>Creator: </strong> <%= document.creator %> </td>
66
+ <td><strong>Depositor: </strong> <%= link_to_profile document.depositor %> </td>
68
67
  </tr>
69
68
  <tr>
70
69
  <td colspan="2"><strong>Edit Access: </strong>
71
- <% if !document[:edit_access_group_t].nil?%>
72
- Groups: <%= render_document_show_field_value(:document=>document, :field=>"edit_access_group_t") %>
70
+ <% if document.edit_groups.present? %>
71
+ Groups: <%= document.edit_groups.join(', ') %>
73
72
  <br />
74
73
  <% end %>
75
- Users: <%= render_document_show_field_value(:document=>document, :field=>"edit_access_person_t") %>
74
+ Users: <%= document.edit_people.join(', ') %>
76
75
  </td>
77
76
  </tr>
78
77
  </table>
79
78
  </td>
80
79
  </tr>
81
- <% end %>
@@ -16,26 +16,16 @@ limitations under the License.
16
16
 
17
17
  <%- height = 42 if height.blank? -%>
18
18
  <%- width = 36 if width.blank? -%>
19
- <% if (document['mime_type_t']) %>
20
- <% if !(document['mime_type_t'] & ['image/jpeg', 'image/png', 'image/bmp', 'image/gif', 'image/jpg']).empty? %>
21
- <%= link_to image_tag(sufia.download_path(document["id"], {:datastream_id => 'thumbnail'}), {:width=>width, :height=>height}), sufia.generic_file_path(document[:noid_s].first) %>
22
- <% elsif !(document['mime_type_t'] & ['application/pdf']).empty? %>
23
- <%= link_to image_tag(sufia.download_path(document["id"], {:datastream_id => 'thumbnail'}), {:width=>width,:height=>height}),sufia.generic_file_path(document[:noid_s].first) %>
24
- <% elsif !(document['mime_type_t'] & ['video/mp4']).empty? %>
25
- <video controls="controls" height="80" width="140"
26
- class="video-js vjs-default-skin" data-setup="{}"
27
- preload="auto">
28
- <source src="<%= sufia.download_path(document["id"]) %>"
29
- type="<%= document['mime_type_t'].first %>" />
30
- Your browser does not support the video tag.
31
- </video>
32
- <% elsif !(document['mime_type_t'] & ['audio/mp3',
33
- 'audio/mpeg']).empty? %>
34
- <audio src="<%= sufia.download_path(document["id"], format:'audio')
35
- %>" > </audio>
19
+ <% if (document.mime_type) %>
20
+ <% if document.image? %>
21
+ <%= link_to image_tag(sufia.download_path(document["id"], {:datastream_id => 'thumbnail'}), {:width=>width}), sufia.generic_file_path(document.noid) %>
22
+ <% elsif document.pdf? %>
23
+ <%= link_to image_tag(sufia.download_path(document["id"], {:datastream_id => 'thumbnail'}), {:width=>width}),sufia.generic_file_path(document.noid) %>
24
+ <% elsif document.video? %>
25
+ <%= link_to image_tag(sufia.download_path(document["id"], {:datastream_id => 'thumbnail'}), {:width=>width}),sufia.generic_file_path(document.noid) %>
36
26
  <% else %>
37
- <%= link_to image_tag("/assets/default.png", {:width=>width,:height=>height}), sufia.generic_file_path(document[:noid_s].first) %>
27
+ <%= link_to image_tag("/assets/default.png", {:width=>width}), sufia.generic_file_path(document) %>
38
28
  <% end %>
39
29
  <% else %>
40
- <%= link_to image_tag("/assets/default.png", {:width=>width,:height=>height}), sufia.generic_file_path(document[:noid_s].first) %>
30
+ <%= link_to image_tag("/assets/default.png", {:width=>width}), sufia.generic_file_path(document) %>
41
31
  <% end %>
@@ -16,7 +16,7 @@ limitations under the License.
16
16
 
17
17
  <% if paginate_params(@response).num_pages > 1 %>
18
18
  <div class="pager">
19
- <%= paginate_rsolr_response @response, :outer_window => 2, :theme => 'blacklight' %>
19
+ <%= paginate_rsolr_response @response, :outer_window => 2, :theme => 'blacklight', :route_set=> sufia %>
20
20
  <div class="clearfix"></div>
21
21
  </div><!-- /pager -->
22
22
  <% end %>
@@ -14,26 +14,6 @@ See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  %>
16
16
 
17
- <% content_for :js_head do %>
18
-
19
- <script type = "text/javascript">
20
-
21
- // function to hide or show the batch update buttons based on how may items are checked
22
- function toggleButtons(forceOn, otherPage ){
23
- forceOn = typeof forceOn !== 'undefined' ? forceOn : false
24
- otherPage = typeof otherPage !== 'undefined' ? otherPage : <%= !@batch_part_on_other_page %>
25
- var n = $(".batch_toggle:checked").length;
26
- if ((n>0) || (forceOn)) {
27
- $('.batch-select-all').show();
28
- $('.button_to').show();
29
- } else if ( otherPage){
30
- $('.batch-select-all').hide();
31
- $('.button_to').hide();
32
- }
33
- $("body").css("cursor", "auto");
34
- }
35
- </script>
36
- <% end %>
37
17
  <% content_for :local_js do %>
38
18
 
39
19
  initialize_audio();
@@ -83,79 +63,23 @@ limitations under the License.
83
63
  return false;
84
64
  });
85
65
  }
86
-
87
- // hide or show the batch update buttons file selections
88
- $(".batch_toggle").bind('click', function(e) {
89
- e.preventDefault();
90
- toggleButtons();
91
- });
92
66
  });
93
67
 
94
68
 
95
69
  // hide or show the batch update buttons on page startup
70
+ window.batch_part_on_other_page = <%= @batch_part_on_other_page%>;
71
+ window.batch_size_on_other_page = <%= @batch_size_on_other_page%>;
72
+ window.result_set_size = <%= @result_set_size%>;
73
+ window.document_list_count = <%= @document_list.count %>;
96
74
  toggleButtons(<%= !@empty_batch %>);
97
75
 
98
-
99
- $('#documents').batchEdit();
76
+ // initialize hydra batch edit and set up select all button toggle after checkboxes have been created
77
+ $('#documents').batchEdit({afterCheckboxUpdate: setup_buttontoggle});
100
78
 
101
79
 
102
80
  <% end %>
103
81
 
104
82
 
105
- <% content_for :local_css do %>
106
-
107
- .audiojs {
108
- width: 38px;
109
- float: left;
110
- }
111
-
112
- audio {
113
- width: 38px;
114
- float: left;
115
- }
116
-
117
- .batch-select-all, .button_to {
118
-
119
- float: right;
120
- padding-left: 6px;
121
- padding-top: 0px;
122
- padding-top: 0px;
123
- }
124
-
125
- .bedit {
126
- width: 65%;
127
- }
128
-
129
- .batch-select-all .btn-primary {
130
- background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;*background-color:#a9302a;
131
- }
132
-
133
- .button_to .btn-primary {
134
- background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;*background-color:#df8505;
135
- }
136
-
137
- .table th, .table td {
138
- padding: 4px;
139
- }
140
- .table .sm {
141
- padding: 2px;
142
- }
143
-
144
- .over {
145
- z-index:100;
146
- }
147
- .under
148
- {
149
- position:absolute;
150
- padding:0px 0px 0px 0px;
151
- left:10px;
152
- top:-8px;
153
- color:orange;
154
- z-index:1;
155
- }
156
-
157
- <% end %>
158
-
159
83
  <% @page_title = application_name + " Dashboard" %>
160
84
 
161
85
  <div class="accessible-hidden" id="current_user"><%=@user.user_key%></div>
@@ -0,0 +1,35 @@
1
+ <%#
2
+ Copyright © 2012 The Pennsylvania State University
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ %>
16
+
17
+ <!DOCTYPE html>
18
+ <html>
19
+ <head>
20
+ <title>Single use link Not Found</title>
21
+ </head>
22
+ <body>
23
+ <div class="columns two-a">
24
+ <div class="column second">
25
+ <h1>Single Use Link Expired or Not Found</h1>
26
+ <p>
27
+ <%= t('sufia.product_name') %> could not locate the single use link.
28
+ This link either expired or had been used previously. We apologize
29
+ for the inconvenience. You might be interested in using
30
+ <a href="/help/">the help page</a> for looking up
31
+ solutions.
32
+ </p>
33
+ </div>
34
+ </body>
35
+ </html>
@@ -21,8 +21,8 @@ limitations under the License.
21
21
  <div class="well">
22
22
 
23
23
  <%= render :partial=>'generic_files/edit_fields/type', :locals => {f:f} %>
24
- <% @terms.each do |term| %>
25
- <%= render :partial => "generic_files/field_form", :locals => { :generic_file => @generic_file, :f =>f, :render_req => true, :key => term } %>
24
+ <% (@generic_file.terms_for_editing - [:resource_type]).each do |term| %>
25
+ <%= render :partial => "generic_files/field_form", :locals => { :generic_file => @generic_file, :f =>f, :render_req => true, :key => term } %>
26
26
  <% end %>
27
27
 
28
28
  </div><!-- /well -->
@@ -3,7 +3,7 @@
3
3
  <!-- Button to trigger modal -->
4
4
  <a href="#extraFieldsModal_<%=name %>" role="button" class="btn btn-warning fright vmiddle" data-toggle="modal">Additional <%= label %> <i class="icon-plus-sign icon-large"></i></a>
5
5
  <!-- Modal -->
6
- <div class="modal hide fade" id="extraFieldsModal_<%=name %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
6
+ <div class="modal hide" id="extraFieldsModal_<%=name %>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
7
7
  <div class="modal-header">
8
8
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
9
9
  <h2 id="extraFieldsModal_<%=name %>_Label">Additional <%= label %>(s)</h2>
@@ -1,9 +1,6 @@
1
1
  <% render_req ||= true # render_req is true for single file edit, false for batch edit%>
2
2
  <div class="control-group">
3
- <% vals = generic_file.send(key) %>
4
- <%# if vals is empty we create an one element array to loop over for output %>
5
- <% vals = [''] if vals.count == 0 %>
6
-
3
+ <% vals = generic_file[key] %>
7
4
  <% if render_req && required?(key) %>
8
5
  <% tmp = '<span class="error">*</span>' + get_label(key) %>
9
6
  <%= f.label key, tmp.html_safe, :class=>"control-label" %>
@@ -11,7 +8,7 @@
11
8
  <%= f.label key, get_label(key), :class=>"control-label"%>
12
9
  <% end %>
13
10
 
14
- <% vals.each_with_index do |v, index| %>
11
+ <% vals.to_ary.each_with_index do |v, index| %>
15
12
  <%= render_edit_field_partial(key, f:f, v: v, index: index, render_req: render_req) %>
16
13
  <% end %>
17
14
  </div><!-- /control-group -->
@@ -15,19 +15,21 @@ limitations under the License.
15
15
  %>
16
16
 
17
17
  <% if @generic_file.image? %>
18
- <a href="<%= sufia.download_path(@generic_file) %>" target="_new"><img src="<%= sufia.download_path(@generic_file) %>" width="338" /></a>
18
+ <a href="<%= sufia.download_path(@generic_file) %>" target="_new" title="Download the full-sized image"><img src="<%= sufia.download_path(@generic_file, {:datastream_id => 'thumbnail'}) %>" width="338" alt="Download the full-sized image of <%= @generic_file.title.first %>"/>Download the full-sized image</a>
19
19
  <% elsif @generic_file.video? %>
20
20
  <video controls="controls" class="video-js vjs-default-skin" data-setup="{}" preload="auto">
21
21
  <source src="<%= sufia.download_path(@generic_file, datastream_id: 'webm') %>" type="video/webm" />
22
22
  <source src="<%= sufia.download_path(@generic_file, datastream_id: 'mp4') %>" type="video/mp4" />
23
- Your browser does not support the audio tag.
23
+ Your browser does not support the video tag.
24
24
  </video>
25
- <% elsif ['audio/mp3', 'audio/mpeg'].include?(@generic_file.mime_type) %>
26
- <audio src="<%= sufia.download_path(@generic_file, format:'audio') %>" type="<%= @generic_file.mime_type %>" />
25
+ <% elsif @generic_file.audio? %>
26
+ <audio controls="controls" class="video-js vjs-default-skin" data-setup="{}" preload="auto">
27
+ <source src="<%= sufia.download_path(@generic_file, datastream_id: 'ogg') %>" type="audio/ogg" />
28
+ <source src="<%= sufia.download_path(@generic_file, datastream_id: 'mp3') %>" type="audio/mp3" />
27
29
  Your browser does not support the audio tag.
28
- </audio>
30
+ </audio>
29
31
  <% elsif @generic_file.pdf?%>
30
- <a href="<%= sufia.download_path(@generic_file) %>" target="_new"><img src="<%= sufia.download_path(@generic_file, {:datastream_id => 'thumbnail'}) %>" width="338" height="493" /></a>
32
+ <a href="<%= sufia.download_path(@generic_file) %>" target="_new" title="Download the full-sized PDF"><img src="<%= sufia.download_path(@generic_file, datastream_id: 'thumbnail') %>" width="338" alt="Download the full-sized PDF of <%= @generic_file.title.first %>"/>Download the full-sized PDF</a>
31
33
  <% else %>
32
34
  <a href="<%= sufia.download_path(@generic_file) %>" target="_new"><img src="/assets/default.png" alt="No preview available" width="338" height="493" /></a>
33
35
  <% end %>
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
14
14
  limitations under the License.
15
15
  %>
16
16
 
17
- <% depositor = gf.depositor || GenericFile.find(:is_part_of_s => "info:fedora/#{batch.pid}").first.depositor %>
17
+ <% depositor = gf.depositor || batch.generic_files.first.depositor %>
18
18
  <% public_perm = gf.permissions.map { |perm| perm[:access] if perm[:name] == "public"}.compact.first %>
19
19
  <% public_perm = true if params[:controller] == 'batch' %>
20
20
  <% psu_perm = gf.permissions.map { |perm| perm[:access] if perm[:name] == "registered"}.compact.first %>
@@ -32,7 +32,7 @@ limitations under the License.
32
32
  <!-- Button to trigger modal -->
33
33
  <a href="#myModal" role="button" class="btn btn-warning" data-toggle="modal">What's this <i class="icon-question-sign icon-large"></i></a>
34
34
  <!-- Modal -->
35
- <div class="modal hide fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
35
+ <div class="modal hide" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
36
36
  <div class="modal-header">
37
37
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
38
38
  <h2 id="myModalLabel"><%=t('sufia.product_name') %> Permissions</h2>
@@ -18,7 +18,7 @@ limitations under the License.
18
18
  <!-- Button to trigger modal -->
19
19
  <a href="#rightsModal" role="button" class="btn btn-warning fright" data-toggle="modal">License Descriptions <i class="icon-question-sign icon-large"></i></a>
20
20
  <!-- Modal -->
21
- <div class="modal hide fade" id="rightsModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
21
+ <div class="modal hide" id="rightsModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
22
22
  <div class="modal-header">
23
23
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
24
24
  <h2 id="rightsModallLabel"><%= t('sufia.product_name') %> License Descriptions</h2>
@@ -3,7 +3,7 @@
3
3
  <%= link_to "Download", sufia.download_path(@generic_file.noid) %>
4
4
  <!-- &nbsp;|&nbsp; -->
5
5
  <%# link_to "Cite", citation_generic_file_path, {:id => 'citeLink', :name => 'citation', :class => 'lightboxLink'}, :action => 'citation' %>
6
- <% if @can_edit %>
6
+ <% if can? :edit, @generic_file %>
7
7
  &nbsp;|&nbsp;
8
8
  <%= link_to "Edit", sufia.edit_generic_file_path unless @generic_file.processing? %>
9
9
  <%= "File is being processed you may edit once it is complete" if @generic_file.processing? %>
@@ -3,17 +3,17 @@
3
3
  <tbody>
4
4
  <tr>
5
5
  <th>Depositor</th>
6
- <td><%= link_to_profile @generic_file.depositor %></td>
6
+ <td itemprop="accountablePerson" itemscope itemtype="http://schema.org/Person"><span itemprop="name"><%= link_to_profile @generic_file.depositor %></span></td>
7
7
  </tr>
8
8
  <tr>
9
9
  <th>Date Uploaded</th>
10
- <td>
10
+ <td itemprop="datePublished">
11
11
  <%= @generic_file.date_uploaded %>
12
12
  </td>
13
13
  </tr>
14
14
  <tr>
15
15
  <th>Date Modified</th>
16
- <td>
16
+ <td itemprop="dateModified">
17
17
  <%= @generic_file.date_modified %>
18
18
  </td>
19
19
  </tr>
@@ -24,11 +24,16 @@
24
24
  </tr>
25
25
  <% unless @generic_file.related_files.empty? %>
26
26
  <tr>
27
+
27
28
  <th>Related Files</th>
28
29
  <td>
29
- <% @generic_file.related_files.each do |f| %>
30
- <dd><%= link_to(f.label, sufia.generic_file_url(f.noid)) %></dd>
31
- <% end %>
30
+ <div class="related-files">
31
+ <dl><dt>
32
+ <% @generic_file.related_files.each do |f| %>
33
+ <dd><%= link_to(f.label, sufia.generic_file_url(f.noid)) %></dd>
34
+ <% end %>
35
+ </dt></dl>
36
+ </div>
32
37
  </td>
33
38
  </tr>
34
39
  <% end %>
@@ -50,14 +50,6 @@ $("a[rel=popover]").popover();
50
50
 
51
51
  <% end %>
52
52
 
53
- <% content_for :local_css do %>
54
- .audiojs {
55
- width: 338px;
56
- }
57
-
58
- label.error { float: left; color: red; padding-left: .5em; vertical-align: top; }
59
- <% end %>
60
-
61
53
  <%= render :partial => 'breadcrumbs' %>
62
54
 
63
55
  <h1 class="lower">Edit <%= display_title(@generic_file) %></h1>
@@ -2,7 +2,7 @@
2
2
  <%= f.label :resource_type, "Resource Types", :class=>"control-label", :for=>"resource_type" %>
3
3
  <div class="controls">
4
4
  <p class="help-block">You may select multiple types to apply<p>
5
- <%= f.select "resource_type", options_for_select(Sufia::Engine.config.resource_types.keys, @generic_file.resource_type.to_a), {}, {:multiple=>true, :size=>7} %>
5
+ <%= f.select "resource_type", options_for_select(Sufia::Engine.config.resource_types.keys, @generic_file.resource_type), {}, {:multiple=>true, :size=>7} %>
6
6
  <%= help_icon(:resource_type) %>
7
7
  </div>
8
8
  </div><!-- /control-group -->
@@ -17,18 +17,15 @@ limitations under the License.
17
17
 
18
18
  <% content_for :js_head do %>
19
19
  <% javascript_include_tag 'https://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4ff1d986721ebb24' %>
20
+ <script type="text/javascript">
21
+ var addthis_config = {"data_track_addressbar":true};
22
+ </script>
20
23
  <% end %>
21
24
 
22
25
  <% content_for :local_js do %>
23
- initialize_audio();
24
- var addthis_config = {"data_track_addressbar":true};
26
+ initialize_audio();
25
27
  <% end %>
26
28
 
27
- <% content_for :local_css do %>
28
- .audiojs {
29
- width: 338px;
30
- }
31
- <% end %>
32
29
  <%= render :partial => 'generic_files/breadcrumbs' %>
33
30
 
34
31
  <h1 class="lower"><%= display_title(@generic_file) %></h1>
@@ -38,7 +35,7 @@ var addthis_config = {"data_track_addressbar":true};
38
35
  <%= render :partial => 'generic_files/media_display' %>
39
36
  </div>
40
37
  <div class="span2">&nbsp;</div>
41
- <div class="span68"><!-- class="column second"> -->
38
+ <div itemscope itemtype="http://schema.org/CreativeWork" class="span68"><!-- class="column second"> -->
42
39
  <%= render partial: 'show_actions' %>
43
40
  <%= render partial: 'show_descriptions' %>
44
41
  <%= render partial: 'show_details' %>