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
@@ -17,12 +17,8 @@
|
|
17
17
|
|
18
18
|
<div class="well">
|
19
19
|
|
20
|
-
<!-- Visibility -->
|
21
|
-
<% visibility_text = capture do %>
|
22
|
-
<%= render partial: 'generic_files/visibility' %>
|
23
|
-
<% end %>
|
24
20
|
<h3>Visibility - <small>who should have the ability to read and download</small>
|
25
|
-
<span id="visibility_tooltip" class="h5"><%=
|
21
|
+
<span id="visibility_tooltip" class="h5"><%= visibility_help %></span>
|
26
22
|
</h3>
|
27
23
|
<div class="radio">
|
28
24
|
<label>
|
@@ -37,24 +33,19 @@
|
|
37
33
|
</div>
|
38
34
|
|
39
35
|
<!-- Share With -->
|
40
|
-
<% share_with_text = capture do %>
|
41
|
-
<%= render partial: 'generic_files/share_with' %>
|
42
|
-
<% end %>
|
43
36
|
<div class="row">
|
44
37
|
<h3 class="col-sm-12">Share With <small>(optional)</small>
|
45
|
-
<span id="share_with_tooltip" class="h5"><%=
|
38
|
+
<span id="share_with_tooltip" class="h5"><%= share_with_help %></span>
|
46
39
|
</h3>
|
47
40
|
</div>
|
48
41
|
|
49
|
-
<div class="form-group">
|
42
|
+
<div class="form-group row">
|
50
43
|
<div id="new-user">
|
51
44
|
<p class="col-sm-12">Enter <%=t('sufia.account_label') %> (one at a time)</p>
|
52
|
-
<p class="sr-only">Use the add button to give access to one <%=t('sufia.account_label') %> at a time (it will be added to the list below).</p>
|
45
|
+
<p class="sr-only">Use the add button to give access to one <%=t('sufia.account_label') %> at a time (it will be added to the list below). Select the user, by name or <%=t('sufia.account_label') %>. Then select the access level you wish to grant and click on Add this <%= t('sufia.account_label') %> to complete adding the permission.</p>
|
53
46
|
<div class="col-sm-5">
|
54
|
-
<
|
55
|
-
|
56
|
-
<%= text_field_tag 'new_user_name_skel', nil, class: "form-control" %><span class="input-group-addon"><%=t('sufia.directory.suffix') %></span>
|
57
|
-
</div>
|
47
|
+
<label for="new_user_name_skel" class="sr-only"><%= t('sufia.account_label') %> (without the <%= t('sufia.directory.suffix') %> part)</label>
|
48
|
+
<%= text_field_tag 'new_user_name_skel', nil %>
|
58
49
|
</div>
|
59
50
|
<div class="col-sm-4">
|
60
51
|
<label for="new_user_permission_skel" class="sr-only">Access type to grant</label>
|
@@ -70,7 +61,7 @@
|
|
70
61
|
</div>
|
71
62
|
</div>
|
72
63
|
|
73
|
-
<div class="form-group">
|
64
|
+
<div class="form-group row">
|
74
65
|
<div id="new-group" >
|
75
66
|
<p class="sr-only">Use the add button to give access to one group at a time (it will be added to the list below).</p>
|
76
67
|
<div class="col-sm-5">
|
@@ -111,7 +102,7 @@
|
|
111
102
|
<% next if ['public', 'registered', depositor].include? permission_fields.object.agent_name.downcase %>
|
112
103
|
<tr>
|
113
104
|
<td><%= permission_fields.label :agent_name, class: "control-label" do %>
|
114
|
-
<%= permission_fields.object.agent_name %>
|
105
|
+
<%= user_display_name_and_key(permission_fields.object.agent_name) %>
|
115
106
|
<% end %></td>
|
116
107
|
<td>
|
117
108
|
<div class="col-sm-8">
|
@@ -1,12 +1,11 @@
|
|
1
|
-
<% generic_file ||= @generic_file %>
|
2
1
|
|
3
2
|
<h2 class="non lower">Descriptions</h2>
|
4
3
|
<table class="table table-striped"><!-- class="verticalheadings"> -->
|
5
4
|
<tbody>
|
6
|
-
<% (
|
5
|
+
<% present_terms(@presenter) do |r, term| %>
|
7
6
|
<tr>
|
8
|
-
<th><%=
|
9
|
-
<td><%=
|
7
|
+
<th><%= r.label(term) %></th>
|
8
|
+
<td><%= r.value(term) %></td>
|
10
9
|
</tr>
|
11
10
|
<% end %>
|
12
11
|
</tbody>
|
@@ -10,7 +10,6 @@
|
|
10
10
|
<%= render partial: 'media_display' %>
|
11
11
|
</div>
|
12
12
|
<div class="col-xs-12 col-sm-8">
|
13
|
-
<%= link_to "<<Browse view".html_safe, sufia.generic_file_path(@generic_file) %>
|
14
13
|
<ul class="nav nav-tabs">
|
15
14
|
<li id="edit_descriptions_link" class="active">
|
16
15
|
<a href="#descriptions_display" data-toggle="tab"><i class="glyphicon glyphicon-tags"></i> Descriptions</a>
|
@@ -23,7 +22,7 @@
|
|
23
22
|
</li>
|
24
23
|
</ul>
|
25
24
|
<div class="tab-content">
|
26
|
-
<%= render "descriptions",
|
25
|
+
<%= render "descriptions", form: @form %>
|
27
26
|
<%= render "permission", generic_file: @generic_file %>
|
28
27
|
<%= render "versioning", generic_file: @generic_file %>
|
29
28
|
</div>
|
@@ -1,10 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<%= f.text_field :title, name: "#{ActiveModel::Naming.singular(f.object)}[#{key.to_s}]", id: "#{ActiveModel::Naming.singular(f.object)}_#{key.to_s}", value: v, class: "form-control", required: required %>
|
7
|
-
<% end %>
|
8
|
-
<%= render "records/edit_fields/suffix", key: key, index: index, single: f.object.class.unique?(key) %>
|
9
|
-
</div>
|
10
|
-
<div id="additional_<%= key %>_elements"></div>
|
1
|
+
<% if f.object.class.multiple? key %>
|
2
|
+
<%= f.input key, as: :multi_value_with_help, input_html: { class: 'form-control' }, required: f.object.required?(key) %>
|
3
|
+
<% else %>
|
4
|
+
<%= f.input key, required: f.object.required?(key) %>
|
5
|
+
<% end %>
|
@@ -1,10 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<%= f.text_area :description, name: "#{ActiveModel::Naming.singular(f.object)}[#{key.to_s}]", id: "#{ActiveModel::Naming.singular(f.object)}_#{key.to_s}", value: v, class: "form-control", required: required %>
|
7
|
-
<% end %>
|
8
|
-
<%= render "records/edit_fields/suffix", key: key, index: index, single: f.object.class.unique?(key) %>
|
9
|
-
</div>
|
10
|
-
<div id="additional_<%= key %>_elements"></div>
|
1
|
+
<% if f.object.class.multiple? key %>
|
2
|
+
<%= f.input :description, as: :multi_value_with_help, input_html: { rows: '14', type: 'textarea'}, required: false %>
|
3
|
+
<% else %>
|
4
|
+
<%= f.input :description, as: :text, input_html: { rows: '14' } %>
|
5
|
+
<% end %>
|
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%= f.select :resource_type, Sufia.config.resource_types.keys, {}, { multiple: true, size: 7, class: 'form-control' } %>
|
4
|
-
<p class="help-block">You may select multiple types to apply <%= help_icon(:resource_type) %><p>
|
5
|
-
</div>
|
1
|
+
<%= f.input :resource_type, as: :select_with_help, collection: Sufia.config.resource_types,
|
2
|
+
input_html: { class: 'form-control', multiple: true, required: true } %>
|
@@ -1,9 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
<% else %>
|
5
|
-
<%= f.select :rights, Sufia.config.cc_licenses, class: 'form-control' %>
|
6
|
-
<% end %>
|
7
|
-
<%= render "records/edit_fields/suffix", key: key, index: index %>
|
8
|
-
</div>
|
9
|
-
<div id="additional_<%= key %>_elements"></div>
|
1
|
+
<%= f.input :rights, as: :select, collection: Sufia.config.cc_licenses,
|
2
|
+
input_html: { class: 'form-control', multiple: true }
|
3
|
+
%>
|
@@ -7,21 +7,15 @@
|
|
7
7
|
<h2> Descriptions:</h2>
|
8
8
|
|
9
9
|
<div class="well active" id="descriptions_display">
|
10
|
-
|
10
|
+
<table class="table table-striped">
|
11
11
|
<tbody>
|
12
|
-
<% @
|
13
|
-
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
<% end %>
|
22
|
-
</td>
|
23
|
-
</tr>
|
24
|
-
<% end %>
|
25
|
-
</tbody></table> <!-- class="verticalheadings"> -->
|
26
|
-
</div><!-- /well -->
|
12
|
+
<% present_terms(@presenter) do |r, term| %>
|
13
|
+
<tr id='row_<%= term %>' class="expandable">
|
14
|
+
<th width="20%"><%= r.label(term) %></th>
|
15
|
+
<td><%= r.value(term) %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</tbody>
|
19
|
+
</table>
|
20
|
+
</div><!-- /well -->
|
27
21
|
</div>
|
@@ -1,14 +1,31 @@
|
|
1
1
|
<dl id="user_info" class="row">
|
2
|
+
|
3
|
+
<% if user.orcid.present? %>
|
4
|
+
<dt class="col-xs-5"><%= orcid_label('orcid') %></dt>
|
5
|
+
<dd class="col-xs-7"><%= link_to user.orcid, user.orcid, { target: '_blank' } %></dd>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<% if user.facebook_handle.present? %>
|
2
9
|
<dt class="col-xs-5"><i class="fa fa-facebook"></i> Facebook Handle</dt>
|
3
10
|
<dd class="col-xs-7"><%= link_to user.facebook_handle, "http://facebook.com/#{user.facebook_handle}", {target:'_blank'} %></dd>
|
11
|
+
<% end %>
|
4
12
|
|
13
|
+
<% if user.twitter_handle.present? %>
|
5
14
|
<dt class="col-xs-5"><i class="fa fa-twitter"></i> Twitter Handle</dt>
|
6
15
|
<dd class="col-xs-7"><%= link_to user.twitter_handle, "http://twitter.com/#{user.twitter_handle}", {target:'_blank'} %></dd>
|
7
|
-
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<% if user.googleplus_handle.present? %>
|
8
19
|
<dt class="col-xs-5"><i class="fa fa-google-plus"></i> Google+ Handle</dt>
|
9
20
|
<dd class="col-xs-7"><%= link_to user.googleplus_handle, "http://google.com/+#{user.googleplus_handle}", {target:'_blank'} %></dd>
|
10
|
-
|
11
|
-
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<% if user.linkedin_handle.present? %>
|
24
|
+
<dt class="col-xs-5"><i class="fa fa-linkedin"></i> LinkedIn</dt>
|
25
|
+
<dd class="col-xs-7"><%= link_to "#{@linkedInUrl}", "#{@linkedInUrl}", { target: '_blank' } %></dd>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<dt class="col-xs-5"><i class="fa fa-envelope"></i> Email</dt>
|
12
29
|
<dd class="col-xs-7"><%= mail_to user.email %></dd>
|
13
30
|
|
14
31
|
<% if user.chat_id %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<h1>Edit Profile</h1>
|
2
|
-
<div class="col-xs-12 col-sm-5">
|
2
|
+
<div class="col-xs-12 col-sm-5 profile">
|
3
3
|
<div class="well">
|
4
4
|
<%= form_for @user, url: sufia.profile_path(@user.to_param), html: {multipart: true, class: 'form-horizontal' } do |f| %>
|
5
5
|
<div class="form-group">
|
@@ -29,6 +29,15 @@
|
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
|
32
|
+
<div class="form-group">
|
33
|
+
<%= f.label :orcid, class: 'col-xs-4 control-label' do %>
|
34
|
+
<%= orcid_label %>
|
35
|
+
<% end %>
|
36
|
+
<div class="col-xs-8">
|
37
|
+
<%= f.text_field :orcid, class: "form-control" %>
|
38
|
+
</div>
|
39
|
+
</div><!-- .form-group -->
|
40
|
+
|
32
41
|
<div class="form-group">
|
33
42
|
<%= f.label :twitter_handle, '<i class="fa fa-twitter"></i> Twitter Handle'.html_safe, class: 'col-xs-4 control-label' %>
|
34
43
|
<div class="col-xs-8">
|
@@ -60,7 +69,7 @@
|
|
60
69
|
</div>
|
61
70
|
</div><!-- .col-xs-5 /well-->
|
62
71
|
|
63
|
-
<div class="col-xs-12 col-sm-offset-1 col-sm-6 well">
|
72
|
+
<div class="col-xs-12 col-sm-offset-1 col-sm-6 well profile">
|
64
73
|
<h2><i class="glyphicon glyphicon-user"></i> Directory Info (LDAP) <%= link_to 'Edit Instructions', 'http://www.psu.edu/directory/#update', class: 'btn btn-mini btn-primary' %></h3>
|
65
74
|
<%= render partial: 'user_info', locals: {user: @user} %>
|
66
75
|
|
data/config/locales/sufia.en.yml
CHANGED
@@ -47,11 +47,6 @@ en:
|
|
47
47
|
tab_label: "Network/Server Location"
|
48
48
|
processing: "File is being processed; you may edit when processing has completed"
|
49
49
|
field_label:
|
50
|
-
based_near: "Location"
|
51
|
-
description: "Abstract or Summary"
|
52
|
-
tag: "Keyword"
|
53
|
-
date_created: "Date Created"
|
54
|
-
related_url: "Related URL"
|
55
50
|
total_items: "Total Items"
|
56
51
|
size: "Size"
|
57
52
|
homepage:
|
@@ -119,27 +114,6 @@ en:
|
|
119
114
|
tag: "could not be updated. You do not have sufficient privileges to edit them."
|
120
115
|
title: "Files failed"
|
121
116
|
subject: "Batch upload permission denied"
|
122
|
-
metadata_help:
|
123
|
-
resource_type: "Pre-defined categories to describe the type of file content being uploaded, such as \"article\" or \"dataset.\" More than one type may be selected."
|
124
|
-
title: "A name for the file to aid in identifying it. Defaults to the file name, though a more descriptive title is encouraged. <em>This is a required field</em>."
|
125
|
-
tag: "Words or phrases you select to describe what the file is about. These are used to search for content. <em>This is a required field</em>."
|
126
|
-
subject: "Headings or index terms describing what the file is about; these <em>do</em> need to conform to an existing vocabulary. Currently supports Library of Congress Subject Headings."
|
127
|
-
creator: "The person or group responsible for the file being uploaded. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. \"Smith, John.\" <em>This is a required field</em>."
|
128
|
-
related_url: "A link to a website or other specific content (audio, video, PDF document) related to the file. An example is the URL of a research project from which the file was derived."
|
129
|
-
based_near: "A place name related to the file, such as its site of publication, or the city, state, or country the file's contents are about. Calls upon the GeoNames web service (<a href=\"http://www.geonames.org\">http://www.geonames.org</a>)."
|
130
|
-
contributor: "A person or group you want to recognize for playing a role in the creation of the file, but not the primary role. If there is a specific role you would like noted, include it in parentheses, e.g. \"Jones, Mary (advisor).\""
|
131
|
-
date_created: "The date on which the file was generated. Dates are accepted in the form YYYY-MM-DD, e.g. 1776-07-04."
|
132
|
-
description: "Free-text notes about the file itself. Examples include abstracts of a paper, citation information for a journal article, or a tag indicating a larger collection to which the file belongs."
|
133
|
-
identifier: "A unique handle describing the file. An example would be a DOI for a journal article, or an ISBN or OCLC number for a book."
|
134
|
-
language: "The language of the file content."
|
135
|
-
publisher: "The person or group making the file available. Generally this is the institution."
|
136
|
-
rights: "Licensing and distribution information governing access to the file. Select from the provided drop-down list. <em>This is a required field</em>."
|
137
|
-
aria_label:
|
138
|
-
default: "Usage information for %{title}"
|
139
|
-
based_near: "Usage information for location"
|
140
|
-
description: "Usage information for abstract or summary"
|
141
|
-
tag: "Usage information for keyword"
|
142
|
-
rightsModal: "Usage information for rights"
|
143
117
|
background_attribution: "Background image courtesy of Penn State University"
|
144
118
|
bread_crumb:
|
145
119
|
search_results: "Back to search results"
|
@@ -149,6 +123,9 @@ en:
|
|
149
123
|
user_profile:
|
150
124
|
no_followers: "No one is following you."
|
151
125
|
no_following: "You are not following anyone."
|
126
|
+
orcid:
|
127
|
+
alt: "ORCID icon"
|
128
|
+
label: "ORCID Profile"
|
152
129
|
batch:
|
153
130
|
help:
|
154
131
|
title: "Filename will be the default title. Please provide a more meaningful title, and filenames will still be preserved by the system."
|
@@ -171,3 +148,46 @@ en:
|
|
171
148
|
subject: 'Subject'
|
172
149
|
message: 'Message'
|
173
150
|
delete: 'Delete Message'
|
151
|
+
generic_file:
|
152
|
+
browse_view: "Browse View"
|
153
|
+
|
154
|
+
simple_form:
|
155
|
+
labels:
|
156
|
+
generic_file:
|
157
|
+
based_near: "Location"
|
158
|
+
description: "Abstract or Summary"
|
159
|
+
tag: "Keyword"
|
160
|
+
date_created: "Date Created"
|
161
|
+
related_url: "Related URL"
|
162
|
+
collection:
|
163
|
+
based_near: "Location"
|
164
|
+
description: "Abstract or Summary"
|
165
|
+
tag: "Keyword"
|
166
|
+
date_created: "Date Created"
|
167
|
+
related_url: "Related URL"
|
168
|
+
|
169
|
+
metadata_help:
|
170
|
+
generic_file:
|
171
|
+
resource_type_html: "Pre-defined categories to describe the type of file content being uploaded, such as "article" or "dataset." More than one type may be selected."
|
172
|
+
title: "A name for the file to aid in identifying it. Defaults to the file name, though a more descriptive title is encouraged. <em>This is a required field</em>."
|
173
|
+
tag: "Words or phrases you select to describe what the file is about. These are used to search for content. <em>This is a required field</em>."
|
174
|
+
subject: "Headings or index terms describing what the file is about; these <em>do</em> need to conform to an existing vocabulary. Currently supports Library of Congress Subject Headings."
|
175
|
+
creator_html: "The person or group responsible for the file being uploaded. Usually this is the author of the content. Personal names should be entered with the last name first, e.g. "Smith, John." <em>This is a required field</em>."
|
176
|
+
related_url: "A link to a website or other specific content (audio, video, PDF document) related to the file. An example is the URL of a research project from which the file was derived."
|
177
|
+
based_near_html: "A place name related to the file, such as its site of publication, or the city, state, or country the file's contents are about. Calls upon the GeoNames web service (<a href="http://www.geonames.org">http://www.geonames.org</a>)."
|
178
|
+
contributor_html: "A person or group you want to recognize for playing a role in the creation of the file, but not the primary role. If there is a specific role you would like noted, include it in parentheses, e.g. "Jones, Mary (advisor).""
|
179
|
+
date_created: "The date on which the file was generated. Dates are accepted in the form YYYY-MM-DD, e.g. 1776-07-04."
|
180
|
+
description: "Free-text notes about the file itself. Examples include abstracts of a paper, citation information for a journal article, or a tag indicating a larger collection to which the file belongs."
|
181
|
+
identifier: "A unique handle describing the file. An example would be a DOI for a journal article, or an ISBN or OCLC number for a book."
|
182
|
+
language: "The language of the file content."
|
183
|
+
publisher: "The person or group making the file available. Generally this is the institution."
|
184
|
+
rights: "Licensing and distribution information governing access to the file. Select from the provided drop-down list. <em>This is a required field</em>."
|
185
|
+
|
186
|
+
aria_label:
|
187
|
+
generic_file:
|
188
|
+
default: "Usage information for %{title}"
|
189
|
+
based_near: "Usage information for location"
|
190
|
+
description: "Usage information for abstract or summary"
|
191
|
+
tag: "Usage information for keyword"
|
192
|
+
rights: "Usage information for rights"
|
193
|
+
|
data/config/routes.rb
CHANGED
@@ -99,7 +99,7 @@ Sufia::Engine.routes.draw do
|
|
99
99
|
|
100
100
|
# Batch edit routes
|
101
101
|
get 'batches/:id/edit' => 'batch#edit', as: :batch_edit
|
102
|
-
post 'batches/:id' => 'batch#update', as: :
|
102
|
+
post 'batches/:id' => 'batch#update', as: :batch_generic_files
|
103
103
|
|
104
104
|
# Contact form routes
|
105
105
|
post 'contact' => 'contact_form#create', as: :contact_form_index
|
@@ -23,6 +23,10 @@ module Sufia
|
|
23
23
|
generate "sufia:models:install"
|
24
24
|
end
|
25
25
|
|
26
|
+
def banner
|
27
|
+
say_status("warning", "GENERATING SUFIA", :yellow)
|
28
|
+
end
|
29
|
+
|
26
30
|
def insert_abilities
|
27
31
|
insert_into_file 'app/models/ability.rb', after: /Hydra::Ability/ do
|
28
32
|
"\n include Sufia::Ability\n"
|
data/lib/sufia.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Sufia
|
2
|
+
class FormBuilder < SimpleForm::FormBuilder
|
3
|
+
def input_label(attribute_name, options = {})
|
4
|
+
options = options.dup
|
5
|
+
options[:input_html] = options.except(:as, :boolean_style, :collection, :label_method, :value_method, *ATTRIBUTE_COMPONENTS)
|
6
|
+
options = @defaults.deep_dup.deep_merge(options) if @defaults
|
7
|
+
|
8
|
+
input = find_input(attribute_name, options)
|
9
|
+
wrapper = find_wrapper(input.input_type, options)
|
10
|
+
components = (wrapper.components.map(&:namespace) & ATTRIBUTE_COMPONENTS) + [:input]
|
11
|
+
components = components.map { |component| SimpleForm::Wrappers::Leaf.new(component) }
|
12
|
+
|
13
|
+
input.label.html_safe
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/sufia/version.rb
CHANGED
@@ -73,8 +73,7 @@ describe Sufia::GenericFile::Actor do
|
|
73
73
|
|
74
74
|
it "should be removed if document is not public" do
|
75
75
|
# Switch document from public to restricted
|
76
|
-
|
77
|
-
expect { actor.update_metadata(attributes, 'restricted') }.to change { FeaturedWork.count }.by(-1)
|
76
|
+
expect { actor.update_metadata({}, 'restricted') }.to change { FeaturedWork.count }.by(-1)
|
78
77
|
end
|
79
78
|
end
|
80
79
|
|