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.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +12 -2
  3. data/Gemfile +10 -1
  4. data/History.md +21 -0
  5. data/SUFIA_VERSION +1 -1
  6. data/app/assets/images/orcid.png +0 -0
  7. data/app/assets/javascripts/sufia.js +1 -1
  8. data/app/assets/javascripts/sufia/batch_edit.js +36 -54
  9. data/app/assets/javascripts/sufia/edit_metadata.js +10 -11
  10. data/app/assets/javascripts/sufia/permissions.js +2 -26
  11. data/app/assets/stylesheets/sufia.css.scss +10 -2
  12. data/app/assets/stylesheets/sufia/_batch-edit.scss +8 -6
  13. data/app/assets/stylesheets/sufia/_dashboard.scss +10 -0
  14. data/app/assets/stylesheets/sufia/_settings.scss +1 -0
  15. data/app/assets/stylesheets/sufia/_styles.scss +5 -3
  16. data/app/controllers/batch_controller.rb +9 -6
  17. data/app/controllers/batch_edits_controller.rb +2 -2
  18. data/app/controllers/collections_controller.rb +19 -3
  19. data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +30 -29
  20. data/app/controllers/concerns/sufia/breadcrumbs.rb +8 -3
  21. data/app/controllers/concerns/sufia/files_controller_behavior.rb +19 -7
  22. data/app/controllers/concerns/sufia/users_controller_behavior.rb +14 -2
  23. data/app/controllers/single_use_links_viewer_controller.rb +5 -1
  24. data/app/forms/sufia/forms/batch_edit_form.rb +6 -0
  25. data/app/forms/sufia/forms/collection_edit_form.rb +17 -0
  26. data/app/forms/sufia/forms/generic_file_edit_form.rb +16 -0
  27. data/app/helpers/generic_file_helper.rb +3 -47
  28. data/app/helpers/sufia/permissions_helper.rb +29 -0
  29. data/app/helpers/sufia/sufia_helper_behavior.rb +11 -0
  30. data/app/inputs/multi_value_with_help_input.rb +8 -0
  31. data/app/inputs/select_with_help_input.rb +3 -0
  32. data/app/inputs/select_with_modal_help_input.rb +36 -0
  33. data/app/inputs/with_help_icon.rb +32 -0
  34. data/app/models/concerns/sufia/solr_document_behavior.rb +1 -1
  35. data/app/presenters/sufia/collection_presenter.rb +29 -0
  36. data/app/presenters/sufia/generic_file_presenter.rb +14 -0
  37. data/app/presenters/sufia/presenter_renderer.rb +53 -0
  38. data/app/views/batch/_metadata.html.erb +10 -44
  39. data/app/views/batch/_more_metadata.html.erb +3 -2
  40. data/app/views/batch/edit.html.erb +2 -2
  41. data/app/views/batch_edits/edit.html.erb +13 -17
  42. data/app/views/collections/_form.html.erb +5 -5
  43. data/app/views/collections/_show_descriptions.html.erb +8 -10
  44. data/app/views/collections/edit.html.erb +8 -9
  45. data/app/views/collections/edit_fields/_description.html.erb +1 -2
  46. data/app/views/dashboard/_index_partials/_stats.html.erb +3 -3
  47. data/app/views/generic_files/_descriptions.html.erb +5 -8
  48. data/app/views/generic_files/_permission_form.html.erb +8 -17
  49. data/app/views/generic_files/_show_descriptions.html.erb +3 -4
  50. data/app/views/generic_files/edit.html.erb +1 -2
  51. data/app/views/generic_files/jq_upload.json.jbuilder +8 -0
  52. data/app/views/records/edit_fields/_default.html.erb +5 -10
  53. data/app/views/records/edit_fields/_description.html.erb +5 -10
  54. data/app/views/records/edit_fields/_resource_type.html.erb +2 -5
  55. data/app/views/records/edit_fields/_rights.html.erb +3 -9
  56. data/app/views/single_use_links_viewer/show.html.erb +10 -16
  57. data/app/views/users/_profile.html.erb +1 -2
  58. data/app/views/users/_user_info.html.erb +20 -3
  59. data/app/views/users/edit.html.erb +11 -2
  60. data/app/views/users/show.html.erb +1 -1
  61. data/config/locales/sufia.en.yml +46 -26
  62. data/config/routes.rb +1 -1
  63. data/lib/generators/sufia/install_generator.rb +4 -0
  64. data/lib/sufia.rb +4 -0
  65. data/lib/sufia/form_builder.rb +16 -0
  66. data/lib/sufia/version.rb +1 -1
  67. data/spec/actors/generic_file/actor_spec.rb +1 -2
  68. data/spec/controllers/batch_controller_spec.rb +16 -48
  69. data/spec/controllers/batch_edits_controller_spec.rb +27 -16
  70. data/spec/controllers/collections_controller_spec.rb +81 -61
  71. data/spec/controllers/generic_files_controller_spec.rb +17 -2
  72. data/spec/controllers/users_controller_spec.rb +13 -3
  73. data/spec/features/collection_spec.rb +93 -88
  74. data/spec/features/users_spec.rb +1 -1
  75. data/spec/forms/collection_edit_form_spec.rb +20 -0
  76. data/spec/forms/generic_file_edit_form_spec.rb +26 -0
  77. data/spec/helpers/generic_file_helper_spec.rb +33 -7
  78. data/spec/helpers/permissions_helper_spec.rb +21 -0
  79. data/spec/inputs/multi_value_with_help_input_spec.rb +25 -0
  80. data/spec/inputs/select_with_modal_help_input_spec.rb +21 -0
  81. data/spec/jobs/batch_update_job_spec.rb +11 -14
  82. data/spec/lib/sufia/breadcrumbs_spec.rb +46 -8
  83. data/spec/models/generic_file_spec.rb +0 -13
  84. data/spec/models/user_spec.rb +23 -0
  85. data/spec/presenters/presenter_renderer_spec.rb +19 -0
  86. data/spec/presenters/sufia/generic_file_presenter_spec.rb +12 -0
  87. data/spec/spec_helper.rb +5 -0
  88. data/spec/support/input_support.rb +12 -0
  89. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  90. data/spec/views/batch/edit.html.erb_spec.rb +13 -23
  91. data/spec/views/batch_edits/edit.html.erb_spec.rb +19 -0
  92. data/spec/views/collections/_form.html.erb_spec.rb +26 -28
  93. data/spec/views/collections/_show_descriptions.html.erb_spec.rb +15 -9
  94. data/spec/views/dashboard/index_spec.rb +2 -2
  95. data/spec/views/generic_file/_permission_form.html.erb_spec.rb +23 -0
  96. data/spec/views/generic_file/edit.html.erb_spec.rb +5 -0
  97. data/spec/views/generic_file/show.html.erb_spec.rb +5 -0
  98. data/sufia-models/app/actors/sufia/generic_file/actor.rb +1 -1
  99. data/sufia-models/app/jobs/batch_update_job.rb +5 -5
  100. data/sufia-models/app/models/batch.rb +7 -3
  101. data/sufia-models/app/models/concerns/sufia/collection.rb +7 -25
  102. data/sufia-models/app/models/concerns/sufia/generic_file.rb +0 -1
  103. data/sufia-models/app/models/concerns/sufia/generic_file/export.rb +2 -2
  104. data/sufia-models/app/models/concerns/sufia/generic_file/indexing.rb +4 -13
  105. data/sufia-models/app/models/concerns/sufia/generic_file/metadata.rb +1 -1
  106. data/sufia-models/app/models/concerns/sufia/user.rb +24 -17
  107. data/sufia-models/app/models/sufia/orcid_validator.rb +8 -0
  108. data/sufia-models/app/services/sufia/generic_file_indexing_service.rb +13 -0
  109. data/sufia-models/app/services/sufia/indexing_service.rb +15 -0
  110. data/sufia-models/lib/generators/sufia/models/abstract_migration_generator.rb +30 -0
  111. data/sufia-models/lib/generators/sufia/models/cached_stats_generator.rb +3 -47
  112. data/sufia-models/lib/generators/sufia/models/install_generator.rb +11 -31
  113. data/sufia-models/lib/generators/sufia/models/orcid_field_generator.rb +19 -0
  114. data/sufia-models/lib/generators/sufia/models/proxies_generator.rb +2 -31
  115. data/sufia-models/lib/generators/sufia/models/templates/config/redis.yml +3 -0
  116. data/sufia-models/lib/generators/sufia/models/templates/config/sufia.rb +3 -0
  117. data/sufia-models/lib/generators/sufia/models/templates/migrations/add_orcid_to_users.rb +5 -0
  118. data/sufia-models/lib/generators/sufia/models/upgrade400_generator.rb +2 -33
  119. data/sufia-models/lib/generators/sufia/models/user_stats_generator.rb +31 -0
  120. data/sufia-models/lib/sufia/models/engine.rb +1 -0
  121. data/sufia-models/lib/sufia/models/version.rb +1 -1
  122. data/sufia-models/sufia-models.gemspec +5 -5
  123. data/sufia.gemspec +2 -3
  124. metadata +49 -39
  125. data/app/assets/javascripts/sufia/multiForm.js +0 -67
  126. data/app/helpers/records_helper.rb +0 -4
  127. data/app/helpers/sufia/records_helper_behavior.rb +0 -68
  128. data/app/views/batch_edits/update_edit.js.erb +0 -5
  129. data/app/views/collections/_edit_descriptions.html.erb +0 -18
  130. data/app/views/collections/edit_fields/_title.html.erb +0 -3
  131. data/app/views/generic_files/_field_form.html.erb +0 -20
  132. data/app/views/records/_edit_field.html.erb +0 -22
  133. data/app/views/records/edit_fields/_suffix.html.erb +0 -10
  134. data/app/views/records/edit_fields/_type.html.erb +0 -8
  135. data/app/views/users/_social_media_info.html.erb +0 -20
  136. data/spec/helpers/records_helper_spec.rb +0 -102
  137. data/spec/models/generic_file/web_form_spec.rb +0 -35
  138. data/sufia-models/app/models/concerns/sufia/generic_file/accessible_attributes.rb +0 -87
  139. 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"><%= help_icon('visibility', visibility_text) %></span>
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"><%= help_icon('share_with', share_with_text) %></span>
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
- <div class="input-group">
55
- <label for="new_user_name_skel" class="sr-only"><%= t('sufia.account_label') %> (without the <%= t('sufia.directory.suffix') %> part)</label>
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
- <% (generic_file.terms_for_display).each do |term| %>
5
+ <% present_terms(@presenter) do |r, term| %>
7
6
  <tr>
8
- <th><%= get_label(term) %></th>
9
- <td><%= render_show_field_partial_with_action("records", term, {record: generic_file}) %></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 "&lt;&lt;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", generic_file: @generic_file %>
25
+ <%= render "descriptions", form: @form %>
27
26
  <%= render "permission", generic_file: @generic_file %>
28
27
  <%= render "versioning", generic_file: @generic_file %>
29
28
  </div>
@@ -0,0 +1,8 @@
1
+ json.array! [@generic_file] do |generic_file|
2
+ json.name generic_file.title.first
3
+ json.size generic_file.file_size.first
4
+ json.url "/files/#{generic_file.noid}"
5
+ json.thumbnail_url generic_file.id
6
+ json.delete_url "deleteme"
7
+ json.delete_type "DELETE"
8
+ end
@@ -1,10 +1,5 @@
1
- <div <% if index == 0 %> id="additional_<%= key.to_s %>_clone" <% end %> class="input-group">
2
- <% required = render_req && (index == 0) && record.required?(key) %>
3
- <% if f.object.class.multiple?(key) %>
4
- <%= 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 %>
5
- <% else %>
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
- <div <% if index == 0 %> id="additional_<%= key.to_s %>_clone" <% end %>>
2
- <% required = render_req && (index == 0) && f.object.required?(key) %>
3
- <% if f.object.class.multiple?(key) %>
4
- <%= 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 %>
5
- <% else %>
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
- <%# convert class variable to a local variable if the local hasn't been set %>
2
- <div>
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
- <div <% if index == 0%> id="additional_<%= key.to_s %>_clone" <% end %> class="input-group">
2
- <% if f.object.class.multiple?(key) %>
3
- <%= select_tag "rights", options_for_select(Sufia.config.cc_licenses, v), name: "#{ActiveModel::Naming.singular(f.object)}[#{key.to_s}][]", id: "#{ActiveModel::Naming.singular(f.object)}_#{key.to_s}", class: 'form-control' %>
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
- <table class="table table-striped"><!-- class="verticalheadings"> -->
10
+ <table class="table table-striped">
11
11
  <tbody>
12
- <% @terms.each do |term| %>
13
- <% vals = Array(@asset.send(term)) %>
14
- <tr id='row_<%=term.to_s%>' class="expandable">
15
- <th width="20%">
16
- <%=get_label(term)%>
17
- </th>
18
- <td>
19
- <% vals.each do |val| %>
20
- <%= val %><br />
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,7 +1,6 @@
1
1
  <div class="tab-pane" id="profile">
2
2
  <h2>User Info</h2>
3
- <dl id="user_info">
4
- <%= render partial: 'social_media_info', locals: {user: @user} %>
3
+ <dl id="user_info">
5
4
  <%= render partial: 'user_info', locals: {user: @user} %>
6
5
  </dl>
7
6
  </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
- <dt class="col-xs-5"><i class="glyphicon glyphicon-envelope-alt"></i> Email</dt>
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
 
@@ -1,7 +1,7 @@
1
1
  <%= javascript_tag do %>
2
2
  <% end %>
3
3
 
4
- <div class="col-xs-12">
4
+ <div class="col-xs-12 profile">
5
5
  <div class="pull-right">
6
6
  <%= render 'profile_actions' %>
7
7
  </div>
@@ -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 &quot;article&quot; or &quot;dataset.&quot; 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. &lt;em&gt;This is a required field&lt;/em&gt;."
173
+ tag: "Words or phrases you select to describe what the file is about. These are used to search for content. &lt;em&gt;This is a required field&lt;/em&gt;."
174
+ subject: "Headings or index terms describing what the file is about; these &lt;em&gt;do&lt;/em&gt; 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. &quot;Smith, John.&quot; &lt;em&gt;This is a required field&lt;/em&gt;."
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 (&lt;a href=&quot;http://www.geonames.org&quot;&gt;http://www.geonames.org&lt;/a&gt;)."
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. &quot;Jones, Mary (advisor).&quot;"
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. &lt;em&gt;This is a required field&lt;/em&gt;."
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: :batch_generic_file
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
@@ -17,6 +17,10 @@ require 'tinymce-rails-imageupload'
17
17
  module Sufia
18
18
  extend ActiveSupport::Autoload
19
19
 
20
+ eager_autoload do
21
+ autoload :FormBuilder
22
+ end
23
+
20
24
  class Engine < ::Rails::Engine
21
25
  engine_name 'sufia'
22
26
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Sufia
2
- VERSION = "6.0.0.beta1"
2
+ VERSION = "6.0.0.rc1"
3
3
  end
@@ -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
- attributes = {'permissions'=>{'group' =>{'public' => '1', 'registered'=>'2'}}}
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