sufia 0.0.1.pre2 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -5
- data/README.md +44 -12
- data/app/assets/javascripts/{scholarsphere.js → sufia.js} +0 -0
- data/app/assets/stylesheets/{scholarsphere.css → sufia.css} +0 -0
- data/app/controllers/batch_controller.rb +2 -3
- data/app/controllers/batch_edits_controller.rb +4 -4
- data/app/controllers/dashboard_controller.rb +5 -3
- data/app/controllers/generic_files_controller.rb +77 -41
- data/app/controllers/users_controller.rb +9 -21
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +2 -2
- data/app/helpers/sufia_helper.rb +23 -2
- data/app/models/datastreams/file_content_datastream.rb +17 -9
- data/app/models/generic_file.rb +1 -809
- data/app/views/_add_assets_links.html.erb +1 -1
- data/app/views/_user_util_links.html.erb +2 -2
- data/app/views/batch/_metadata.html.erb +16 -16
- data/app/views/batch/edit.html.erb +16 -10
- data/app/views/batch_edits/_metadata.html.erb +16 -16
- data/app/views/catalog/_index_partials/_list_files.html.erb +2 -2
- data/app/views/catalog/index.html.erb +5 -0
- data/app/views/dashboard/_facet_limit.html.erb +1 -1
- data/app/views/dashboard/_facet_pagination.html.erb +4 -4
- data/app/views/dashboard/_facet_selected.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_list_files.html.erb +8 -8
- data/app/views/dashboard/_search_form.html.erb +1 -1
- data/app/views/dashboard/_sort_and_per_page.html.erb +1 -1
- data/app/views/dashboard/index.html.erb +0 -1
- data/app/views/generic_files/_breadcrumbs.html.erb +1 -1
- data/app/views/generic_files/_descriptions.html.erb +3 -3
- data/app/views/generic_files/_field_form +3 -3
- data/app/views/generic_files/_media_display.html.erb +5 -4
- data/app/views/generic_files/_permission.html.erb +5 -5
- data/app/views/generic_files/_versioning.html.erb +1 -1
- data/app/views/generic_files/edit.html.erb +2 -2
- data/app/views/generic_files/show.html.erb +3 -3
- data/app/views/static/versions.html.erb +1 -1
- data/app/views/users/edit.html.erb +5 -3
- data/app/views/users/index.html.erb +3 -3
- data/app/views/users/show.html.erb +6 -6
- data/config/jetty.yml +6 -0
- data/config/routes.rb +8 -4
- data/features/browse_dashboard_files.feature +11 -1
- data/features/browse_files.feature +6 -5
- data/features/contact_form.feature +4 -0
- data/features/display_dashboard.feature +6 -3
- data/features/ingest_upload_files.feature +2 -2
- data/features/step_definitions/fixture_steps.rb +6 -5
- data/features/step_definitions/scholarsphere.rb +24 -1
- data/features/step_definitions/user_steps.rb +2 -2
- data/features/step_definitions/web_steps.rb +1 -1
- data/features/support/env.rb +26 -0
- data/features/users.feature +18 -0
- data/lib/active_support/core_ext/marshal.rb +22 -0
- data/lib/generators/sufia/sufia_generator.rb +18 -2
- data/lib/generators/sufia/templates/catalog_controller.rb +3 -4
- data/{spec/support → lib/generators/sufia/templates}/config/redis.yml +0 -0
- data/lib/generators/sufia/templates/config/sufia.rb +68 -0
- data/lib/generators/sufia/templates/migrations/add_ldap_attrs_to_user.rb +41 -0
- data/lib/kaminari/helpers/tag.rb +11 -0
- data/lib/sufia.rb +30 -7
- data/lib/sufia/controller.rb +1 -5
- data/lib/sufia/generic_file.rb +200 -0
- data/lib/sufia/generic_file/audit.rb +119 -0
- data/lib/sufia/generic_file/characterization.rb +82 -0
- data/lib/sufia/generic_file/export.rb +339 -0
- data/lib/sufia/generic_file/permissions.rb +64 -0
- data/lib/sufia/generic_file/thumbnail.rb +68 -0
- data/{app/models → lib/sufia/jobs}/audit_job.rb +13 -3
- data/lib/sufia/jobs/batch_update_job.rb +86 -0
- data/lib/sufia/jobs/characterize_job.rb +35 -0
- data/{app/models → lib/sufia/jobs}/content_delete_event_job.rb +3 -1
- data/{app/models → lib/sufia/jobs}/content_deposit_event_job.rb +1 -1
- data/{app/models → lib/sufia/jobs}/content_new_version_event_job.rb +1 -1
- data/{app/models → lib/sufia/jobs}/content_restored_version_event_job.rb +8 -0
- data/{app/models → lib/sufia/jobs}/content_update_event_job.rb +1 -1
- data/{app/models → lib/sufia/jobs}/event_job.rb +7 -3
- data/{app/models → lib/sufia/jobs}/resolrize_job.rb +4 -2
- data/lib/sufia/jobs/transcode_video_job.rb +79 -0
- data/{app/models → lib/sufia/jobs}/unzip_job.rb +11 -3
- data/{app/models → lib/sufia/jobs}/user_edit_profile_event_job.rb +6 -0
- data/{app/models → lib/sufia/jobs}/user_follow_event_job.rb +9 -4
- data/{app/models → lib/sufia/jobs}/user_unfollow_event_job.rb +6 -0
- data/lib/sufia/queue/resque.rb +30 -0
- data/lib/sufia/role_mapper.rb +0 -1
- data/{app/models/characterize_job.rb → lib/sufia/solr_document_behavior.rb} +6 -7
- data/lib/sufia/user.rb +3 -3
- data/lib/sufia/version.rb +1 -1
- data/lib/tasks/fixtures.rake +38 -38
- data/lib/tasks/resque.rake +1 -0
- data/solr_conf/conf/solrconfig.xml +32 -1615
- data/solr_conf/solr.xml +1 -1
- data/spec/active_fedora/unsaved_digital_object_spec.rb +4 -4
- data/spec/config/host_to_vhost_spec.rb +4 -4
- data/spec/controllers/authorities_controller_spec.rb +1 -1
- data/spec/controllers/batch_controller_spec.rb +12 -10
- data/spec/controllers/catalog_controller_spec.rb +13 -13
- data/spec/controllers/dashboard_controller_spec.rb +15 -15
- data/spec/controllers/downloads_controller_spec.rb +14 -14
- data/spec/controllers/generic_files_controller_spec.rb +88 -46
- data/spec/controllers/mailbox_controller_spec.rb +2 -2
- data/spec/controllers/sessions_controller_spec.rb +1 -1
- data/spec/controllers/single_use_link_controller_spec.rb +18 -18
- data/spec/controllers/users_controller_spec.rb +47 -31
- data/spec/fixtures/countdown.avi +0 -0
- data/spec/fixtures/sufia/.gitignore +1 -0
- data/spec/fixtures/{scholarsphere → sufia}/bg_header.jpg +0 -0
- data/spec/fixtures/sufia/sufia_test1.descMeta.txt +12 -0
- data/spec/fixtures/{scholarsphere → sufia}/sufia_test1.foxml.erb +2 -2
- data/spec/fixtures/{scholarsphere/scholarsphere_test1.txt → sufia/sufia_test1.txt} +0 -0
- data/spec/fixtures/sufia/sufia_test2.descMeta.txt +12 -0
- data/spec/fixtures/{scholarsphere/scholarsphere_test2.docx → sufia/sufia_test2.docx} +0 -0
- data/spec/fixtures/{scholarsphere/scholarsphere_test2.foxml.erb → sufia/sufia_test2.foxml.erb} +6 -6
- data/spec/fixtures/sufia/sufia_test3.descMeta.txt +12 -0
- data/spec/fixtures/{scholarsphere/scholarsphere_test3.foxml.erb → sufia/sufia_test3.foxml.erb} +6 -6
- data/spec/fixtures/{scholarsphere/scholarsphere_test3.xls → sufia/sufia_test3.xls} +0 -0
- data/spec/fixtures/sufia/sufia_test4.descMeta.txt +12 -0
- data/spec/fixtures/{scholarsphere/scholarsphere_test4.foxml.erb → sufia/sufia_test4.foxml.erb} +6 -6
- data/spec/fixtures/{scholarsphere/scholarsphere_test4.pdf → sufia/sufia_test4.pdf} +0 -0
- data/spec/fixtures/sufia/sufia_test5.descMeta.txt +19 -0
- data/spec/fixtures/{scholarsphere → sufia}/sufia_test5.foxml.erb +3 -3
- data/spec/fixtures/{scholarsphere/scholarsphere_test5.mp3 → sufia/sufia_test5.mp3} +0 -0
- data/spec/fixtures/sufia/sufia_test5.txt +1 -0
- data/spec/fixtures/sufia/sufia_test6.descMeta.txt +12 -0
- data/spec/fixtures/{scholarsphere/scholarsphere_test6.foxml.erb → sufia/sufia_test6.foxml.erb} +6 -6
- data/spec/fixtures/{scholarsphere/scholarsphere_test6.jp2 → sufia/sufia_test6.jp2} +0 -0
- data/spec/fixtures/sufia/sufia_test6.txt +1 -0
- data/spec/fixtures/sufia_generic_stub.descMeta.txt +12 -0
- data/spec/fixtures/{scholarsphere_generic_stub.foxml.erb → sufia_generic_stub.foxml.erb} +3 -3
- data/spec/fixtures/sufia_generic_stub.txt +1 -0
- data/spec/lib/sufia/role_mapper_spec.rb +1 -1
- data/spec/models/audit_job_spec.rb +8 -11
- data/spec/models/batch_spec.rb +5 -5
- data/spec/models/batch_update_job_spec.rb +18 -15
- data/spec/models/checksum_audit_log_spec.rb +6 -19
- data/spec/models/event_jobs_spec.rb +23 -23
- data/spec/models/file_content_datastream_spec.rb +14 -14
- data/spec/models/fits_datastream_spec.rb +1 -1
- data/spec/models/generic_file_spec.rb +88 -41
- data/spec/models/single_use_link_spec.rb +3 -3
- data/spec/models/transcode_video_job_spec.rb +30 -0
- data/spec/models/unzip_job_spec.rb +6 -4
- data/spec/rake/{scholarsphere_fixtures_spec.rb → sufia_fixtures_spec.rb} +16 -16
- data/spec/routing/route_spec.rb +4 -8
- data/spec/spec_helper.rb +0 -7
- data/spec/support/Gemfile +4 -2
- data/spec/support/fedora_conf/fedora.fcfg +953 -0
- data/spec/support/lib/generators/test_app_generator.rb +1 -11
- data/sufia.gemspec +5 -3
- data/tasks/{scholarsphere-db.rake → sufia-db.rake} +1 -1
- data/tasks/{scholarsphere-dev.rake → sufia-dev.rake} +7 -3
- data/tasks/{scholarsphere-fixtures.rake → sufia-fixtures.rake} +43 -43
- data/tasks/{scholarsphere.rake → sufia.rake} +2 -2
- metadata +126 -95
- data/app/models/batch_update_job.rb +0 -82
- data/app/models/solr_document.rb +0 -50
- data/lib/sufia/permissions.rb +0 -43
- data/spec/fixtures/scholarsphere/scholarsphere_test1.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere/scholarsphere_test2.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere/scholarsphere_test3.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere/scholarsphere_test4.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere/scholarsphere_test5.descMeta.txt +0 -19
- data/spec/fixtures/scholarsphere/scholarsphere_test5.txt +0 -1
- data/spec/fixtures/scholarsphere/scholarsphere_test6.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere/scholarsphere_test6.txt +0 -1
- data/spec/fixtures/scholarsphere/sufia_scholarsphere1.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere/sufia_scholarsphere1.foxml.erb +0 -79
- data/spec/fixtures/scholarsphere/sufia_scholarsphere1.txt +0 -1
- data/spec/fixtures/scholarsphere_generic_stub.descMeta.txt +0 -12
- data/spec/fixtures/scholarsphere_generic_stub.txt +0 -1
|
@@ -21,7 +21,7 @@ limitations under the License.
|
|
|
21
21
|
|
|
22
22
|
case request.referer
|
|
23
23
|
when /dashboard/
|
|
24
|
-
crumbs << link_to('Dashboard',
|
|
24
|
+
crumbs << link_to('Dashboard', sufia.dashboard_index_path)
|
|
25
25
|
when /files/
|
|
26
26
|
crumbs << link_to('Back to previous', request.referer)
|
|
27
27
|
when /catalog/
|
|
@@ -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
|
-
<%= form_for @generic_file, :url => generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'} do |f| %>
|
|
17
|
+
<%= form_for @generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'} do |f| %>
|
|
18
18
|
<%= hidden_field_tag('generic_file[terms_of_service]', '1') %>
|
|
19
19
|
<%= hidden_field_tag('redirect_tab', 'descriptions') %>
|
|
20
20
|
<div id="descriptions_display">
|
|
@@ -25,8 +25,8 @@ limitations under the License.
|
|
|
25
25
|
<%= f.label :resource_type, "Resource Types", :class=>"control-label", :for=>"resource_type" %>
|
|
26
26
|
<div class="controls">
|
|
27
27
|
<p class="help-block">You may select multiple types to apply<p>
|
|
28
|
-
<%= f.select "resource_type", options_for_select(
|
|
29
|
-
<a href="#" id="generic_file_resource_type_help" rel="popover" data-content="<%=
|
|
28
|
+
<%= f.select "resource_type", options_for_select(Sufia::Engine.config.resource_types.keys, @generic_file.resource_type.to_a), {}, {:multiple=>true, :size=>7} %>
|
|
29
|
+
<a href="#" id="generic_file_resource_type_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help['generic_file_resource_type'] %>" data-original-title="Resource Type"><i class="icon-question-sign icon-large"></i></a>
|
|
30
30
|
</div>
|
|
31
31
|
</div><!-- /control-group -->
|
|
32
32
|
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
<% if key == "description" %>
|
|
19
19
|
<%= f.text_area :description, :name=>"generic_file[#{key}][]", :id => "generic_file_"+key, :value=>v, :class => "input-large" %>
|
|
20
20
|
<% elsif key == "rights" %>
|
|
21
|
-
<% choices =
|
|
21
|
+
<% choices = Sufia::Engine.config.cc_licenses %>
|
|
22
22
|
<% choices = {""=>""}.merge(choices) %>
|
|
23
23
|
<%= f.select "rights", options_for_select(choices, v) %>
|
|
24
24
|
<% elsif key == "resource_type" %>
|
|
25
25
|
<% if (index == 0) %>
|
|
26
26
|
<p class="help-block">You may select multiple types to apply<p>
|
|
27
|
-
<% choices =
|
|
27
|
+
<% choices = Sufia::Engine.config.resource_types.keys %>
|
|
28
28
|
<%= f.select "resource_type", options_for_select(choices, vals.to_a), {}, {:multiple=>true, :size=>7} %>
|
|
29
29
|
<%end%>
|
|
30
30
|
<% else %>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<button class="adder btn" name="additional_<%= key %>" id="additional_<%= key %>_submit">+<span class="accessible-hidden">add another <%= key %></span></button>
|
|
36
36
|
|
|
37
37
|
<% end %>
|
|
38
|
-
<a href="#" id="generic_file_<%= key %>_help" rel="popover" data-content="<%=
|
|
38
|
+
<a href="#" id="generic_file_<%= key %>_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help['generic_file_' + key] %>" data-original-title="<%= label %>"><i class="icon-question-sign icon-large"></i></a>
|
|
39
39
|
<%= render :partial => "generic_files/rights_modal" if key == "rights" %>
|
|
40
40
|
<% elsif (key != "resource_type") %>
|
|
41
41
|
<button class="remover btn" name="additional_<%= key %>" id="additional_<%= key %>_submit">-<span class="accessible-hidden">add another <%= key %></span></button>
|
|
@@ -14,18 +14,19 @@ See the License for the specific language governing permissions and
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
%>
|
|
16
16
|
|
|
17
|
-
<% if
|
|
17
|
+
<% if @generic_file.image? %>
|
|
18
18
|
<a href="<%= sufia.download_path(@generic_file.noid) %>" target="_new"><img src="<%= sufia.download_path(@generic_file.noid) %>" width="338" /></a>
|
|
19
|
-
<% elsif
|
|
19
|
+
<% elsif @generic_file.video? %>
|
|
20
20
|
<video controls="controls" class="video-js vjs-default-skin" data-setup="{}" preload="auto">
|
|
21
|
-
<source src="<%= sufia.download_path(@generic_file.noid) %>" type="
|
|
21
|
+
<source src="<%= sufia.download_path(@generic_file.noid, datastream_id: 'webm') %>" type="video/webm" />
|
|
22
|
+
<source src="<%= sufia.download_path(@generic_file.noid, datastream_id: 'mp4') %>" type="video/mp4" />
|
|
22
23
|
Your browser does not support the audio tag.
|
|
23
24
|
</video>
|
|
24
25
|
<% elsif ['audio/mp3', 'audio/mpeg'].include?(@generic_file.mime_type) %>
|
|
25
26
|
<audio src="<%= sufia.download_path(@generic_file.noid, format:'audio') %>" type="<%= @generic_file.mime_type %>" />
|
|
26
27
|
Your browser does not support the audio tag.
|
|
27
28
|
</audio>
|
|
28
|
-
<% elsif
|
|
29
|
+
<% elsif @generic_file.pdf?%>
|
|
29
30
|
<a href="<%= sufia.download_path(@generic_file.noid) %>" target="_new"><img src="<%= sufia.download_path(@generic_file.noid, {:datastream_id => 'thumbnail'}) %>" width="338" height="493" /></a>
|
|
30
31
|
<% else %>
|
|
31
32
|
<a href="<%= sufia.download_path(@generic_file.noid) %>" target="_new"><img src="/assets/default.png" alt="No preview available" width="338" height="493" /></a>
|
|
@@ -39,7 +39,7 @@ limitations under the License.
|
|
|
39
39
|
</div>
|
|
40
40
|
<div class="modal-body">
|
|
41
41
|
<h3>Visibility</h3>
|
|
42
|
-
<p>This setting will determine who can view your file, and the associated metadata
|
|
42
|
+
<p>This setting will determine who can view your file, and the associated metadata. Setting
|
|
43
43
|
the visibility to <span class="label label-success">Open Access</span> will allow your content to be discovered in Google and viewed by anyone.
|
|
44
44
|
The visibility setting <span class="label label-info"><%=t('sufia.institution_name') %></span> will only allow users who are logged into <%=t('sufia.product_name') %>
|
|
45
45
|
(via WebAccess) to view the content. Files that are marked <span class="label label-important">Private</span> are only able to be viewed
|
|
@@ -98,7 +98,7 @@ limitations under the License.
|
|
|
98
98
|
<div class="input-append">
|
|
99
99
|
<p class="help-block">Enter <%=t('sufia.account_label') %> (one at a time)</p>
|
|
100
100
|
<%= text_field_tag 'new_user_name_skel', nil, :class => "span29" %><span class="add-on">@psu.edu</span>
|
|
101
|
-
<%= select_tag 'new_user_permission_skel', options_for_select(
|
|
101
|
+
<%= select_tag 'new_user_permission_skel', options_for_select(Sufia::Engine.config.permission_levels), :class=> 'span17' %>
|
|
102
102
|
<button class="btn btn-mini btn-inverse" id="add_new_user_skel"><i class="icon-plus-sign"></i> Add</button>
|
|
103
103
|
<br /> <span id="directory_user_result"></span>
|
|
104
104
|
</div>
|
|
@@ -109,7 +109,7 @@ limitations under the License.
|
|
|
109
109
|
<div class="input-append">
|
|
110
110
|
<% @groups.unshift('Select a group') %>
|
|
111
111
|
<%= select_tag 'new_group_name_skel', options_for_select(@groups), :class => 'span38' %>
|
|
112
|
-
<%= select_tag 'new_group_permission_skel', options_for_select(
|
|
112
|
+
<%= select_tag 'new_group_permission_skel', options_for_select(Sufia::Engine.config.permission_levels), :class => 'span17' %>
|
|
113
113
|
<button class="btn btn-mini btn-inverse" id="add_new_group_skel" ><i class="icon-plus-sign"></i> Add</button>
|
|
114
114
|
<br /><span id="directory_group_result"></span>
|
|
115
115
|
</div>
|
|
@@ -124,7 +124,7 @@ limitations under the License.
|
|
|
124
124
|
<tr id="file_permissions">
|
|
125
125
|
<td><%= label_tag :owner_access, "Depositor (<span id=\"file_owner\">#{link_to_profile depositor}</span>)".html_safe, :class=>"control-label" %></td>
|
|
126
126
|
<td>
|
|
127
|
-
<%=
|
|
127
|
+
<%= Sufia::Engine.config.owner_permission_levels.keys[0] %>
|
|
128
128
|
</td>
|
|
129
129
|
</tr>
|
|
130
130
|
<% gf.permissions.each do |permission| %>
|
|
@@ -135,7 +135,7 @@ limitations under the License.
|
|
|
135
135
|
<tr>
|
|
136
136
|
<td><%= label_tag "generic_file[permissions][#{permission[:type]}][#{permission[:name]}]", permission[:name], :class=>"control-label" %></td>
|
|
137
137
|
<td>
|
|
138
|
-
<%= select_tag "generic_file[permissions][#{permission[:type]}][#{permission[:name]}]", options_for_select(
|
|
138
|
+
<%= select_tag "generic_file[permissions][#{permission[:type]}][#{permission[:name]}]", options_for_select(Sufia::Engine.config.permission_levels, permission[:access]), :class=>'span20 select_perm' %>
|
|
139
139
|
<button class="btn close remove_perm">X</button>
|
|
140
140
|
</td>
|
|
141
141
|
</tr>
|
|
@@ -17,7 +17,7 @@ limitations under the License.
|
|
|
17
17
|
<div id="versioning_display">
|
|
18
18
|
<h2 class="non lower">Versions</h2>
|
|
19
19
|
<div class="well">
|
|
20
|
-
<%= form_for @generic_file, :url => generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'} do |f| %>
|
|
20
|
+
<%= form_for @generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'} do |f| %>
|
|
21
21
|
<%= hidden_field_tag('generic_file[terms_of_service]', '1') %>
|
|
22
22
|
<%= hidden_field_tag('redirect_tab', 'versions') %>
|
|
23
23
|
<h3>Upload New Version</h3>
|
|
@@ -84,7 +84,7 @@ $("a[rel=popover]").popover();
|
|
|
84
84
|
</div>
|
|
85
85
|
<div class="span2"> </div>
|
|
86
86
|
<div class="span68">
|
|
87
|
-
<%= link_to "<<Browse view".html_safe, generic_file_path %></li>
|
|
87
|
+
<%= link_to "<<Browse view".html_safe, sufia.generic_file_path %></li>
|
|
88
88
|
<ul class="nav nav-tabs">
|
|
89
89
|
<li id="edit_descriptions_link"><a href="#"><i class="icon-tags"></i> Descriptions</a></li>
|
|
90
90
|
<li id="edit_versioning_link"><a href="#"><i class="icon-sitemap"></i> Versions</a></li>
|
|
@@ -92,7 +92,7 @@ $("a[rel=popover]").popover();
|
|
|
92
92
|
</ul>
|
|
93
93
|
<%= render :partial => "descriptions", :locals => { :generic_file => @generic_file } %>
|
|
94
94
|
|
|
95
|
-
<%= form_for @generic_file, :url => generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'} do |f| %>
|
|
95
|
+
<%= form_for @generic_file, :url => sufia.generic_file_path, :html => {:multipart => true, :class => 'form-horizontal', :id => 'fileupload'} do |f| %>
|
|
96
96
|
<%= hidden_field_tag('redirect_tab', 'permissions') %>
|
|
97
97
|
<%= render :partial => "permission", :locals => { :gf => @generic_file, :f=> f } %>
|
|
98
98
|
<% end %>
|
|
@@ -170,7 +170,7 @@ var addthis_config = {"data_track_addressbar":true};
|
|
|
170
170
|
<th>Rights</th>
|
|
171
171
|
<td>
|
|
172
172
|
<% @generic_file.rights.each do |r| %>
|
|
173
|
-
<%=link_to_field('rights',r,
|
|
173
|
+
<%=link_to_field('rights',r, Sufia::Engine.config.cc_licenses_reverse[r])%> <%= iconify_auto_link(r,false) %><br />
|
|
174
174
|
<% end %>
|
|
175
175
|
</td>
|
|
176
176
|
</tr>
|
|
@@ -257,14 +257,14 @@ var addthis_config = {"data_track_addressbar":true};
|
|
|
257
257
|
<% label = label.humanize %>
|
|
258
258
|
<% if values.is_a? Array %>
|
|
259
259
|
<% length = values.length %>
|
|
260
|
-
<% length =
|
|
260
|
+
<% length = Sufia::Engine.config.fits_message_length-1 if term == :status_message && values.length > Sufia::Engine.config.fits_message_length-1 %>
|
|
261
261
|
<% values[0..length].each_with_index do |value, idx| %>
|
|
262
262
|
<% next if value.empty? %>
|
|
263
263
|
<%= "#{label}: #{value.truncate(250)}" %>
|
|
264
264
|
<%= "<br />".html_safe unless idx == length %>
|
|
265
265
|
<% end %>
|
|
266
266
|
<% if length != values.length %>
|
|
267
|
-
<%= render :partial => "generic_files/extra_fields_modal", :locals=>{:name=>term, :values=> values, :start=>
|
|
267
|
+
<%= render :partial => "generic_files/extra_fields_modal", :locals=>{:name=>term, :values=> values, :start=>Sufia::Engine.config.fits_message_length}%>
|
|
268
268
|
<% end %>
|
|
269
269
|
<% else %>
|
|
270
270
|
<%= "#{label}: #{values.truncate(250)}" %><br />
|
|
@@ -15,7 +15,7 @@ limitations under the License.
|
|
|
15
15
|
%>
|
|
16
16
|
|
|
17
17
|
<h1>Versions</h1>
|
|
18
|
-
<h3>Version <%=
|
|
18
|
+
<h3>Version <%= Sufia::Engine::config.scholarsphere_version %> (<%= Sufia::Engine::config.scholarsphere_release_date %>)</h3>
|
|
19
19
|
<p>
|
|
20
20
|
<ul>
|
|
21
21
|
<li>Added batch edit and delete</li>
|
|
@@ -27,7 +27,7 @@ $("a[rel=popover]").popover();
|
|
|
27
27
|
|
|
28
28
|
<h1>Edit Profile</h1>
|
|
29
29
|
<div class="span45 well">
|
|
30
|
-
<%= form_for @user, :url => update_profile_path(@user.
|
|
30
|
+
<%= form_for @user, :url => sufia.update_profile_path(URI.escape(@user.to_s, '@.')), :html => {:multipart => true, :class => 'form-horizontal' } do |f| %>
|
|
31
31
|
<div class="control-group">
|
|
32
32
|
<%= f.label :avatar, '<i class="icon-camera-retro"></i> Change picture'.html_safe, :class => "control-label" %>
|
|
33
33
|
<div class="controls">
|
|
@@ -93,8 +93,10 @@ $("a[rel=popover]").popover();
|
|
|
93
93
|
<hr />
|
|
94
94
|
|
|
95
95
|
<h3><i class="icon-group"></i> User Managed Groups Info (UMG) <%= link_to 'Manage UMG', 'http://umg.its.psu.edu/', :class => 'btn btn-mini btn-primary' %> </h3>
|
|
96
|
-
<% @groups
|
|
97
|
-
|
|
96
|
+
<% if @groups %>
|
|
97
|
+
<% @groups.each do |g| %>
|
|
98
|
+
<i class="icon-caret-right"></i> <%= g %><br />
|
|
99
|
+
<% end %>
|
|
98
100
|
<% end %>
|
|
99
101
|
</div>
|
|
100
102
|
|
|
@@ -32,9 +32,9 @@ limitations under the License.
|
|
|
32
32
|
<tbody>
|
|
33
33
|
<% @users.each do |user| %>
|
|
34
34
|
<tr class="<%= cycle("","zebra") %>">
|
|
35
|
-
<td><a href="<%= profile_path(user.login) %>" class="btn btn-small " ><%= image_tag user.avatar.url(:thumb), :width => 30 %></a></td>
|
|
36
|
-
<td ><a href="<%= profile_path(user.login) %>" ><%= user.name %><a></td>
|
|
37
|
-
<td><a href="<%= profile_path(user.login) %>" ><%= user.login %><a></td>
|
|
35
|
+
<td><a href="<%= sufia.profile_path(URI.escape(user.login,'@.'i)) %>" class="btn btn-small " ><%= image_tag user.avatar.url(:thumb), :width => 30 %></a></td>
|
|
36
|
+
<td ><a href="<%= sufia.profile_path(URI.escape(user.login,'@.'i)) %>" ><%= user.name %><a></td>
|
|
37
|
+
<td><a href="<%= sufia.profile_path(URI.escape(user.login,'@.'i)) %>" ><%= user.login %><a></td>
|
|
38
38
|
<td><%= user.department %> </td>
|
|
39
39
|
<td><%= GenericFile.find(:depositor_t => user.to_s).count %> </td>
|
|
40
40
|
</tr>
|
|
@@ -17,18 +17,18 @@ limitations under the License.
|
|
|
17
17
|
<h1 class="span110">
|
|
18
18
|
<span class="span60">
|
|
19
19
|
<%= image_tag @user.avatar.url(:thumb), :width => 100 %>
|
|
20
|
-
<%= @user.name %> (<%= @user.
|
|
20
|
+
<%= @user.name %> (<%= @user.user_key %>)
|
|
21
21
|
</span>
|
|
22
22
|
|
|
23
23
|
<span class="span20 offset20">
|
|
24
24
|
<% if not signed_in? %>
|
|
25
25
|
<!-- sign in to access social functions -->
|
|
26
26
|
<% elsif current_user == @user %>
|
|
27
|
-
<a class="btn btn-primary" href="<%= edit_profile_path(@user.to_s) %>"><i class="icon-edit"></i> Edit Your Profile </a>
|
|
27
|
+
<a class="btn btn-primary" href="<%= sufia.edit_profile_path(URI.escape(@user.to_s, '@.')) %>"><i class="icon-edit"></i> Edit Your Profile </a>
|
|
28
28
|
<% elsif current_user.following?(@user) %>
|
|
29
|
-
<a class="btn btn-primary" href="<%= unfollow_user_path(@user.to_s) %>"><i class="icon-eye-close"></i> Unfollow </a>
|
|
29
|
+
<a class="btn btn-primary" href="<%= sufia.unfollow_user_path(@user.to_s) %>"><i class="icon-eye-close"></i> Unfollow </a>
|
|
30
30
|
<% else %>
|
|
31
|
-
<a class="btn btn-primary" href="<%= follow_user_path(@user.to_s) %>"><i class="icon-eye-open"></i> Follow</a>
|
|
31
|
+
<a class="btn btn-primary" href="<%= sufia.follow_user_path(@user.to_s) %>"><i class="icon-eye-open"></i> Follow</a>
|
|
32
32
|
<% end %>
|
|
33
33
|
</span>
|
|
34
34
|
</h1>
|
|
@@ -48,7 +48,7 @@ limitations under the License.
|
|
|
48
48
|
<ul class="thumbnails">
|
|
49
49
|
<% @followers.each do |f| %>
|
|
50
50
|
<li class="span8">
|
|
51
|
-
<%= link_to(image_tag(f.avatar.url(:thumb)), profile_path(f.login), { :title => f.name } ) %>
|
|
51
|
+
<%= link_to(image_tag(f.avatar.url(:thumb)), sufia.profile_path(f.login), { :title => f.name } ) %>
|
|
52
52
|
<li>
|
|
53
53
|
<% end %>
|
|
54
54
|
</ul>
|
|
@@ -59,7 +59,7 @@ limitations under the License.
|
|
|
59
59
|
<ul class="thumbnails">
|
|
60
60
|
<% @following.each do |f| %>
|
|
61
61
|
<li class="span8">
|
|
62
|
-
<%= link_to(image_tag(f.avatar.url(:thumb)), profile_path(f.login), { :title => f.name } ) %>
|
|
62
|
+
<%= link_to(image_tag(f.avatar.url(:thumb)), sufia.profile_path(f.login), { :title => f.name } ) %>
|
|
63
63
|
<li>
|
|
64
64
|
<% end %>
|
|
65
65
|
</ul>
|
data/config/jetty.yml
ADDED
data/config/routes.rb
CHANGED
|
@@ -20,7 +20,6 @@ Sufia::Engine.routes.draw do
|
|
|
20
20
|
member do
|
|
21
21
|
get 'citation', :as => :citation
|
|
22
22
|
post 'audit'
|
|
23
|
-
post 'permissions'
|
|
24
23
|
end
|
|
25
24
|
end
|
|
26
25
|
|
|
@@ -46,9 +45,14 @@ Sufia::Engine.routes.draw do
|
|
|
46
45
|
match 'users/:uid/unfollow' => 'users#unfollow', :as => :unfollow_user
|
|
47
46
|
|
|
48
47
|
# Dashboard routes (based partly on catalog routes)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
resources 'dashboard', :only=>:index do
|
|
49
|
+
collection do
|
|
50
|
+
get 'page/:page', :action => :index
|
|
51
|
+
get 'activity', :action => :activity, :as => :dashboard_activity
|
|
52
|
+
get 'facet/:id', :action => :facet, :as => :dashboard_facet
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
52
56
|
|
|
53
57
|
# advanced routes for advanced search
|
|
54
58
|
match 'search' => 'advanced#index', :as => :advanced
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
Feature: Browse Dashboard files
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
Scenario: Browse via Fixtures
|
|
4
|
-
Given I load scholarsphere fixtures
|
|
5
5
|
Given I am logged in as "archivist2@example.com"
|
|
6
6
|
And I follow "dashboard"
|
|
7
7
|
And I follow "more Keywords"
|
|
8
8
|
And I follow "keyf"
|
|
9
9
|
Then I should see "Test mp3"
|
|
10
|
+
|
|
11
|
+
Scenario: Edit Dashboard File
|
|
12
|
+
Given I am logged in as "archivist2@example.com"
|
|
13
|
+
And I follow "dashboard"
|
|
14
|
+
When I follow the link within
|
|
15
|
+
"""
|
|
16
|
+
a[href="/files/test5/edit"]
|
|
17
|
+
"""
|
|
18
|
+
Then I should see "Edit Test mp3"
|
|
19
|
+
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
Feature: Browse files
|
|
2
2
|
|
|
3
3
|
Scenario: Browse via Fixtures
|
|
4
|
-
Given I load
|
|
4
|
+
# Given I load sufia fixtures
|
|
5
5
|
When I go to the home page
|
|
6
6
|
And I follow "more Keyword"
|
|
7
7
|
And I follow "test"
|
|
8
|
-
Then I should see "
|
|
8
|
+
Then I should see "1 - 4 of 4"
|
|
9
9
|
When I follow "Test Document PDF"
|
|
10
10
|
Then I should see "Download"
|
|
11
11
|
But I should not see "Edit"
|
|
12
|
-
Given I am logged in as "archivist1"
|
|
13
|
-
|
|
14
|
-
And I follow "
|
|
12
|
+
Given I am logged in as "archivist1@example.com"
|
|
13
|
+
And I follow "more Keyword"
|
|
14
|
+
And I follow "test"
|
|
15
|
+
When I follow "Test Document PDF"
|
|
15
16
|
And I should see "Edit"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
Feature: Sending an email via the contact form
|
|
2
2
|
|
|
3
3
|
Scenario: Input info to contact form and send
|
|
4
|
+
# this step allows delivery even if the mail server is down
|
|
5
|
+
Given I have a mail server
|
|
4
6
|
Given I am on the home page
|
|
5
7
|
When I follow "Contact"
|
|
6
8
|
Then I should see "Contact Form"
|
|
@@ -11,6 +13,8 @@ Feature: Sending an email via the contact form
|
|
|
11
13
|
And I select "Depositing content" from "contact_form_category"
|
|
12
14
|
And I press "Send"
|
|
13
15
|
Then I should see "Thank you"
|
|
16
|
+
# this step allows the delivery to go back to normal
|
|
17
|
+
Then I reset the mail server
|
|
14
18
|
|
|
15
19
|
Scenario: Input no selection for contact type
|
|
16
20
|
Given I am on the home page
|
|
@@ -31,12 +31,15 @@ Feature: As an authenticate and authorized
|
|
|
31
31
|
Then I should not see "Dashboard"
|
|
32
32
|
Then the "search-field-header" field should contain "ss search"
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
@culerity
|
|
35
35
|
Scenario: I have files on my dashboard I should see icons
|
|
36
|
-
Given I load
|
|
36
|
+
#Given I load sufia fixtures
|
|
37
37
|
And I am logged in as "archivist1@example.com"
|
|
38
38
|
And I follow "dashboard"
|
|
39
39
|
Then I should see "Test Document Text"
|
|
40
|
-
|
|
40
|
+
When I follow the link within
|
|
41
|
+
"""
|
|
42
|
+
a[href="/files/test3"].itemtrash
|
|
43
|
+
"""
|
|
41
44
|
Then I should see "The file has been deleted"
|
|
42
45
|
|
|
@@ -11,11 +11,11 @@ Feature: Uploading files via web form
|
|
|
11
11
|
And I should see "Cancel upload"
|
|
12
12
|
And I should see a file chooser button
|
|
13
13
|
|
|
14
|
-
@
|
|
14
|
+
@celerity
|
|
15
15
|
Scenario: Upload a file without checking terms of service
|
|
16
16
|
Given I am logged in as "contentauthor@psu.edu"
|
|
17
17
|
When I am on the "ingest" page
|
|
18
18
|
And I attach the file "spec/fixtures/image.jp2" to "files[]"
|
|
19
|
-
And I attach the file "spec/fixtures/
|
|
19
|
+
And I attach the file "spec/fixtures/jp2_fits.xml" to "files[]"
|
|
20
20
|
And I press "Start upload"
|
|
21
21
|
Then I should see "You must accept the terms of service!"
|
|
@@ -22,13 +22,14 @@ def activefedora_path
|
|
|
22
22
|
Gem.loaded_specs['active-fedora'].full_gem_path
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
Given /^I load
|
|
25
|
+
Given /^I load sufia fixtures$/ do
|
|
26
26
|
@rake = Rake::Application.new
|
|
27
27
|
Rake.application = @rake
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
Rake.application.rake_require("tasks/sufia-fixtures", ["."], loaded_files_excluding_current_rake_file)
|
|
29
|
+
Rake.application.rake_require("lib/tasks/fixtures", ["."], loaded_files_excluding_current_rake_file)
|
|
30
|
+
Rake.application.rake_require("lib/tasks/active_fedora", [activefedora_path], loaded_files_excluding_current_rake_file)
|
|
30
31
|
Rake::Task.define_task(:environment)
|
|
31
|
-
@rake['
|
|
32
|
-
@rake['
|
|
32
|
+
@rake['sufia:fixtures:refresh'].invoke
|
|
33
|
+
@rake['sufia:fixtures:fix'].invoke
|
|
33
34
|
end
|
|
34
35
|
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
|
-
|
|
15
14
|
When /^I attach a file "([^"]*)" to the dynamically created "([^"]*)"$/ do |path, field|
|
|
16
15
|
find(field).native.send_keys(File.expand_path(path, Rails.root))
|
|
17
16
|
end
|
|
@@ -20,6 +19,23 @@ Given /^And I click the anchor "([^"]*)"$/ do |link|
|
|
|
20
19
|
click_link(link)
|
|
21
20
|
end
|
|
22
21
|
|
|
22
|
+
Given /^And I click within the anchor "(.*?)"$/ do |selector|
|
|
23
|
+
#Given /^(?:|I )click within the anchor "([^"]*)"$/ do |selector|
|
|
24
|
+
find(selector).click
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
Given /^I have a mail server$/ do
|
|
28
|
+
ContactForm.any_instance.stubs(:deliver).returns(true)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
Then /^I reset the mail server$/ do
|
|
32
|
+
ContactForm.any_instance.unstub(:deliver)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
When /^I follow the link within$/ do |selector|
|
|
36
|
+
find(selector).click
|
|
37
|
+
end
|
|
38
|
+
|
|
23
39
|
# tests wether a select option is choosen
|
|
24
40
|
Then /^"([^"]*)" should be selected for "([^"]*)"(?: within "([^\"]*)")?$/ do |value, field, selector|
|
|
25
41
|
with_scope(selector) do
|
|
@@ -42,3 +58,10 @@ Then /^"([^\"]*)" should( not)? be disabled$/ do |label, negate|
|
|
|
42
58
|
end
|
|
43
59
|
["false", "", nil].send(negate ? :should : :should_not, include(field[:disabled]))
|
|
44
60
|
end
|
|
61
|
+
|
|
62
|
+
Given /^I load users$/ do
|
|
63
|
+
FactoryGirl.create(:user)
|
|
64
|
+
FactoryGirl.create(:archivist)
|
|
65
|
+
FactoryGirl.create(:curator)
|
|
66
|
+
end
|
|
67
|
+
|