sufia 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/README.md +6 -2
- data/app/assets/javascripts/sufia.js +1 -0
- data/app/assets/javascripts/sufia/trophy.js +26 -0
- data/app/assets/stylesheets/sufia.css.scss +1 -0
- data/app/assets/stylesheets/trophy.css +7 -0
- data/app/controllers/batch_controller.rb +1 -1
- data/app/controllers/batch_edits_controller.rb +3 -3
- data/app/controllers/single_use_link_controller.rb +9 -17
- data/app/controllers/users_controller.rb +33 -4
- data/app/helpers/generic_file_helper.rb +57 -5
- data/{lib/devise/models/http_header_authenticatable.rb → app/helpers/trophy_helper.rb} +11 -13
- data/app/models/datastreams/batch_rdf_datastream.rb +0 -1
- data/app/models/datastreams/generic_file_rdf_datastream.rb +0 -1
- data/app/models/trophy.rb +12 -0
- data/app/views/_user_util_links.html.erb +1 -1
- data/app/views/batch/edit.html.erb +2 -2
- data/app/views/batch_edits/{_delete_selected → _delete_selected.html.erb} +1 -1
- data/app/views/batch_edits/_metadata.html.erb +16 -15
- data/app/views/batch_edits/edit.html.erb +15 -23
- data/app/views/catalog/_recent_document.html.erb +2 -5
- data/app/views/dashboard/_index_partials/_default_group.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_list_files.html.erb +7 -3
- data/app/views/dashboard/index.html.erb +7 -7
- data/app/views/error/404.html.erb +1 -1
- data/app/views/error/500.html.erb +1 -1
- data/app/views/generic_files/_descriptions.html.erb +3 -18
- data/app/views/generic_files/_field_form.html.erb +17 -0
- data/app/views/generic_files/_rights_modal.html.erb +1 -1
- data/app/views/generic_files/edit_fields/_default.html.erb +7 -0
- data/app/views/generic_files/edit_fields/_description.html.erb +6 -0
- data/app/views/generic_files/edit_fields/_rights.html.erb +8 -0
- data/app/views/generic_files/edit_fields/_suffix.html.erb +9 -0
- data/app/views/generic_files/edit_fields/_type.html.erb +9 -0
- data/app/views/single_use_link/show.html.erb +5 -11
- data/app/views/static/versions.html.erb +14 -0
- data/app/views/users/_trophy_edit.html.erb +21 -0
- data/app/views/users/edit.html.erb +3 -0
- data/app/views/users/index.html.erb +1 -1
- data/app/views/users/show.html.erb +9 -2
- data/config/locales/sufia.en.yml +24 -0
- data/config/routes.rb +8 -6
- data/features/support/cleanup.rb +2 -2
- data/lib/generators/sufia/sufia_generator.rb +1 -1
- data/lib/generators/sufia/templates/config/sufia.rb +0 -37
- data/lib/generators/sufia/templates/migrations/create_trophies.rb +10 -0
- data/lib/sufia/downloads_controller_behavior.rb +7 -9
- data/lib/sufia/files_controller_behavior.rb +4 -4
- data/lib/sufia/generic_file.rb +21 -27
- data/lib/sufia/jobs/batch_update_job.rb +1 -1
- data/lib/sufia/user.rb +23 -1
- data/lib/sufia/version.rb +1 -1
- data/lib/tasks/fixtures.rake +2 -3
- data/spec/controllers/generic_files_controller_spec.rb +7 -0
- data/spec/controllers/single_use_link_controller_spec.rb +0 -2
- data/spec/controllers/users_controller_spec.rb +28 -2
- data/spec/helpers/generic_file_helper_spec.rb +21 -0
- data/spec/models/generic_file_spec.rb +21 -5
- data/spec/models/trophy_spec.rb +26 -0
- data/spec/models/user_spec.rb +2 -2
- data/spec/routing/route_spec.rb +11 -11
- data/spec/support/Gemfile +2 -4
- data/sufia.gemspec +1 -0
- metadata +35 -15
- data/app/controllers/sessions_controller.rb +0 -30
- data/app/views/batch/_metadata.html.erb +0 -195
- data/app/views/generic_files/_field_form +0 -46
- data/lib/devise/strategies/http_header_authenticatable.rb +0 -43
- data/lib/generators/sufia/templates/config/devise.rb +0 -222
- data/lib/redirect_to_web_access_failure.rb +0 -27
- data/lib/sufia/http_header_auth.rb +0 -60
- data/spec/config/host_to_vhost_spec.rb +0 -38
- data/spec/controllers/sessions_controller_spec.rb +0 -44
@@ -15,10 +15,25 @@
|
|
15
15
|
require 'spec_helper'
|
16
16
|
|
17
17
|
describe GenericFile do
|
18
|
-
before
|
18
|
+
before do
|
19
19
|
@file = GenericFile.new
|
20
20
|
@file.apply_depositor_metadata('jcoyne')
|
21
21
|
end
|
22
|
+
|
23
|
+
describe "terms_for_editing" do
|
24
|
+
it "should return a list" do
|
25
|
+
@file.terms_for_editing.should == [ :contributor, :creator, :title, :description, :publisher,
|
26
|
+
:date_created, :subject, :language, :rights, :identifier, :based_near, :tag, :related_url]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
describe "terms_for_display" do
|
30
|
+
it "should return a list" do
|
31
|
+
@file.terms_for_display.should == [ :part_of, :contributor, :creator, :title, :description,
|
32
|
+
:publisher, :date_created, :date_uploaded, :date_modified,:subject, :language, :rights,
|
33
|
+
:resource_type, :identifier, :based_near, :tag, :related_url]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
22
37
|
describe "attributes" do
|
23
38
|
it "should have rightsMetadata" do
|
24
39
|
@file.rightsMetadata.should be_instance_of ParanoidRightsDatastream
|
@@ -182,9 +197,9 @@ describe GenericFile do
|
|
182
197
|
@file.title = "The Work"
|
183
198
|
@file.description = "The work by Allah"
|
184
199
|
@file.publisher = "Vertigo Comics"
|
185
|
-
@file.date_created = "1200"
|
186
|
-
@file.date_uploaded = "2011"
|
187
|
-
@file.date_modified = "2012"
|
200
|
+
@file.date_created = "1200-01-01"
|
201
|
+
@file.date_uploaded = "2011-01-01"
|
202
|
+
@file.date_modified = "2012-01-01"
|
188
203
|
@file.subject = "Theology"
|
189
204
|
@file.language = "Arabic"
|
190
205
|
@file.rights = "Wide open, buddy."
|
@@ -208,12 +223,13 @@ describe GenericFile do
|
|
208
223
|
local["generic_file__publisher_t"].should == ["Vertigo Comics"]
|
209
224
|
local["generic_file__subject_t"].should == ["Theology"]
|
210
225
|
local["generic_file__language_t"].should == ["Arabic"]
|
211
|
-
local["generic_file__date_created_t"].should == ["1200"]
|
226
|
+
local["generic_file__date_created_t"].should == ["1200-01-01"]
|
212
227
|
local["generic_file__resource_type_t"].should == ["Book"]
|
213
228
|
local["file_format_t"].should == "jpeg (JPEG Image)"
|
214
229
|
local["generic_file__identifier_t"].should == ["urn:isbn:1234567890"]
|
215
230
|
local["generic_file__based_near_t"].should == ["Medina, Saudi Arabia"]
|
216
231
|
local["mime_type_t"].should == ["image/jpeg"]
|
232
|
+
local["noid_s"].should == "__DO_NOT_USE__"
|
217
233
|
end
|
218
234
|
it "should support multi-valued fields in solr" do
|
219
235
|
@file.tag = ["tag1", "tag2"]
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Trophy do
|
4
|
+
before(:all) do
|
5
|
+
@trophy = Trophy.create(user_id:99,generic_file_id:"99")
|
6
|
+
end
|
7
|
+
after(:all) do
|
8
|
+
@trophy.delete
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should have a user" do
|
12
|
+
@trophy.should respond_to(:user_id)
|
13
|
+
@trophy.user_id.should == 99
|
14
|
+
end
|
15
|
+
it "should have a file" do
|
16
|
+
@trophy.should respond_to(:generic_file_id)
|
17
|
+
@trophy.generic_file_id.should == "99"
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should not allow six trophies" do
|
21
|
+
(1..6).each {|n| Trophy.create(user_id:120,generic_file_id:n.to_s)}
|
22
|
+
Trophy.where(user_id:120).count.should == 5
|
23
|
+
Trophy.where(user_id:120).map(&:delete)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
data/spec/models/user_spec.rb
CHANGED
@@ -43,8 +43,8 @@ describe User do
|
|
43
43
|
@user.should respond_to(:facebook_handle)
|
44
44
|
@user.should respond_to(:googleplus_handle)
|
45
45
|
end
|
46
|
-
it "should redefine to_param to make redis keys more recognizable" do
|
47
|
-
@user.to_param.should == @
|
46
|
+
it "should redefine to_param to make redis keys more recognizable (and useable within Rails URLs)" do
|
47
|
+
@user.to_param.should == "jilluser@example-dot-com"
|
48
48
|
end
|
49
49
|
it "should have a cancan ability defined" do
|
50
50
|
@user.should respond_to(:can?)
|
data/spec/routing/route_spec.rb
CHANGED
@@ -15,7 +15,12 @@
|
|
15
15
|
require 'spec_helper'
|
16
16
|
|
17
17
|
describe 'Routes' do
|
18
|
-
before(:each)
|
18
|
+
before(:each) do
|
19
|
+
@routes = Sufia::Engine.routes
|
20
|
+
# so we have to do this instead:
|
21
|
+
# engine routes broke in rspec rails 2.12.1, so we had to add this:
|
22
|
+
assertion_instance.instance_variable_set(:@routes, @routes)
|
23
|
+
end
|
19
24
|
describe 'Catalog' do
|
20
25
|
|
21
26
|
it 'should route the root url to the catalog controller' do
|
@@ -81,16 +86,6 @@ describe 'Routes' do
|
|
81
86
|
end
|
82
87
|
end
|
83
88
|
|
84
|
-
describe 'Sessions' do
|
85
|
-
it "should route to logout" do
|
86
|
-
{ get: '/logout' }.should route_to(controller: 'sessions', action: 'destroy')
|
87
|
-
end
|
88
|
-
|
89
|
-
it "should route to login" do
|
90
|
-
{ get: '/login' }.should route_to(controller: 'sessions', action: 'new')
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
89
|
describe 'Dashboard' do
|
95
90
|
it "should route to dashboard" do
|
96
91
|
{ get: '/dashboard' }.should route_to(controller: 'dashboard', action: 'index')
|
@@ -100,6 +95,8 @@ describe 'Routes' do
|
|
100
95
|
{ get: '/dashboard/facet/1' }.should route_to(controller: 'dashboard', action: 'facet', id: '1')
|
101
96
|
end
|
102
97
|
|
98
|
+
|
99
|
+
|
103
100
|
it "should route to dashboard activity" do
|
104
101
|
{ get: '/dashboard/activity' }.should route_to(controller: 'dashboard', action: 'activity')
|
105
102
|
end
|
@@ -118,6 +115,9 @@ describe 'Routes' do
|
|
118
115
|
end
|
119
116
|
|
120
117
|
describe 'Users' do
|
118
|
+
it 'should route to user trophies' do
|
119
|
+
{ post: '/users/bob135/trophy' }.should route_to(controller: 'users', action: 'toggle_trophy', uid: 'bob135')
|
120
|
+
end
|
121
121
|
it 'should route to user profile' do
|
122
122
|
{ get: '/users/bob135' }.should route_to(controller: 'users', action: 'show', uid: 'bob135')
|
123
123
|
end
|
data/spec/support/Gemfile
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
gem 'rails', '3.2.
|
3
|
+
gem 'rails', '3.2.11'
|
4
4
|
|
5
5
|
gem 'sqlite3'
|
6
6
|
|
7
7
|
gem 'devise'
|
8
8
|
gem 'blacklight'
|
9
|
-
|
10
|
-
gem 'hydra-head', github: 'projecthydra/hydra-head', ref: 'd60913b' #pre5.2
|
11
|
-
|
9
|
+
gem "hydra-head", github: 'projecthydra/hydra-head', ref: '5ee4e26' # 5.2.0+ (doesn't generate solr_mappings.yml)
|
12
10
|
|
13
11
|
gem 'sufia', :path=>'../../'
|
14
12
|
gem 'rspec-rails', :group=>:test
|
data/sufia.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_dependency 'blacklight', '~> 4.0.0'
|
20
20
|
gem.add_dependency 'blacklight_advanced_search'
|
21
21
|
gem.add_dependency "hydra-head", "~> 5.2"
|
22
|
+
gem.add_dependency "active-fedora", "~> 5.5.0.rc1"
|
22
23
|
|
23
24
|
gem.add_dependency 'noid', '0.5.5'
|
24
25
|
gem.add_dependency 'hydra-batch-edit', '~> 0.1.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sufia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -75,6 +75,22 @@ dependencies:
|
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '5.2'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: active-fedora
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 5.5.0.rc1
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 5.5.0.rc1
|
78
94
|
- !ruby/object:Gem::Dependency
|
79
95
|
name: noid
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -490,6 +506,7 @@ files:
|
|
490
506
|
- app/assets/javascripts/sufia.js
|
491
507
|
- app/assets/javascripts/sufia/permissions.js
|
492
508
|
- app/assets/javascripts/sufia/tabs.js
|
509
|
+
- app/assets/javascripts/sufia/trophy.js
|
493
510
|
- app/assets/javascripts/terms_of_service.js
|
494
511
|
- app/assets/stylesheets/blacklight_more_facets.css
|
495
512
|
- app/assets/stylesheets/bootstrap.min.css
|
@@ -506,6 +523,7 @@ files:
|
|
506
523
|
- app/assets/stylesheets/reset_body.css
|
507
524
|
- app/assets/stylesheets/scholarsphere-bootstrap.css
|
508
525
|
- app/assets/stylesheets/sufia.css.scss
|
526
|
+
- app/assets/stylesheets/trophy.css
|
509
527
|
- app/assets/stylesheets/video-js.css
|
510
528
|
- app/controllers/authorities_controller.rb
|
511
529
|
- app/controllers/batch_controller.rb
|
@@ -517,7 +535,6 @@ files:
|
|
517
535
|
- app/controllers/errors_controller.rb
|
518
536
|
- app/controllers/generic_files_controller.rb
|
519
537
|
- app/controllers/mailbox_controller.rb
|
520
|
-
- app/controllers/sessions_controller.rb
|
521
538
|
- app/controllers/single_use_link_controller.rb
|
522
539
|
- app/controllers/static_controller.rb
|
523
540
|
- app/controllers/users_controller.rb
|
@@ -526,6 +543,7 @@ files:
|
|
526
543
|
- app/helpers/contact_form_helper.rb
|
527
544
|
- app/helpers/generic_file_helper.rb
|
528
545
|
- app/helpers/sufia_helper.rb
|
546
|
+
- app/helpers/trophy_helper.rb
|
529
547
|
- app/models/batch.rb
|
530
548
|
- app/models/checksum_audit_log.rb
|
531
549
|
- app/models/contact_form.rb
|
@@ -544,6 +562,7 @@ files:
|
|
544
562
|
- app/models/local_authority_entry.rb
|
545
563
|
- app/models/single_use_link.rb
|
546
564
|
- app/models/subject_local_authority_entry.rb
|
565
|
+
- app/models/trophy.rb
|
547
566
|
- app/models/version_committer.rb
|
548
567
|
- app/views/_add_assets_links.html.erb
|
549
568
|
- app/views/_flash_msg.html.erb
|
@@ -559,10 +578,9 @@ files:
|
|
559
578
|
- app/views/advanced/_facet_layout.html.erb
|
560
579
|
- app/views/advanced/_facet_limit.html.erb
|
561
580
|
- app/views/advanced/index.html.erb
|
562
|
-
- app/views/batch/_metadata.html.erb
|
563
581
|
- app/views/batch/edit.html.erb
|
564
582
|
- app/views/batch_edits/_check_all.html.erb
|
565
|
-
- app/views/batch_edits/_delete_selected
|
583
|
+
- app/views/batch_edits/_delete_selected.html.erb
|
566
584
|
- app/views/batch_edits/_metadata.html.erb
|
567
585
|
- app/views/batch_edits/edit.html.erb
|
568
586
|
- app/views/batch_edits/update_edit.js.erb
|
@@ -653,7 +671,7 @@ files:
|
|
653
671
|
- app/views/generic_files/_breadcrumbs.html.erb
|
654
672
|
- app/views/generic_files/_descriptions.html.erb
|
655
673
|
- app/views/generic_files/_extra_fields_modal.html.erb
|
656
|
-
- app/views/generic_files/_field_form
|
674
|
+
- app/views/generic_files/_field_form.html.erb
|
657
675
|
- app/views/generic_files/_groups_description.html.erb
|
658
676
|
- app/views/generic_files/_media_display.html.erb
|
659
677
|
- app/views/generic_files/_multiple_upload.html.erb
|
@@ -665,6 +683,11 @@ files:
|
|
665
683
|
- app/views/generic_files/_versioning.html.erb
|
666
684
|
- app/views/generic_files/citation.html.erb
|
667
685
|
- app/views/generic_files/edit.html.erb
|
686
|
+
- app/views/generic_files/edit_fields/_default.html.erb
|
687
|
+
- app/views/generic_files/edit_fields/_description.html.erb
|
688
|
+
- app/views/generic_files/edit_fields/_rights.html.erb
|
689
|
+
- app/views/generic_files/edit_fields/_suffix.html.erb
|
690
|
+
- app/views/generic_files/edit_fields/_type.html.erb
|
668
691
|
- app/views/generic_files/new.html.erb
|
669
692
|
- app/views/generic_files/show.html.erb
|
670
693
|
- app/views/kaminari/blacklight/_first_page.html.erb
|
@@ -692,6 +715,7 @@ files:
|
|
692
715
|
- app/views/users/_notify_link.html.erb
|
693
716
|
- app/views/users/_notify_number.html.erb
|
694
717
|
- app/views/users/_search_form.html.erb
|
718
|
+
- app/views/users/_trophy_edit.html.erb
|
695
719
|
- app/views/users/_user_info.html.erb
|
696
720
|
- app/views/users/edit.html.erb
|
697
721
|
- app/views/users/index.html.erb
|
@@ -722,13 +746,10 @@ files:
|
|
722
746
|
- fedora_conf/conf/development/fedora.fcfg
|
723
747
|
- fedora_conf/conf/test/fedora.fcfg
|
724
748
|
- lib/active_support/core_ext/marshal.rb
|
725
|
-
- lib/devise/models/http_header_authenticatable.rb
|
726
|
-
- lib/devise/strategies/http_header_authenticatable.rb
|
727
749
|
- lib/generators/sufia/sufia_generator.rb
|
728
750
|
- lib/generators/sufia/templates/catalog_controller.rb
|
729
751
|
- lib/generators/sufia/templates/config/action_dispatch_http_upload_monkey_patch.rb
|
730
752
|
- lib/generators/sufia/templates/config/clamav.rb
|
731
|
-
- lib/generators/sufia/templates/config/devise.rb
|
732
753
|
- lib/generators/sufia/templates/config/hydra_config.rb
|
733
754
|
- lib/generators/sufia/templates/config/mailboxer.rb
|
734
755
|
- lib/generators/sufia/templates/config/redis.yml
|
@@ -744,9 +765,9 @@ files:
|
|
744
765
|
- lib/generators/sufia/templates/migrations/create_checksum_audit_logs.rb
|
745
766
|
- lib/generators/sufia/templates/migrations/create_local_authorities.rb
|
746
767
|
- lib/generators/sufia/templates/migrations/create_single_use_links.rb
|
768
|
+
- lib/generators/sufia/templates/migrations/create_trophies.rb
|
747
769
|
- lib/generators/sufia/templates/migrations/create_version_committers.rb
|
748
770
|
- lib/kaminari/helpers/tag.rb
|
749
|
-
- lib/redirect_to_web_access_failure.rb
|
750
771
|
- lib/sufia.rb
|
751
772
|
- lib/sufia/active_fedora/redis.rb
|
752
773
|
- lib/sufia/active_record/redis.rb
|
@@ -762,7 +783,6 @@ files:
|
|
762
783
|
- lib/sufia/generic_file/export.rb
|
763
784
|
- lib/sufia/generic_file/permissions.rb
|
764
785
|
- lib/sufia/generic_file/thumbnail.rb
|
765
|
-
- lib/sufia/http_header_auth.rb
|
766
786
|
- lib/sufia/id_service.rb
|
767
787
|
- lib/sufia/jobs/audit_job.rb
|
768
788
|
- lib/sufia/jobs/batch_update_job.rb
|
@@ -796,7 +816,6 @@ files:
|
|
796
816
|
- solr_conf/solr.xml
|
797
817
|
- spec/.gitignore
|
798
818
|
- spec/active_fedora/unsaved_digital_object_spec.rb
|
799
|
-
- spec/config/host_to_vhost_spec.rb
|
800
819
|
- spec/controllers/_sort_and_per_page.html.erb
|
801
820
|
- spec/controllers/authorities_controller_spec.rb
|
802
821
|
- spec/controllers/batch_controller_spec.rb
|
@@ -805,7 +824,6 @@ files:
|
|
805
824
|
- spec/controllers/downloads_controller_spec.rb
|
806
825
|
- spec/controllers/generic_files_controller_spec.rb
|
807
826
|
- spec/controllers/mailbox_controller_spec.rb
|
808
|
-
- spec/controllers/sessions_controller_spec.rb
|
809
827
|
- spec/controllers/single_use_link_controller_spec.rb
|
810
828
|
- spec/controllers/users_controller_spec.rb
|
811
829
|
- spec/factories/checksum_audit_logs.rb
|
@@ -856,6 +874,7 @@ files:
|
|
856
874
|
- spec/fixtures/world.png
|
857
875
|
- spec/fixtures/xls_fits.xml
|
858
876
|
- spec/fixtures/xml_fits.xml
|
877
|
+
- spec/helpers/generic_file_helper_spec.rb
|
859
878
|
- spec/lib/sufia/id_service_spec.rb
|
860
879
|
- spec/lib/sufia/role_mapper_spec.rb
|
861
880
|
- spec/models/audit_job_spec.rb
|
@@ -869,6 +888,7 @@ files:
|
|
869
888
|
- spec/models/local_authority_spec.rb
|
870
889
|
- spec/models/single_use_link_spec.rb
|
871
890
|
- spec/models/transcode_video_job_spec.rb
|
891
|
+
- spec/models/trophy_spec.rb
|
872
892
|
- spec/models/unzip_job_spec.rb
|
873
893
|
- spec/models/user_spec.rb
|
874
894
|
- spec/rake/sufia_fixtures_spec.rb
|
@@ -963,7 +983,6 @@ test_files:
|
|
963
983
|
- features/users.feature
|
964
984
|
- spec/.gitignore
|
965
985
|
- spec/active_fedora/unsaved_digital_object_spec.rb
|
966
|
-
- spec/config/host_to_vhost_spec.rb
|
967
986
|
- spec/controllers/_sort_and_per_page.html.erb
|
968
987
|
- spec/controllers/authorities_controller_spec.rb
|
969
988
|
- spec/controllers/batch_controller_spec.rb
|
@@ -972,7 +991,6 @@ test_files:
|
|
972
991
|
- spec/controllers/downloads_controller_spec.rb
|
973
992
|
- spec/controllers/generic_files_controller_spec.rb
|
974
993
|
- spec/controllers/mailbox_controller_spec.rb
|
975
|
-
- spec/controllers/sessions_controller_spec.rb
|
976
994
|
- spec/controllers/single_use_link_controller_spec.rb
|
977
995
|
- spec/controllers/users_controller_spec.rb
|
978
996
|
- spec/factories/checksum_audit_logs.rb
|
@@ -1023,6 +1041,7 @@ test_files:
|
|
1023
1041
|
- spec/fixtures/world.png
|
1024
1042
|
- spec/fixtures/xls_fits.xml
|
1025
1043
|
- spec/fixtures/xml_fits.xml
|
1044
|
+
- spec/helpers/generic_file_helper_spec.rb
|
1026
1045
|
- spec/lib/sufia/id_service_spec.rb
|
1027
1046
|
- spec/lib/sufia/role_mapper_spec.rb
|
1028
1047
|
- spec/models/audit_job_spec.rb
|
@@ -1036,6 +1055,7 @@ test_files:
|
|
1036
1055
|
- spec/models/local_authority_spec.rb
|
1037
1056
|
- spec/models/single_use_link_spec.rb
|
1038
1057
|
- spec/models/transcode_video_job_spec.rb
|
1058
|
+
- spec/models/trophy_spec.rb
|
1039
1059
|
- spec/models/unzip_job_spec.rb
|
1040
1060
|
- spec/models/user_spec.rb
|
1041
1061
|
- spec/rake/sufia_fixtures_spec.rb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# Copyright © 2012 The Pennsylvania State University
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
#TODO I think this can just be in the PSU version of scholarsphere
|
17
|
-
|
18
|
-
class SessionsController < ApplicationController
|
19
|
-
def destroy
|
20
|
-
# make any local additions here (e.g. expiring local sessions, etc.)
|
21
|
-
# adapted from here: http://cosign.git.sourceforge.net/git/gitweb.cgi?p=cosign/cosign;a=blob;f=scripts/logout/logout.php;h=3779248c754001bfa4ea8e1224028be2b978f3ec;hb=HEAD
|
22
|
-
|
23
|
-
cookies.delete(request.env['COSIGN_SERVICE']) if request.env['COSIGN_SERVICE']
|
24
|
-
redirect_to Sufia::Engine.config.logout_url
|
25
|
-
end
|
26
|
-
|
27
|
-
def new
|
28
|
-
redirect_to Sufia::Engine.config.login_url
|
29
|
-
end
|
30
|
-
end
|
@@ -1,195 +0,0 @@
|
|
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
|
-
<h2>Individual Titles <small>(applied to individual files uploaded)</small><small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
|
18
|
-
<div id="" class="well">
|
19
|
-
<p>
|
20
|
-
<i class="icon-info-sign"></i> Filename will be the default title. Please provide a more meaningful title, and filenames will still be preserved by the system.
|
21
|
-
</p>
|
22
|
-
<div class="row">
|
23
|
-
<div class="span60">
|
24
|
-
<% @batch.generic_files.sort! { |a,b| a.label.downcase <=> b.label.downcase }.each_with_index do |gen_f, index| %>
|
25
|
-
<div class="control-group">
|
26
|
-
<%= f.label :title, "<span class='error'>*</span> Title #{index+1}".html_safe, :class=>"control-label" %>
|
27
|
-
<div class="controls" id="additional_title_clone">
|
28
|
-
<%= f.text_field :title, :name=>"title[#{gen_f.id}][]", :value=>gen_f.label, :required=> true %>
|
29
|
-
<a href="#" id="generic_file_title_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_title"] %>" data-original-title="Title"><i class="icon-question-sign icon-large"></i></a>
|
30
|
-
</div>
|
31
|
-
</div>
|
32
|
-
<% end %>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div class="span40">
|
36
|
-
<!-- put metadata about file being edited here -->
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
</div>
|
40
|
-
|
41
|
-
<%= hidden_field_tag(:extra_description_count, "1") %>
|
42
|
-
<div id="descriptions_display">
|
43
|
-
<h2 class="non lower">Bulk Descriptions <small>(applied to all files just uploaded)</small> <small class="pull-right"><span class="error">*</span> indicates required fields</small></h2>
|
44
|
-
<div class="well">
|
45
|
-
<div class="control-group" id="resources">
|
46
|
-
<%= f.label :resource_type, "Resource Types", :class=>"control-label", :for=>"resource_type" %>
|
47
|
-
<div class="controls">
|
48
|
-
<p class="help-block">You may select multiple types to apply to all files<p>
|
49
|
-
<%= f.select "resource_type", Sufia::Engine::config.resource_types, {}, {:multiple=>true, :size=>7} %>
|
50
|
-
<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>
|
51
|
-
</div>
|
52
|
-
</div>
|
53
|
-
|
54
|
-
<div class="control-group">
|
55
|
-
<%= f.label :tag, "<span class='error'>*</span> Keyword".html_safe, :class=>"control-label" %>
|
56
|
-
<div class="controls" id="additional_tag_clone">
|
57
|
-
<%= f.text_field :tag, :name=>"generic_file[tag][]", :value=>"", :required=> true %>
|
58
|
-
<button class="adder btn" name="additional_tag" id="additional_tag_submit">+<span class="accessible-hidden">add another Tag</span></button>
|
59
|
-
|
60
|
-
<a href="#" id="generic_file_tag_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_tag"] %>" data-original-title="Keyword"><i class="icon-question-sign icon-large"></i></a>
|
61
|
-
</div>
|
62
|
-
<div id="additional_tag_elements"></div>
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<div class="control-group">
|
66
|
-
<%= f.label :creator, "<span class='error'>*</span> Creator".html_safe, :class=>"control-label" %>
|
67
|
-
<div class="controls" id="additional_creator_clone">
|
68
|
-
<%= f.text_field :creator, :name=>"generic_file[creator][]", :value=>"", :required=> true %>
|
69
|
-
<button class="adder btn" name="additional_creator" id="additional_creator_submit">+<span class="accessible-hidden">add another Creator</span></button>
|
70
|
-
|
71
|
-
<a href="#" id="generic_file_creator_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_creator"] %>" data-original-title="Creator"><i class="icon-question-sign icon-large"></i></a>
|
72
|
-
</div>
|
73
|
-
<div id="additional_creator_elements"></div>
|
74
|
-
</div>
|
75
|
-
|
76
|
-
<div class="control-group">
|
77
|
-
<%= f.label :rights, '<span class="error">*</span> Rights'.html_safe, :class=>"control-label" %>
|
78
|
-
<div class="controls" id="additional_rights_clone">
|
79
|
-
<%= f.select "rights", options_for_select(Sufia::Engine::config.cc_licenses, 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/'), :required => true %>
|
80
|
-
<button class="adder btn" name="additional_rights" id="additional_rights_submit">+<span class="accessible-hidden">add another Rights</span></button>
|
81
|
-
|
82
|
-
<a href="#" id="generic_file_rights_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_rights"] %>" data-original-title="Rights"><i class="icon-question-sign icon-large"></i></a>
|
83
|
-
<%= render :partial => "generic_files/rights_modal" %>
|
84
|
-
|
85
|
-
</div>
|
86
|
-
<div id="additional_rights_elements"></div>
|
87
|
-
</div>
|
88
|
-
|
89
|
-
<div class="row" id="add_descriptions">
|
90
|
-
<a href="#" id="add_descriptions" >Add More Description Types</a>
|
91
|
-
</div>
|
92
|
-
<!-- hidden on initial load -->
|
93
|
-
|
94
|
-
<div class="hide" id="more_descriptions">
|
95
|
-
<div class="control-group">
|
96
|
-
<%= f.label :related_url, "Related URL", :class=>"control-label" %>
|
97
|
-
<div class="controls" id="additional_related_url_clone">
|
98
|
-
<%= f.text_field :related_url, :name=>"generic_file[related_url][]", :value=>"" %>
|
99
|
-
<button class="adder btn" name="additional_related_url" id="additional_related_url_submit">+<span class="accessible-hidden">add another Related URL</span></button>
|
100
|
-
|
101
|
-
<a href="#" id="generic_file_related_url_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_related_url"] %>" data-original-title="Related URL"><i class="icon-question-sign icon-large"></i></a>
|
102
|
-
</div>
|
103
|
-
<div id="additional_related_url_elements"></div>
|
104
|
-
</div>
|
105
|
-
|
106
|
-
<div class="control-group">
|
107
|
-
<%= f.label :based_near, 'Location', :class=>"control-label" %>
|
108
|
-
<div class="controls" id="additional_based_near_clone">
|
109
|
-
<%= f.text_field :based_near, :name=>"generic_file[based_near][]", :value=>"" %>
|
110
|
-
<button class="adder btn" name="additional_based_near" id="additional_based_near_submit">+<span class="accessible-hidden">add another Location</span></button>
|
111
|
-
|
112
|
-
<a href="#" id="generic_file_based_near_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_based_near"] %>" data-original-title="Location"><i class="icon-question-sign icon-large"></i></a>
|
113
|
-
</div>
|
114
|
-
<div id="additional_based_near_elements"></div>
|
115
|
-
</div>
|
116
|
-
|
117
|
-
<div class="control-group">
|
118
|
-
<%= f.label :contributor, :class=>"control-label" %>
|
119
|
-
<div class="controls" id="additional_contributor_clone">
|
120
|
-
<%= f.text_field :contributor, :name=>"generic_file[contributor][]", :value=>gf.contributor[0] %>
|
121
|
-
<button class="adder btn" name="additional_contributor" id="additional_contributor_submit">+<span class="accessible-hidden">add another Contributor</span></button>
|
122
|
-
|
123
|
-
<a href="#" id="generic_file_contributor_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_contributor"] %>" data-original-title="Contributor"><i class="icon-question-sign icon-large"></i></a>
|
124
|
-
</div>
|
125
|
-
<div id="additional_contributor_elements"></div>
|
126
|
-
</div>
|
127
|
-
|
128
|
-
<div class="control-group">
|
129
|
-
<%= f.label :date_created, "Date Created", :class=>"control-label" %>
|
130
|
-
<div class="controls" id="additional_date_created_clone">
|
131
|
-
<%= f.text_field :date_created, :name=>"generic_file[date_created][]", :value=>"" %>
|
132
|
-
<button class="adder btn" name="additional_date_created" id="additional_date_created_submit">+<span class="accessible-hidden">add another Date Created</span></button>
|
133
|
-
|
134
|
-
<a href="#" id="generic_file_date_created_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_date_created"] %>" data-original-title="Date Created"><i class="icon-question-sign icon-large"></i></a>
|
135
|
-
</div>
|
136
|
-
<div id="additional_date_created_elements"></div>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
<div class="control-group">
|
140
|
-
<%= f.label :description, "Abstract or Summary", :class=>"control-label" %>
|
141
|
-
<div class="controls" id="additional_description_clone">
|
142
|
-
<%= f.text_area :description, :name=>"generic_file[description][]", :value=>"" %>
|
143
|
-
<button class="adder btn" name="additional_description" id="additional_description_submit">+<span class="accessible-hidden">add another Abstract or Summary</span></button>
|
144
|
-
|
145
|
-
<a href="#" id="generic_file_description_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_description"] %>" data-original-title="Abstract or Summary"><i class="icon-question-sign icon-large"></i></a>
|
146
|
-
</div>
|
147
|
-
<div id="additional_description_elements"></div>
|
148
|
-
</div>
|
149
|
-
|
150
|
-
<div class="control-group">
|
151
|
-
<%= f.label :identifier, :class=>"control-label" %>
|
152
|
-
<div class="controls" id="additional_identifier_clone">
|
153
|
-
<%= f.text_field :identifier, :name=>"generic_file[identifier][]", :value=>"" %>
|
154
|
-
<button class="adder btn" name="additional_identifier" id="additional_identifier_submit">+<span class="accessible-hidden">add another Identifier</span></button>
|
155
|
-
|
156
|
-
<a href="#" id="generic_file_identifier_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_identifier"] %>" data-original-title="Identifier"><i class="icon-question-sign icon-large"></i></a>
|
157
|
-
</div>
|
158
|
-
<div id="additional_identifier_elements"></div>
|
159
|
-
</div>
|
160
|
-
|
161
|
-
<div class="control-group">
|
162
|
-
<%= f.label :language, :class=>"control-label" %>
|
163
|
-
<div class="controls" id="additional_language_clone">
|
164
|
-
<%= f.text_field :language, :name=>"generic_file[language][]", :value=>"" %>
|
165
|
-
<button class="adder btn" name="additional_language" id="additional_language_submit">+<span class="accessible-hidden">add another Language</span></button>
|
166
|
-
|
167
|
-
<a href="#" id="generic_file_language_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_language"] %>" data-original-title="Language"><i class="icon-question-sign icon-large"></i></a>
|
168
|
-
</div>
|
169
|
-
<div id="additional_language_elements"></div>
|
170
|
-
</div>
|
171
|
-
|
172
|
-
<div class="control-group">
|
173
|
-
<%= f.label :publisher, :class=>"control-label" %>
|
174
|
-
<div class="controls" id="additional_publisher_clone">
|
175
|
-
<%= f.text_field :publisher, :name=>"generic_file[publisher][]", :value=>"" %>
|
176
|
-
<button class="adder btn" name="additional_publisher" id="additional_publisher_submit">+<span class="accessible-hidden">add another Publisher</span></button>
|
177
|
-
|
178
|
-
<a href="#" id="generic_file_publisher_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_publisher"] %>" data-original-title="Publisher"><i class="icon-question-sign icon-large"></i></a>
|
179
|
-
</div>
|
180
|
-
<div id="additional_publisher_elements"></div>
|
181
|
-
</div>
|
182
|
-
|
183
|
-
<div class="control-group">
|
184
|
-
<%= f.label :subject, :class=>"control-label" %>
|
185
|
-
<div class="controls" id="additional_subject_clone">
|
186
|
-
<%= f.text_field :subject, :name=>"generic_file[subject][]", :value=>"" %>
|
187
|
-
<button class="adder btn" name="additional_subject" id="additional_subject_submit">+<span class="accessible-hidden">add another Subject</span></button>
|
188
|
-
|
189
|
-
<a href="#" id="generic_file_subject_help" rel="popover" data-content="<%= Sufia::Engine.config.metadata_help["generic_file_subject"] %>" data-original-title="Subject"><i class="icon-question-sign icon-large"></i></a>
|
190
|
-
</div>
|
191
|
-
<div id="additional_subject_elements"></div>
|
192
|
-
</div>
|
193
|
-
</div> <!-- /more_descriptions -->
|
194
|
-
</div><!-- /well -->
|
195
|
-
</div> <!-- /row /span6 -->
|