sufia 6.0.0.beta1 → 6.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +12 -2
- data/Gemfile +10 -1
- data/History.md +21 -0
- data/SUFIA_VERSION +1 -1
- data/app/assets/images/orcid.png +0 -0
- data/app/assets/javascripts/sufia.js +1 -1
- data/app/assets/javascripts/sufia/batch_edit.js +36 -54
- data/app/assets/javascripts/sufia/edit_metadata.js +10 -11
- data/app/assets/javascripts/sufia/permissions.js +2 -26
- data/app/assets/stylesheets/sufia.css.scss +10 -2
- data/app/assets/stylesheets/sufia/_batch-edit.scss +8 -6
- data/app/assets/stylesheets/sufia/_dashboard.scss +10 -0
- data/app/assets/stylesheets/sufia/_settings.scss +1 -0
- data/app/assets/stylesheets/sufia/_styles.scss +5 -3
- data/app/controllers/batch_controller.rb +9 -6
- data/app/controllers/batch_edits_controller.rb +2 -2
- data/app/controllers/collections_controller.rb +19 -3
- data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +30 -29
- data/app/controllers/concerns/sufia/breadcrumbs.rb +8 -3
- data/app/controllers/concerns/sufia/files_controller_behavior.rb +19 -7
- data/app/controllers/concerns/sufia/users_controller_behavior.rb +14 -2
- data/app/controllers/single_use_links_viewer_controller.rb +5 -1
- data/app/forms/sufia/forms/batch_edit_form.rb +6 -0
- data/app/forms/sufia/forms/collection_edit_form.rb +17 -0
- data/app/forms/sufia/forms/generic_file_edit_form.rb +16 -0
- data/app/helpers/generic_file_helper.rb +3 -47
- data/app/helpers/sufia/permissions_helper.rb +29 -0
- data/app/helpers/sufia/sufia_helper_behavior.rb +11 -0
- data/app/inputs/multi_value_with_help_input.rb +8 -0
- data/app/inputs/select_with_help_input.rb +3 -0
- data/app/inputs/select_with_modal_help_input.rb +36 -0
- data/app/inputs/with_help_icon.rb +32 -0
- data/app/models/concerns/sufia/solr_document_behavior.rb +1 -1
- data/app/presenters/sufia/collection_presenter.rb +29 -0
- data/app/presenters/sufia/generic_file_presenter.rb +14 -0
- data/app/presenters/sufia/presenter_renderer.rb +53 -0
- data/app/views/batch/_metadata.html.erb +10 -44
- data/app/views/batch/_more_metadata.html.erb +3 -2
- data/app/views/batch/edit.html.erb +2 -2
- data/app/views/batch_edits/edit.html.erb +13 -17
- data/app/views/collections/_form.html.erb +5 -5
- data/app/views/collections/_show_descriptions.html.erb +8 -10
- data/app/views/collections/edit.html.erb +8 -9
- data/app/views/collections/edit_fields/_description.html.erb +1 -2
- data/app/views/dashboard/_index_partials/_stats.html.erb +3 -3
- data/app/views/generic_files/_descriptions.html.erb +5 -8
- data/app/views/generic_files/_permission_form.html.erb +8 -17
- data/app/views/generic_files/_show_descriptions.html.erb +3 -4
- data/app/views/generic_files/edit.html.erb +1 -2
- data/app/views/generic_files/jq_upload.json.jbuilder +8 -0
- data/app/views/records/edit_fields/_default.html.erb +5 -10
- data/app/views/records/edit_fields/_description.html.erb +5 -10
- data/app/views/records/edit_fields/_resource_type.html.erb +2 -5
- data/app/views/records/edit_fields/_rights.html.erb +3 -9
- data/app/views/single_use_links_viewer/show.html.erb +10 -16
- data/app/views/users/_profile.html.erb +1 -2
- data/app/views/users/_user_info.html.erb +20 -3
- data/app/views/users/edit.html.erb +11 -2
- data/app/views/users/show.html.erb +1 -1
- data/config/locales/sufia.en.yml +46 -26
- data/config/routes.rb +1 -1
- data/lib/generators/sufia/install_generator.rb +4 -0
- data/lib/sufia.rb +4 -0
- data/lib/sufia/form_builder.rb +16 -0
- data/lib/sufia/version.rb +1 -1
- data/spec/actors/generic_file/actor_spec.rb +1 -2
- data/spec/controllers/batch_controller_spec.rb +16 -48
- data/spec/controllers/batch_edits_controller_spec.rb +27 -16
- data/spec/controllers/collections_controller_spec.rb +81 -61
- data/spec/controllers/generic_files_controller_spec.rb +17 -2
- data/spec/controllers/users_controller_spec.rb +13 -3
- data/spec/features/collection_spec.rb +93 -88
- data/spec/features/users_spec.rb +1 -1
- data/spec/forms/collection_edit_form_spec.rb +20 -0
- data/spec/forms/generic_file_edit_form_spec.rb +26 -0
- data/spec/helpers/generic_file_helper_spec.rb +33 -7
- data/spec/helpers/permissions_helper_spec.rb +21 -0
- data/spec/inputs/multi_value_with_help_input_spec.rb +25 -0
- data/spec/inputs/select_with_modal_help_input_spec.rb +21 -0
- data/spec/jobs/batch_update_job_spec.rb +11 -14
- data/spec/lib/sufia/breadcrumbs_spec.rb +46 -8
- data/spec/models/generic_file_spec.rb +0 -13
- data/spec/models/user_spec.rb +23 -0
- data/spec/presenters/presenter_renderer_spec.rb +19 -0
- data/spec/presenters/sufia/generic_file_presenter_spec.rb +12 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/support/input_support.rb +12 -0
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- data/spec/views/batch/edit.html.erb_spec.rb +13 -23
- data/spec/views/batch_edits/edit.html.erb_spec.rb +19 -0
- data/spec/views/collections/_form.html.erb_spec.rb +26 -28
- data/spec/views/collections/_show_descriptions.html.erb_spec.rb +15 -9
- data/spec/views/dashboard/index_spec.rb +2 -2
- data/spec/views/generic_file/_permission_form.html.erb_spec.rb +23 -0
- data/spec/views/generic_file/edit.html.erb_spec.rb +5 -0
- data/spec/views/generic_file/show.html.erb_spec.rb +5 -0
- data/sufia-models/app/actors/sufia/generic_file/actor.rb +1 -1
- data/sufia-models/app/jobs/batch_update_job.rb +5 -5
- data/sufia-models/app/models/batch.rb +7 -3
- data/sufia-models/app/models/concerns/sufia/collection.rb +7 -25
- data/sufia-models/app/models/concerns/sufia/generic_file.rb +0 -1
- data/sufia-models/app/models/concerns/sufia/generic_file/export.rb +2 -2
- data/sufia-models/app/models/concerns/sufia/generic_file/indexing.rb +4 -13
- data/sufia-models/app/models/concerns/sufia/generic_file/metadata.rb +1 -1
- data/sufia-models/app/models/concerns/sufia/user.rb +24 -17
- data/sufia-models/app/models/sufia/orcid_validator.rb +8 -0
- data/sufia-models/app/services/sufia/generic_file_indexing_service.rb +13 -0
- data/sufia-models/app/services/sufia/indexing_service.rb +15 -0
- data/sufia-models/lib/generators/sufia/models/abstract_migration_generator.rb +30 -0
- data/sufia-models/lib/generators/sufia/models/cached_stats_generator.rb +3 -47
- data/sufia-models/lib/generators/sufia/models/install_generator.rb +11 -31
- data/sufia-models/lib/generators/sufia/models/orcid_field_generator.rb +19 -0
- data/sufia-models/lib/generators/sufia/models/proxies_generator.rb +2 -31
- data/sufia-models/lib/generators/sufia/models/templates/config/redis.yml +3 -0
- data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +3 -0
- data/sufia-models/lib/generators/sufia/models/templates/migrations/add_orcid_to_users.rb +5 -0
- data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +2 -33
- data/sufia-models/lib/generators/sufia/models/user_stats_generator.rb +31 -0
- data/sufia-models/lib/sufia/models/engine.rb +1 -0
- data/sufia-models/lib/sufia/models/version.rb +1 -1
- data/sufia-models/sufia-models.gemspec +5 -5
- data/sufia.gemspec +2 -3
- metadata +49 -39
- data/app/assets/javascripts/sufia/multiForm.js +0 -67
- data/app/helpers/records_helper.rb +0 -4
- data/app/helpers/sufia/records_helper_behavior.rb +0 -68
- data/app/views/batch_edits/update_edit.js.erb +0 -5
- data/app/views/collections/_edit_descriptions.html.erb +0 -18
- data/app/views/collections/edit_fields/_title.html.erb +0 -3
- data/app/views/generic_files/_field_form.html.erb +0 -20
- data/app/views/records/_edit_field.html.erb +0 -22
- data/app/views/records/edit_fields/_suffix.html.erb +0 -10
- data/app/views/records/edit_fields/_type.html.erb +0 -8
- data/app/views/users/_social_media_info.html.erb +0 -20
- data/spec/helpers/records_helper_spec.rb +0 -102
- data/spec/models/generic_file/web_form_spec.rb +0 -35
- data/sufia-models/app/models/concerns/sufia/generic_file/accessible_attributes.rb +0 -87
- data/sufia-models/app/models/concerns/sufia/generic_file/web_form.rb +0 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23a8aa646f0192a0e3637c499d513f8ee363f128
|
4
|
+
data.tar.gz: 7d98159bb2f6b95131dc290c271a53e62e18a043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 329dd1e4e2580887878b25c14f8dc7553de38dd570da8ff66e37739e853a8d074524e4de8c31afda32e0140591633a256ecd3f173e1da4ff6c8c91dc0252bdd0
|
7
|
+
data.tar.gz: eea2cc4345bbd3c245d6c638cf8442151cc89e68d88de0957cadabf4444248dbcdcac17c7caab02fafa3b583cb8bab1c11c0b676a37efaa2c61edfe52bba876a
|
data/.travis.yml
CHANGED
@@ -1,10 +1,20 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: false
|
2
4
|
rvm:
|
3
5
|
- 2.1
|
4
|
-
- 2.0
|
5
6
|
env:
|
6
7
|
global:
|
7
|
-
|
8
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
9
|
+
|
10
|
+
matrix:
|
11
|
+
- "RAILS_VERSION=4.1.8"
|
12
|
+
- "RAILS_VERSION=4.2.0"
|
13
|
+
|
14
|
+
matrix:
|
15
|
+
allow_failures:
|
16
|
+
- env: "RAILS_VERSION=4.2.0"
|
17
|
+
|
8
18
|
notifications:
|
9
19
|
email:
|
10
20
|
recipients:
|
data/Gemfile
CHANGED
@@ -6,7 +6,7 @@ gemspec
|
|
6
6
|
# Required for doing pagination inside an engine. See https://github.com/amatsuda/kaminari/pull/322
|
7
7
|
gem 'kaminari', github: 'harai/kaminari', branch: 'route_prefix_prototype'
|
8
8
|
gem 'sufia-models', path: './sufia-models'
|
9
|
-
gem '
|
9
|
+
gem 'slop', '~> 3.6.0' # This just helps us generate a valid Gemfile.lock when Rails 4.2 is installed (which requires byebug which has a dependency on slop)
|
10
10
|
|
11
11
|
group :development, :test do
|
12
12
|
gem "simplecov", require: false
|
@@ -17,4 +17,13 @@ file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_
|
|
17
17
|
if File.exists?(file)
|
18
18
|
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
19
19
|
instance_eval File.read(file)
|
20
|
+
else
|
21
|
+
gem 'rails', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
|
22
|
+
|
23
|
+
if ENV['RAILS_VERSION'] and ENV['RAILS_VERSION'] =~ /^4.2/
|
24
|
+
gem 'responders', "~> 2.0"
|
25
|
+
gem 'sass-rails', ">= 5.0"
|
26
|
+
else
|
27
|
+
gem 'sass-rails', "< 5.0"
|
28
|
+
end
|
20
29
|
end
|
data/History.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# History of Sufia releases
|
2
2
|
|
3
|
+
## 4.3.1
|
4
|
+
|
5
|
+
* Adds an ORCID field to the user model. [Michael J. Giarlo]
|
6
|
+
* Styles count for views and downloads, refs #9672 [Michael Tribone]
|
7
|
+
* Merge pull request #787 from projecthydra/update_master_to_bl-5.8 [Justin Coyne]
|
8
|
+
* More facets modal defaults to numerical sort [Adam Wead]
|
9
|
+
* Upgrade to Blacklight 5.8 [Adam Wead]
|
10
|
+
* Adding select2 name look up to permissions form for GenericFile and Batch. [Carolyn Cole]
|
11
|
+
* Adding blacklight gallery default views to catalog controller to match with the new installer.
|
12
|
+
* Display file stats for user. Feature #9305 [Valerie Maher]
|
13
|
+
* Making sure the modal is actually sorted numerically and allow some files to be on the second p
|
14
|
+
* Fixing a bug that the home page crashes when a featured work has been destroyed [Carolyn Cole]
|
15
|
+
* Fixes button size and alignment issues with metadata and upload forms, refs #9569 [Michael Tribone]
|
16
|
+
* Updated dev notes [Valerie Maher]
|
17
|
+
* Disable check all instead of making it disappear. User testing indicated this was confusing [Carolyn Cole]
|
18
|
+
* Views should not use the invalid Agent schema.org class [Michael J. Giarlo]
|
19
|
+
* README should not implicitly suggest an outdated version of Sufia. (Inspired by #719 -- thx, @mistydemeo!) [Michael J. Giarlo]
|
20
|
+
|
21
|
+
## 4.3.0 - YANKED
|
22
|
+
|
3
23
|
## 4.2.0
|
4
24
|
|
5
25
|
* Caches google analytics data in the database so we do not have to retrieve them each time the page is loaded [Carolyn Cole]
|
@@ -172,6 +192,7 @@ This release contains bug fixes and css fixes found after the Sufia 4.0 release.
|
|
172
192
|
* changing to bootstrap 3 danger from important to get the red background for permissions, and fixing collection detail spacing when there is no description [Carolyn Cole]
|
173
193
|
* Upgrade to rspec 3. Fixes #493 [Carolyn Cole]
|
174
194
|
* Removed extraneous colons preceding key names. Fixes #516 [kerchner]
|
195
|
+
|
175
196
|
## 4.0.0.rc1
|
176
197
|
|
177
198
|
* Use the bootstrap_form helpers (bootstrap_forms is no longer available) [Justin Coyne]
|
data/SUFIA_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.0.0.
|
1
|
+
6.0.0.rc1
|
Binary file
|
@@ -35,7 +35,6 @@
|
|
35
35
|
//= require sufia/trophy
|
36
36
|
//= require sufia/featured_works
|
37
37
|
//= require sufia/batch_select_all
|
38
|
-
//= require sufia/multiForm
|
39
38
|
//= require sufia/edit_metadata
|
40
39
|
//= require sufia/single_use_link
|
41
40
|
//= require sufia/audio
|
@@ -51,6 +50,7 @@
|
|
51
50
|
//= require sufia/batch
|
52
51
|
|
53
52
|
//= require hydra_collections
|
53
|
+
//= require hydra-editor/hydra-editor
|
54
54
|
|
55
55
|
//
|
56
56
|
// For Browse-everything until https://github.com/projecthydra-labs/browse-everything/issues/85 is resolved:
|
@@ -3,17 +3,6 @@ function batch_edit_init () {
|
|
3
3
|
// initialize popover helpers
|
4
4
|
$("a[rel=popover]").popover({ html: true });
|
5
5
|
|
6
|
-
$("tr.expandable").click(function () {
|
7
|
-
$(this).next("ul").slideToggle();
|
8
|
-
|
9
|
-
$(this).find('i.toggle').toggleClass("glyphicon glyphicon-chevron-down");
|
10
|
-
});
|
11
|
-
|
12
|
-
$("tr.expandable_new").click(function () {
|
13
|
-
$(this).find('i').toggleClass("glyphicon glyphicon-chevron-down");
|
14
|
-
});
|
15
|
-
|
16
|
-
|
17
6
|
function deserialize(Params) {
|
18
7
|
var Data = Params.split("&");
|
19
8
|
var i = Data.length;
|
@@ -116,32 +105,45 @@ function batch_edit_init () {
|
|
116
105
|
|
117
106
|
ajaxManager.run();
|
118
107
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
var outer_div = "#detail_" + key;
|
123
|
-
$("#status_" + key).html("Changes Saved");
|
124
|
-
$(save_button).removeAttr("disabled");
|
125
|
-
$(outer_div).removeClass("loading");
|
126
|
-
$('#' + form_id).children([".form-group"]).removeClass('hidden')
|
108
|
+
|
109
|
+
function after_ajax(form) {
|
110
|
+
form.enableForm();
|
127
111
|
}
|
128
112
|
|
129
|
-
function before_ajax(
|
130
|
-
|
131
|
-
var save_button = "#" + key + "_save";
|
132
|
-
var outer_div = "#detail_" + key;
|
133
|
-
$(save_button).attr("disabled", "disabled");
|
134
|
-
$(outer_div).addClass("loading");
|
135
|
-
$('#' + form_id).children([".form-group"]).addClass('hidden')
|
113
|
+
function before_ajax(form) {
|
114
|
+
form.disableForm();
|
136
115
|
}
|
137
116
|
|
117
|
+
var BatchEditField = function (form) {
|
118
|
+
this.form = form;
|
119
|
+
this.formButtons = form.find('.btn');
|
120
|
+
this.formFields = form.find('.form-group > *');
|
121
|
+
this.formRightPanel = form.find('.form-group');
|
122
|
+
this.statusField = form.find('.status');
|
123
|
+
}
|
124
|
+
|
125
|
+
BatchEditField.prototype = {
|
126
|
+
disableForm: function () {
|
127
|
+
this.formButtons.attr("disabled", "disabled");
|
128
|
+
this.formRightPanel.addClass("loading");
|
129
|
+
this.formFields.addClass('invisible')
|
130
|
+
},
|
131
|
+
|
132
|
+
enableForm: function () {
|
133
|
+
this.statusField.html("Changes Saved");
|
134
|
+
this.formButtons.removeAttr("disabled");
|
135
|
+
this.formRightPanel.removeClass("loading");
|
136
|
+
this.formFields.removeClass('invisible')
|
137
|
+
}
|
138
|
+
}
|
138
139
|
|
139
140
|
function runSave(e) {
|
140
141
|
e.preventDefault();
|
141
142
|
var button = $(this);
|
142
|
-
var form =
|
143
|
-
var
|
144
|
-
|
143
|
+
var form = button.closest('form');
|
144
|
+
var f = new BatchEditField(form);
|
145
|
+
var form_id = form[0].id;
|
146
|
+
before_ajax(f);
|
145
147
|
|
146
148
|
ajaxManager.addReq({
|
147
149
|
form: form_id,
|
@@ -150,38 +152,18 @@ function batch_edit_init () {
|
|
150
152
|
dataType: "json",
|
151
153
|
type: form.attr("method").toUpperCase(),
|
152
154
|
data: form.serialize(),
|
153
|
-
|
154
|
-
after_ajax(
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
alert("Error! Status: " + e.status);
|
159
|
-
}
|
155
|
+
success: function (e) {
|
156
|
+
after_ajax(f);
|
157
|
+
},
|
158
|
+
fail: function (e) {
|
159
|
+
alert("Error! Status: " + e.status);
|
160
160
|
}
|
161
161
|
});
|
162
162
|
setTimeout(ajaxManager.runNow(), 100);
|
163
163
|
}
|
164
164
|
|
165
|
-
function enable_show_hide_links() {
|
166
|
-
// Show/hide field details when clicking on a link with ID "expand_link_XXX".
|
167
|
-
// We expect to find an element named detail_XXX in addition to the expand_link_XXX.
|
168
|
-
// The "detail_XXX" element has the chevron icon.
|
169
|
-
$('.glyphicon-chevron-right-helper').on('click', function() {
|
170
|
-
var array = this.id.split("expand_link_");
|
171
|
-
if (array.length > 1) {
|
172
|
-
var docId = array[1];
|
173
|
-
$("#detail_" + docId + " .expanded-details").slideToggle();
|
174
|
-
var button = $("#expand_" + docId);
|
175
|
-
button.toggleClass('glyphicon-chevron-right glyphicon-chevron-down');
|
176
|
-
}
|
177
|
-
return false;
|
178
|
-
});
|
179
|
-
}
|
180
|
-
|
181
165
|
$("#permissions_save").click(runSave);
|
182
166
|
$(".field-save").click(runSave);
|
183
|
-
enable_show_hide_links();
|
184
|
-
|
185
167
|
}
|
186
168
|
|
187
169
|
|
@@ -51,13 +51,11 @@ Blacklight.onLoad(function() {
|
|
51
51
|
|
52
52
|
autocomplete_vocab.url_var = ['subject', 'language']; // the url variable to pass to determine the vocab to attach to
|
53
53
|
autocomplete_vocab.field_name = new Array(); // the form name to attach the event for autocomplete
|
54
|
-
autocomplete_vocab.add_btn_id = new Array(); // the id of the button pressed when adding an additional form element
|
55
54
|
|
56
55
|
// loop over the autocomplete fields and attach the
|
57
56
|
// events for autocomplete and create other array values for autocomplete
|
58
57
|
for (var i=0; i < autocomplete_vocab.url_var.length; i++) {
|
59
58
|
autocomplete_vocab.field_name.push('generic_file_' + autocomplete_vocab.url_var[i]);
|
60
|
-
autocomplete_vocab.add_btn_id.push('additional_' + autocomplete_vocab.url_var[i] + '_submit');
|
61
59
|
// autocompletes
|
62
60
|
$("#" + autocomplete_vocab.field_name[i])
|
63
61
|
// don't navigate away from the field on tab when selecting an item
|
@@ -68,19 +66,20 @@ Blacklight.onLoad(function() {
|
|
68
66
|
}
|
69
67
|
})
|
70
68
|
.autocomplete( get_autocomplete_opts(autocomplete_vocab.url_var[i]) );
|
71
|
-
|
72
69
|
}
|
73
70
|
|
74
71
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
cloneElem.
|
72
|
+
// attach an auto complete based on the field
|
73
|
+
function setup_autocomplete(e, cloneElem) {
|
74
|
+
var $cloneElem = $(cloneElem);
|
75
|
+
// FIXME this code (comparing the id) depends on a bug. Each input has an id and the id is
|
76
|
+
// duplicated when you press the plus button. This is not valid html.
|
77
|
+
if ($cloneElem.attr("id") == 'generic_file_based_near') {
|
78
|
+
$cloneElem.autocomplete(cities_autocomplete_opts);
|
79
|
+
} else if ( (index = $.inArray($cloneElem.attr("id"), autocomplete_vocab.field_name)) != -1 ) {
|
80
|
+
$cloneElem.autocomplete(get_autocomplete_opts(autocomplete_vocab.url_var[index]));
|
82
81
|
}
|
83
82
|
}
|
84
83
|
|
85
|
-
$('form').
|
84
|
+
$('.multi_value.form-group').manage_fields({add: setup_autocomplete});
|
86
85
|
});
|
@@ -9,33 +9,9 @@
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
Blacklight.onLoad(function() {
|
12
|
-
// input for uids - attach function to verify uid
|
13
|
-
$('#new_user_name_skel').on('blur', function() {
|
14
|
-
// clear out any existing messages
|
15
|
-
$('#directory_user_result').html('');
|
16
|
-
var un = $('#new_user_name_skel').val();
|
17
|
-
var perm = $('#new_user_permission_skel').val();
|
18
|
-
if ( $.trim(un).length == 0 ) {
|
19
|
-
return;
|
20
|
-
}
|
21
|
-
$.ajax( {
|
22
|
-
url: "/directory/user/" + un,
|
23
|
-
success: function( data ) {
|
24
|
-
if (data != null) {
|
25
|
-
if (!data.length) {
|
26
|
-
$('#directory_user_result').html('User id ('+un+ ') does not exist.');
|
27
|
-
$('#new_user_name_skel').select();
|
28
|
-
$('#new_user_permission_skel').val('none');
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
else {
|
32
|
-
$('#new_user_permission_skel').focus();
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
});
|
37
12
|
|
38
|
-
|
13
|
+
// Attach the user search select2 box to the permission form
|
14
|
+
$("#new_user_name_skel").userSearch();
|
39
15
|
|
40
16
|
// add button for new user
|
41
17
|
$('#add_new_user_skel').on('click', function() {
|
@@ -15,8 +15,11 @@
|
|
15
15
|
|
16
16
|
// Use import here instead of require so we can use the Sass variables defined in Bootstrap and Blacklight
|
17
17
|
// TODO: Probably should use import throughout and move all of Sufia's stylesheets into a single named directory.
|
18
|
-
@import 'sufia/settings','sufia/header','sufia/styles','sufia/file-listing',
|
19
|
-
'sufia/
|
18
|
+
@import 'sufia/settings', 'sufia/header', 'sufia/styles', 'sufia/file-listing',
|
19
|
+
'sufia/collections', 'sufia/batch-edit', 'sufia/dashboard', 'sufia/home-page',
|
20
|
+
'sufia/featured', 'sufia/tagcloud', 'sufia/usage-stats', 'sufia/catalog', 'sufia/buttons',
|
21
|
+
'sufia/proxy-rights';
|
22
|
+
@import 'hydra-editor/multi_value_fields';
|
20
23
|
|
21
24
|
#browse-everything {
|
22
25
|
top:10%;
|
@@ -35,6 +38,11 @@
|
|
35
38
|
padding-top: 10px;
|
36
39
|
}
|
37
40
|
|
41
|
+
.profile img.orcid {
|
42
|
+
float: left;
|
43
|
+
margin-right: 2px;
|
44
|
+
}
|
45
|
+
|
38
46
|
/* This class is to workaround an issue in which Bootstrap requires a div to display a tooltip
|
39
47
|
* on a disabled button. Using a span instead of a div would be ideal but unfortunately it does
|
40
48
|
* not render the tooltip correctly in all browsers (e.g. in Chrome the tooltip is detected in
|
@@ -5,12 +5,6 @@
|
|
5
5
|
top: 5px;
|
6
6
|
}
|
7
7
|
|
8
|
-
.form-horizontal .batch-group {
|
9
|
-
@extend .form-group;
|
10
|
-
margin-left: 0px;
|
11
|
-
margin-right: 0px;
|
12
|
-
}
|
13
|
-
|
14
8
|
#hide_addl_descriptions {
|
15
9
|
margin-bottom: 10px;
|
16
10
|
}
|
@@ -19,3 +13,11 @@
|
|
19
13
|
padding-top: 5px;
|
20
14
|
}
|
21
15
|
|
16
|
+
.glyphicon-chevron-right-helper.collapsed .chevron {
|
17
|
+
@extend .glyphicon-chevron-right;
|
18
|
+
}
|
19
|
+
.glyphicon-chevron-right-helper .chevron {
|
20
|
+
@extend .glyphicon;
|
21
|
+
@extend .glyphicon-chevron-down;
|
22
|
+
}
|
23
|
+
|
@@ -18,6 +18,16 @@
|
|
18
18
|
background-color: $badge-background-color;
|
19
19
|
color: $badge-font-color;
|
20
20
|
}
|
21
|
+
.badge-optional {
|
22
|
+
background-color: $badge-optional-background-color;
|
23
|
+
border-radius: 2px;
|
24
|
+
color: $badge-font-color;
|
25
|
+
padding: 0 .25em;
|
26
|
+
}
|
27
|
+
.views-downloads-dashboard {
|
28
|
+
list-style-type: none;
|
29
|
+
padding-left: 0;
|
30
|
+
}
|
21
31
|
.panel-default > .panel-heading {
|
22
32
|
background-color: $panel-background-color;
|
23
33
|
}
|
@@ -23,6 +23,7 @@ $teal: #2CAEB7;
|
|
23
23
|
$vermilion: #F30;
|
24
24
|
|
25
25
|
$badge-background-color: $highlight-yellow;
|
26
|
+
$badge-optional-background-color: $gray-medium;
|
26
27
|
$badge-font-color: $classic-white;
|
27
28
|
$content-wrapper-background-color: $cream-light;
|
28
29
|
$dashboard-background-color: $classic-white;
|
@@ -6,11 +6,8 @@ class BatchController < ApplicationController
|
|
6
6
|
prepend_before_filter :normalize_identifier, only: [:edit, :show, :update, :destroy]
|
7
7
|
|
8
8
|
def edit
|
9
|
-
@batch =
|
10
|
-
@
|
11
|
-
@generic_file.creator = [current_user.name]
|
12
|
-
@generic_file.title = @batch.generic_files.map(&:label)
|
13
|
-
@generic_file.initialize_fields
|
9
|
+
@batch = Batch.find_or_create(params[:id])
|
10
|
+
@form = edit_form
|
14
11
|
end
|
15
12
|
|
16
13
|
def update
|
@@ -18,13 +15,19 @@ class BatchController < ApplicationController
|
|
18
15
|
@batch = Batch.find_or_create(params[:id])
|
19
16
|
@batch.status = ["processing"]
|
20
17
|
@batch.save
|
21
|
-
Sufia.
|
18
|
+
file_attributes = Sufia::Forms::BatchEditForm.model_attributes(params[:generic_file])
|
19
|
+
Sufia.queue.push(BatchUpdateJob.new(current_user.user_key, params[:id], params[:title], file_attributes, params[:visibility]))
|
22
20
|
flash[:notice] = 'Your files are being processed by ' + t('sufia.product_name') + ' in the background. The metadata and access controls you specified are being applied. Files will be marked <span class="label label-danger" title="Private">Private</span> until this process is complete (shouldn\'t take too long, hang in there!). You may need to refresh your dashboard to see these updates.'
|
23
21
|
redirect_to sufia.dashboard_files_path
|
24
22
|
end
|
25
23
|
|
26
24
|
protected
|
27
25
|
|
26
|
+
def edit_form
|
27
|
+
generic_file = GenericFile.new(creator: [current_user.name], title: @batch.generic_files.map(&:label))
|
28
|
+
Sufia::Forms::BatchEditForm.new(generic_file)
|
29
|
+
end
|
30
|
+
|
28
31
|
# override this method if you need to initialize more complex RDF assertions (b-nodes)
|
29
32
|
def initialize_fields(file)
|
30
33
|
file.initialize_fields
|