sufia 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +111 -0
  3. data/Gemfile +4 -4
  4. data/History.md +126 -0
  5. data/README.md +23 -5
  6. data/SUFIA_VERSION +1 -1
  7. data/app/assets/javascripts/sufia/multiForm.js +10 -2
  8. data/app/assets/stylesheets/{application-bootstrap.css → application-bootstrap.css.erb} +7 -7
  9. data/app/assets/stylesheets/{bootstrap.min.css → bootstrap.min.css.erb} +1 -1
  10. data/app/controllers/concerns/sufia/users_controller_behavior.rb +9 -3
  11. data/app/controllers/single_use_link_controller.rb +1 -1
  12. data/app/helpers/sufia_helper.rb +7 -1
  13. data/app/models/contact_form.rb +0 -14
  14. data/app/views/_user_util_links.html.erb +0 -15
  15. data/app/views/batch_edits/_check_all.html.erb +2 -2
  16. data/app/views/batch_edits/_delete_selected.html.erb +1 -1
  17. data/app/views/layouts/{_head-tag-content.html.erb → _head_tag_content.html.erb} +0 -0
  18. data/app/views/layouts/homepage.html.erb +2 -2
  19. data/app/views/layouts/sufia-one-column.html.erb +1 -1
  20. data/app/views/layouts/sufia-two-column.html.erb +1 -1
  21. data/app/views/users/edit.html.erb +1 -1
  22. data/app/views/users/show.html.erb +1 -17
  23. data/config/routes.rb +31 -33
  24. data/lib/generators/sufia/sufia_generator.rb +5 -3
  25. data/lib/generators/sufia/templates/catalog_controller.rb +5 -1
  26. data/lib/generators/sufia/templates/config/redis_config.rb +1 -14
  27. data/lib/sufia/batch_edits_controller_behavior.rb +1 -1
  28. data/lib/sufia/controller.rb +1 -1
  29. data/lib/sufia/dashboard_controller_behavior.rb +8 -2
  30. data/lib/sufia/files_controller_behavior.rb +1 -2
  31. data/lib/sufia/version.rb +1 -1
  32. data/spec/active_fedora/unsaved_digital_object_spec.rb +1 -15
  33. data/spec/controllers/authorities_controller_spec.rb +1 -15
  34. data/spec/controllers/batch_controller_spec.rb +10 -16
  35. data/spec/controllers/batch_edits_controller_spec.rb +1 -1
  36. data/spec/controllers/catalog_controller_spec.rb +1 -15
  37. data/spec/controllers/dashboard_controller_spec.rb +23 -17
  38. data/spec/controllers/downloads_controller_spec.rb +1 -15
  39. data/spec/controllers/generic_files_controller_spec.rb +18 -32
  40. data/spec/controllers/mailbox_controller_spec.rb +1 -15
  41. data/spec/controllers/single_use_link_controller_spec.rb +6 -13
  42. data/spec/controllers/users_controller_spec.rb +27 -41
  43. data/spec/factories/users.rb +5 -14
  44. data/spec/features/browse_dashboard_files.rb +21 -0
  45. data/spec/features/browse_files.rb +31 -0
  46. data/spec/features/contact_form.rb +99 -0
  47. data/spec/features/display_dashboard.rb +46 -0
  48. data/spec/features/ingest_upload_files.rb +24 -0
  49. data/spec/features/users_spec.rb +25 -0
  50. data/spec/helpers/generic_file_helper_spec.rb +10 -3
  51. data/spec/helpers/sufia_helper_spec.rb +1 -1
  52. data/spec/lib/sufia/id_service_spec.rb +1 -15
  53. data/spec/models/audit_job_spec.rb +1 -15
  54. data/spec/models/batch_spec.rb +1 -15
  55. data/spec/models/batch_update_job_spec.rb +3 -16
  56. data/spec/models/characterize_job_spec.rb +4 -4
  57. data/spec/models/checksum_audit_log_spec.rb +1 -15
  58. data/spec/models/event_jobs_spec.rb +1 -15
  59. data/spec/models/file_content_datastream_spec.rb +5 -19
  60. data/spec/models/fits_datastream_spec.rb +1 -15
  61. data/spec/models/generic_file/web_form_spec.rb +34 -0
  62. data/spec/models/generic_file_spec.rb +11 -39
  63. data/spec/models/local_authority_spec.rb +3 -15
  64. data/spec/models/properties_datastream_spec.rb +1 -1
  65. data/spec/models/single_use_link_spec.rb +1 -1
  66. data/spec/models/solr_document_spec.rb +1 -1
  67. data/spec/models/transcode_audio_job_spec.rb +1 -1
  68. data/spec/models/transcode_video_job_spec.rb +1 -1
  69. data/spec/models/trophy_spec.rb +1 -1
  70. data/spec/models/unzip_job_spec.rb +1 -15
  71. data/spec/models/user_spec.rb +1 -15
  72. data/spec/rake/sufia_fixtures_spec.rb +3 -17
  73. data/spec/routing/route_spec.rb +7 -21
  74. data/spec/spec_helper.rb +8 -20
  75. data/spec/support/features.rb +6 -0
  76. data/spec/support/features/session_helpers.rb +21 -0
  77. data/spec/support/lib/generators/test_app_generator.rb +4 -0
  78. data/spec/views/batch_edits/check_all_spec.rb +6 -4
  79. data/sufia-models/app/models/checksum_audit_log.rb +1 -15
  80. data/sufia-models/app/models/domain_term.rb +3 -15
  81. data/sufia-models/app/models/geo_names_resource.rb +1 -13
  82. data/sufia-models/app/models/local_authority.rb +12 -17
  83. data/sufia-models/app/models/local_authority_entry.rb +1 -15
  84. data/sufia-models/app/models/single_use_link.rb +2 -3
  85. data/sufia-models/app/models/trophy.rb +1 -1
  86. data/sufia-models/app/models/version_committer.rb +1 -15
  87. data/sufia-models/lib/sufia/models.rb +6 -2
  88. data/sufia-models/lib/sufia/models/engine.rb +1 -1
  89. data/sufia-models/lib/sufia/models/generic_file.rb +3 -0
  90. data/sufia-models/lib/sufia/models/generic_file/accessible_attributes.rb +87 -0
  91. data/sufia-models/lib/sufia/models/generic_file/permissions.rb +2 -1
  92. data/sufia-models/lib/sufia/models/generic_file/web_form.rb +4 -1
  93. data/sufia-models/lib/sufia/models/user.rb +9 -2
  94. data/sufia-models/lib/sufia/models/version.rb +1 -1
  95. data/{lib → sufia-models/lib}/tasks/resque.rake +0 -0
  96. data/sufia-models/sufia-models.gemspec +13 -11
  97. data/sufia.gemspec +1 -3
  98. data/tasks/sufia-dev.rake +21 -10
  99. metadata +30 -84
  100. data/config/cucumber.yml +0 -8
  101. data/features/browse_dashboard_files.feature +0 -16
  102. data/features/browse_files.feature +0 -16
  103. data/features/contact_form.feature +0 -86
  104. data/features/display_dashboard.feature +0 -42
  105. data/features/ingest_upload_files.feature +0 -21
  106. data/features/step_definitions/edit_metadata_steps.rb +0 -89
  107. data/features/step_definitions/fixture_steps.rb +0 -35
  108. data/features/step_definitions/show_document_steps.rb +0 -103
  109. data/features/step_definitions/sufia.rb +0 -69
  110. data/features/step_definitions/user_steps.rb +0 -58
  111. data/features/step_definitions/web_steps.rb +0 -235
  112. data/features/support/cleanup.rb +0 -19
  113. data/features/support/env.rb +0 -90
  114. data/features/support/headless.rb +0 -26
  115. data/features/support/paths.rb +0 -101
  116. data/features/users.feature +0 -18
  117. data/spec/lib/sufia/role_mapper_spec.rb +0 -28
  118. data/spec/support/Gemfile +0 -24
  119. data/spec/views/single_user_link/download.html.erb_spec.rb +0 -5
  120. data/spec/views/single_user_link/generate_download.html.erb_spec.rb +0 -5
  121. data/spec/views/single_user_link/generate_show.html.erb_spec.rb +0 -5
  122. data/spec/views/single_user_link/show.html.erb_spec.rb +0 -5
  123. data/tasks/cucumber.rake +0 -72
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f71322c27a772591f447020806f7f4893981a8dd
4
- data.tar.gz: 7c100e412ef4198dc27e383ad03cbddd14a34b50
3
+ metadata.gz: 1a23f866c05484770f7f3caaec082f6cb36b7258
4
+ data.tar.gz: 47c0e1f3d27a544258f7d4d520d23152aad13773
5
5
  SHA512:
6
- metadata.gz: d773e672c76ca18ca1141412b06a574292d38a86ea7c2d1e70c0b1a451e81250175d0935b950a09c7022ff51181759046dac74e0358bc66d35751d3be648acc9
7
- data.tar.gz: cb3998ec362f8e3dd98ead5db0647515e2f3ae788c171c91c70a9910333b408087976371a0309ff81865c6b742649d39d009fdc1c3a9126dc6ab69d2fd1490e8
6
+ metadata.gz: d48523de8c674ffa5dd496b3595943ab4db13b9b42b26eb730b25bdb4db467a34863cb920d03b6d3c09c5a8e77ee4c3fed091ffa2316d3435bf3ab52c872c322
7
+ data.tar.gz: 2ab7bef74ddb9365f6f10695b2ade76c0149504dfebd349455ffc52cbbd58a8749410c581285c040b0abc4f790495597daf6797e27af46f2ad940e38f43c76e8
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,111 @@
1
+ # How to Contribute
2
+
3
+ We want your help to make Project Hydra great.
4
+ There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
5
+
6
+ ## Hydra Project Intellectual Property Licensing and Ownership
7
+
8
+ All code contributors must have an Individual Contributor License Agreement (iCLA) on file with the Hydra Project Steering Group.
9
+ If the contributor works for an institution, the institution must have a Corporate Contributor License Agreement (cCLA) on file.
10
+
11
+ https://wiki.duraspace.org/display/hydra/Hydra+Project+Intellectual+Property+Licensing+and+Ownership
12
+
13
+ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project.
14
+
15
+ ## Contribution Tasks
16
+
17
+ * Reporting Issues
18
+ * Making Changes
19
+ * Submitting Changes
20
+ * Merging Changes
21
+
22
+ ### Reporting Issues
23
+
24
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
25
+ * Submit a [Github issue](./issues) by:
26
+ * Clearly describing the issue
27
+ * Provide a descriptive summary
28
+ * Explain the expected behavior
29
+ * Explain the actual behavior
30
+ * Provide steps to reproduce the actual behavior
31
+
32
+ ### Making Changes
33
+
34
+ * Fork the repository on GitHub
35
+ * Create a topic branch from where you want to base your work.
36
+ * This is usually the master branch.
37
+ * To quickly create a topic branch based on master; `git branch fix/master/my_contribution master`
38
+ * Then checkout the new branch with `git checkout fix/master/my_contribution`.
39
+ * Please avoid working directly on the `master` branch.
40
+ * You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful
41
+ * Make commits of logical units.
42
+ * Your commit should include a high level description of your work in HISTORY.textile
43
+ * Check for unnecessary whitespace with `git diff --check` before committing.
44
+ * Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
45
+ * If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages)
46
+
47
+ ```
48
+ Present tense short summary (50 characters or less)
49
+
50
+ More detailed description, if necessary. It should be wrapped to 72
51
+ characters. Try to be as descriptive as you can, even if you think that
52
+ the commit content is obvious, it may not be obvious to others. You
53
+ should add such description also if it's already present in bug tracker,
54
+ it should not be necessary to visit a webpage to check the history.
55
+
56
+ Include Closes #<issue-number> when relavent.
57
+
58
+ Description can have multiple paragraphs and you can use code examples
59
+ inside, just indent it with 4 spaces:
60
+
61
+ class PostsController
62
+ def index
63
+ respond_with Post.limit(10)
64
+ end
65
+ end
66
+
67
+ You can also add bullet points:
68
+
69
+ - you can use dashes or asterisks
70
+
71
+ - also, try to indent next line of a point for readability, if it's too
72
+ long to fit in 72 characters
73
+ ```
74
+
75
+ * Make sure you have added the necessary tests for your changes.
76
+ * Run _all_ the tests to assure nothing else was accidentally broken.
77
+ * When you are ready to submit a pull request
78
+
79
+ ### Submitting Changes
80
+
81
+ * Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub.
82
+ * Make sure your branch is up to date with its parent branch (i.e. master)
83
+ * `git checkout master`
84
+ * `git pull --rebase`
85
+ * `git checkout <your-branch>`
86
+ * `git rebase master`
87
+ * It is likely a good idea to run your tests again.
88
+ * Squash the commits for your branch into one commit
89
+ * `git rebase --interactive HEAD~<number-of-commits>` ([See Github help](https://help.github.com/articles/interactive-rebase))
90
+ * To determine the number of commits on your branch: `git log master..<your-branch> --oneline | wc -l`
91
+ * Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on.
92
+ * Push your changes to a topic branch in your fork of the repository.
93
+ * Submit a pull request from your fork to the project.
94
+
95
+ ### Merging Changes
96
+
97
+ * It is considered "poor from" to merge your own request.
98
+ * Please take the time to review the changes and get a sense of what is being changed. Things to consider:
99
+ * Does the commit message explain what is going on?
100
+ * Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_
101
+ * Does the commit contain more than it should? Are two separate concerns being addressed in one commit?
102
+ * Did the Travis tests complete successfully?
103
+ * If you are uncertain, bring other contributors into the conversation by creating a comment that includes their @username.
104
+ * If you like the pull request, but want others to chime in, create a +1 comment and tag a user.
105
+
106
+ # Additional Resources
107
+
108
+ * [General GitHub documentation](http://help.github.com/)
109
+ * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
110
+ * [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git.
111
+ * [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
data/Gemfile CHANGED
@@ -8,13 +8,13 @@ gem 'kaminari', github: 'harai/kaminari', branch: 'route_prefix_prototype'
8
8
  gem 'sufia-models', path: './sufia-models'
9
9
 
10
10
  group :development, :test do
11
- gem 'activerecord-import', '0.3.0'
11
+ # https://github.com/zdennis/activerecord-import/pull/79
12
+ #gem 'activerecord-import', '0.3.0'
12
13
  gem 'sqlite3'
13
14
  gem 'selenium-webdriver'
14
- gem 'rspec-rails', '~> 2.13.1'
15
- gem 'cucumber-rails', '~> 1.0', :require => false
15
+ gem 'rspec-rails', '~> 2.14'
16
+ gem 'launchy'
16
17
  gem 'database_cleaner'
17
- gem 'devise'
18
18
  gem 'capybara', '~>2.1.0'
19
19
  gem 'bcrypt-ruby'
20
20
  gem "jettywrapper"
data/History.md CHANGED
@@ -1,5 +1,131 @@
1
1
  # History of Sufia releases
2
2
 
3
+ ## 3.0.0
4
+ * Update README.md paths for Sufia assets application.css and application.js [Jim
5
+ Coble]
6
+
7
+ * Moving resque rake task to sufia-models [Jeremy Friesen]
8
+
9
+ * Resque should use the redis instance configured in redis.yml [Justin Coyne]
10
+
11
+ * Profile link should generate a valid route. Fixes #150 [Justin Coyne]
12
+
13
+ * Updating CONTRIBUTING.md as per Hydra v6.0.0 [Jeremy Friesen]
14
+
15
+ * Delete all needs a delete HTTP method [Justin Coyne]
16
+
17
+ * Put the specific version of kaminari we need into the test app [Justin Coyne]
18
+
19
+ * Removed deprecated use of mock() and stub() [Justin Coyne]
20
+
21
+ * Simpler rspec run [Justin Coyne]
22
+
23
+ * Fix routing spec [Justin Coyne]
24
+
25
+ * Replaced cucumber with feature specs [Justin Coyne]
26
+
27
+ * Use resourceful routes for users [Justin Coyne]
28
+
29
+ * Removed duplicate tasks [Justin Coyne]
30
+
31
+ * Switch require spec_helper to relative [Justin Coyne]
32
+
33
+ * Support rspec-rails 2.14 [Justin Coyne]
34
+
35
+ * Removed empty tests [Justin Coyne]
36
+
37
+ * Correct path for fonts [Justin Coyne]
38
+
39
+ * Use assets_path [Justin Coyne]
40
+
41
+ * Fix path to fixtures.rake [Justin Coyne]
42
+
43
+ * Add active_resource as a dependency [Justin Coyne]
44
+
45
+ * Distinct on notify_number is unnecessary [Justin Coyne]
46
+
47
+ * check all view, should supply the controller [Justin Coyne]
48
+
49
+ * Removed unused spec [Justin Coyne]
50
+
51
+ * Fixed path to rakefile [Justin Coyne]
52
+
53
+ * Fix test to work in an order independent manner [Justin Coyne]
54
+
55
+ * Single Use links should be randomly generated [Justin Coyne]
56
+
57
+ * Update paperclip gem [Justin Coyne]
58
+
59
+ * Handle attributes in a way that works with rails 3 or 4 [Justin Coyne]
60
+
61
+ * Fixed view spec [Justin Coyne]
62
+
63
+ * Devise is not required by sufia-models [Justin Coyne]
64
+
65
+ * Inherit the version of devise from blacklight [Justin Coyne]
66
+
67
+ * Move to a released version of blacklight_advanced_search [Justin Coyne]
68
+
69
+ * Rails 4 support [Justin Coyne]
70
+
71
+ * updating the readme based on mye experience running through it. [Carolyn Cole]
72
+
73
+ * The query for my uploads, should be me, not exclude me [Justin Coyne]
74
+
75
+ * Multiform should rename the fields correctly [Justin Coyne]
76
+
77
+ * more explicit editable docs test [Matt Zumwalt]
78
+
79
+ * Dashboard search results test more specific -- avoids pagination causing false
80
+ negatives [Matt Zumwalt]
81
+
82
+ * explicit handling of kaminari pagination bug, plus info in install docs [Matt
83
+ Zumwalt]
84
+
85
+ * Test to confirm that pagination works -- fails because dashboard/pages routes
86
+ are not properly inherited. [Matt Zumwalt]
87
+
88
+ * Handle the odd values in the hidden fields on the
89
+ generic_files/_permission.html.erb form. These were added here:
90
+ https://github.com/psu-stewardship/scholarsphere/commit/2a58d0c920cc87cad9a815b451613e3d327747e3#L9R5
91
+ I have no idea why. [Justin Coyne]
92
+
93
+ * Add a comment in the generator about the Sufia route being the very last line
94
+ [Justin Coyne]
95
+
96
+ * Generated controller uses the search_layout method for determining layout
97
+ [Justin Coyne]
98
+
99
+ * Force a two column layout for dashboard [Justin Coyne]
100
+
101
+ * Use hydra-head 6.3.0 [Justin Coyne]
102
+
103
+ * Bump active-fedora version to 6.4.0.rc4 [Justin Coyne]
104
+
105
+ * allowing non-sufia controllers to inherit dashboard behaviors and helpers
106
+ smoothly [Matt Zumwalt]
107
+
108
+ * Set a permission value that actually exists (e.g. 'read') [Justin Coyne]
109
+
110
+ * Added attr_accessible [Justin Coyne]
111
+
112
+ * Fix the version in sufia-models.gemspec so you can bundle install [Justin
113
+ Coyne]
114
+
115
+
116
+
117
+ ## 2.0.1
118
+ * Fix version of sufia-models
119
+
120
+ ## 2.0.0
121
+ * Dropbox support
122
+ * Multiple layouts
123
+ * UnzipJob can handle directories
124
+ * Support for sufia and hydra-editor in the same app
125
+ * Subdividing the upload partial
126
+ * Lots of code cleanup
127
+
128
+
3
129
  ## 1.3.0
4
130
  * Depends on Hydra::Controller::DownloadBehavior
5
131
  * Upgraded to hydra-batch-edit 1.1 which includes session-less batches in hydra-collections
data/README.md CHANGED
@@ -42,16 +42,21 @@ Sufia needs the following software to work:
42
42
  gem 'blacklight'
43
43
  gem 'hydra-head'
44
44
  gem 'sufia'
45
+ gem 'kaminari', github: 'harai/kaminari', branch: 'route_prefix_prototype' # required to handle pagination properly in dashboard. See https://github.com/amatsuda/kaminari/pull/322
45
46
  gem 'jettywrapper'
46
47
  gem 'font-awesome-sass-rails'
47
48
  ```
48
49
  Then `bundle install`
49
50
 
51
+ Note the line with kaminari listed as a dependency. This is a temporary fix to address a problem in the current release of kaminari. Technically you should not have to list kaminari, which is a dependency of blacklight and sufia.
52
+
50
53
  ### Run the blacklight, hydra and sufia generators
51
54
  ```
52
55
  rails g blacklight --devise
53
56
  rails g hydra:head -f
57
+ bundle install
54
58
  rails g sufia -f
59
+ rm public/index.html
55
60
  ```
56
61
 
57
62
  ### Run the migrations
@@ -60,21 +65,35 @@ rails g sufia -f
60
65
  rake db:migrate
61
66
  ```
62
67
 
68
+ ### Get a copy of hydra-jetty
69
+ ```
70
+ rails g hydra:jetty
71
+ rake jetty:config
72
+ rake jetty:start
73
+ ```
63
74
 
64
75
  ### If you want to use the assets that ship with Sufia...
65
- #### add the following to application.css
76
+ #### Modify app/assets/stylesheets/application.css
77
+ Add this line:
66
78
  ```
67
79
  *= require sufia
68
80
  ```
69
- You'll want to ensure you're not loading the blacklight.css, so remove this line ```*= require_tree .```
81
+ **Remove** this line:
82
+ ```*= require_tree .```
83
+
84
+ _Removing the require_tree from application.css will ensure you're not loading the blacklight.css. This is because blacklight's css styling does not mix well with sufia's default styling._
85
+
86
+
87
+ #### Modify app/assets/javascripts/application.js
70
88
 
71
- #### Add the following to application.js
89
+ Add this line:
72
90
  ```
73
91
  //= require sufia
74
92
  ```
75
93
 
76
94
  ### Install Fits.sh
77
95
  http://code.google.com/p/fits/downloads/list
96
+ Download a copy of fits & unpack it somewhere on your PATH.
78
97
 
79
98
  ### Start background workers
80
99
  ```
@@ -96,8 +115,7 @@ See https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
96
115
  This information is for people who want to modify the engine itself, not an application that uses the engine:
97
116
  ### Create fixtures
98
117
  ```
99
- # start jetty
100
- git submodule init && git submodule update
118
+ # configure jetty & start jetty (if you haven't already)
101
119
  rake jetty:config
102
120
  rake jetty:start
103
121
 
data/SUFIA_VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 3.0.0
@@ -6,6 +6,7 @@
6
6
  var settings = $.extend( { }, options);
7
7
 
8
8
  function addField() {
9
+ count = $(this).closest('.control-group').find('.controls').size();
9
10
  var cloneId = this.id.replace("submit", "clone");
10
11
  var newId = this.id.replace("submit", "elements");
11
12
  var cloneElem = $('#'+cloneId).clone();
@@ -14,6 +15,7 @@
14
15
  plusbttn.html('-<span class="accessible-hidden">remove this '+ this.name.replace("_", " ") +'</span>');
15
16
  plusbttn.on('click',removeField);
16
17
 
18
+
17
19
  // remove the help tag on subsequent added fields
18
20
  cloneElem.find('.formHelp').remove();
19
21
  cloneElem.find('i').remove();
@@ -21,8 +23,14 @@
21
23
 
22
24
  //clear out the value for the element being appended
23
25
  //so the new element has a blank value
24
- cloneElem.find('input[type=text]').attr("value", "");
25
- cloneElem.find('input[type=text]').attr("required", false);
26
+ // Note: there may be more than one input field. Example:
27
+ // creator_name
28
+ // creator_role
29
+ textFields = cloneElem.find('input[type=text]')
30
+ $.each(textFields, function(n, tf) {
31
+ newName = $(tf).attr('name').replace('[0]', '['+count+']');
32
+ $(tf).attr('name', newName).attr("value", "").attr("required", false)
33
+ })
26
34
 
27
35
  if (settings.afterAdd) {
28
36
  settings.afterAdd(this, cloneElem)
@@ -2,12 +2,12 @@
2
2
  font-family: 'Lato';
3
3
  font-style: normal;
4
4
  font-weight: normal;
5
- src: url('/assets/Lato-Light.eot');
6
- src: local('Lato'), local('Lato'), url('/assets/Lato-Light.ttf') format('truetype');
5
+ src: url(<%= asset_path 'fonts/Lato-Light.eot' %>);
6
+ src: local('Lato'), local('Lato'), url(<%= asset_path 'fonts/Lato-Light.ttf' %>) format('truetype');
7
7
  }
8
8
  body {
9
9
  font: 13px/1.4em Arial, sans-serif;
10
- background: #fff url(/assets/site_images/bg_body.png) left top repeat;
10
+ background: #fff url(<%= asset_path 'site_images/bg_body.png' %>) left top repeat;
11
11
  }
12
12
  p, address, ul, ol, li, dt, dd, td, th, div, blockquote {
13
13
  color: #000;
@@ -56,7 +56,7 @@ li.expandable_new {
56
56
  }
57
57
  /* Layout */
58
58
  #wrapper {
59
- background: url(/assets/site_images/bg_masthead.png) center top no-repeat;
59
+ background: url(<%= asset_path 'site_images/bg_masthead.png' %>) center top no-repeat;
60
60
  }
61
61
  /* #container { */
62
62
  #page-positioner {
@@ -67,13 +67,13 @@ li.expandable_new {
67
67
  #masthead {
68
68
  position: relative;
69
69
  height: 165px;
70
- background: url(/assets/site_images/bg_search_header.png) center 80px no-repeat;
70
+ background: url(<%= asset_path 'site_images/bg_search_header.png' %>) center 80px no-repeat;
71
71
  width: 940px;
72
72
  margin: 0 auto;
73
73
  }
74
74
  #content-wrapper {
75
75
  padding: 0 19px 0 21px;
76
- background: url(/assets/site_images/bg_content2.png) 0 0 no-repeat;
76
+ background: url(<%= asset_path 'site_images/bg_content2.png' %>) 0 0 no-repeat;
77
77
  }
78
78
  #content {
79
79
  /* width: 900px; */
@@ -120,7 +120,7 @@ a.advanced_search:hover {
120
120
 
121
121
  /* Footer */
122
122
  #footer-wrapper {
123
- background: #404040 url(/assets/site_images/bg_footer.png) 0 0 repeat-x;
123
+ background: #404040 url(<%= asset_path 'site_images/bg_footer.png' %>) 0 0 repeat-x;
124
124
  }
125
125
  #footer {
126
126
  width: 920px;
@@ -676,7 +676,7 @@ table .span21{float:none;width:150px;margin-left:0;}
676
676
  table .span22{float:none;width:158px;margin-left:0;}
677
677
  table .span23{float:none;width:166px;margin-left:0;}
678
678
  table .span24{float:none;width:174px;margin-left:0;}
679
- @font-face{font-family:'FontAwesome';src:url('../assets/fontawesome-webfont.eot');src:url('../assets/fontawesome-webfont.eot?#iefix') format('embedded-opentype'),url('../assets/fontawesome-webfont.woff') format('woff'),url('../assets/fontawesome-webfont.ttf') format('truetype'),url('../assets/fontawesome-webfont.svg#FontAwesome') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:FontAwesome;font-weight:normal;font-style:normal;display:inline-block;text-decoration:inherit;}
679
+ @font-face{font-family:'FontAwesome';src:url(<%= asset_path 'fontawesome-webfont.eot'%>);src:url(<%= asset_path 'fontawesome-webfont.eot?#iefix' %>) format('embedded-opentype'),url(<%= asset_path 'fontawesome-webfont.woff' %>) format('woff'),url(<%= asset_path 'fontawesome-webfont.ttf' %>) format('truetype'),url(<%= asset_path 'fontawesome-webfont.svg#FontAwesome' %>) format('svg');font-weight:normal;font-style:normal;}[class^="icon-"]:before,[class*=" icon-"]:before{font-family:FontAwesome;font-weight:normal;font-style:normal;display:inline-block;text-decoration:inherit;}
680
680
  a [class^="icon-"],a [class*=" icon-"]{display:inline-block;text-decoration:inherit;}
681
681
  .icon-large:before{vertical-align:middle;font-size:1.3333333333333333em;}
682
682
  .btn [class^="icon-"],.nav-tabs [class^="icon-"],.btn [class*=" icon-"],.nav-tabs [class*=" icon-"]{line-height:.9em;}
@@ -46,7 +46,13 @@ module Sufia::UsersControllerBehavior
46
46
 
47
47
  # Process changes from profile form
48
48
  def update
49
- @user.update_attributes(params[:user])
49
+ if params[:user]
50
+ if Rails::VERSION::MAJOR == 3
51
+ @user.update_attributes(params[:user])
52
+ else
53
+ @user.update_attributes(params.require(:user).permit(*User.permitted_attributes))
54
+ end
55
+ end
50
56
  @user.populate_attributes if params[:update_directory]
51
57
  @user.avatar = nil if params[:delete_avatar]
52
58
  unless @user.save
@@ -109,8 +115,8 @@ module Sufia::UsersControllerBehavior
109
115
  end
110
116
 
111
117
  def find_user
112
- @user = User.from_url_component(params[:uid])
113
- redirect_to root_path, alert: "User '#{params[:uid]}' does not exist" if @user.nil?
118
+ @user = User.from_url_component(params[:id])
119
+ redirect_to root_path, alert: "User '#{params[:id]}' does not exist" if @user.nil?
114
120
  end
115
121
 
116
122
  def user_is_current_user