sufia 4.0.0.rc2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +443 -621
  3. data/LICENSE.md +11 -174
  4. data/README.md +21 -7
  5. data/SUFIA_VERSION +1 -1
  6. data/app/assets/javascripts/sufia/batch.js +7 -2
  7. data/app/assets/javascripts/sufia/dashboard_actions.js +21 -10
  8. data/app/assets/javascripts/terms_of_service.js +1 -1
  9. data/app/assets/stylesheets/batch-edit.css.scss +21 -0
  10. data/app/assets/stylesheets/collections.css.scss +4 -0
  11. data/app/assets/stylesheets/home-page.css.scss +8 -1
  12. data/app/assets/stylesheets/styles.css.scss +8 -5
  13. data/app/assets/stylesheets/sufia.css.scss +1 -0
  14. data/app/builders/sufia/bootstrap_breadcrumbs_builder.rb +28 -0
  15. data/app/controllers/collections_controller.rb +2 -0
  16. data/app/controllers/concerns/sufia/batch_edits_controller_behavior.rb +3 -1
  17. data/app/controllers/concerns/sufia/breadcrumbs.rb +41 -0
  18. data/app/controllers/concerns/sufia/files_controller_behavior.rb +3 -1
  19. data/app/controllers/concerns/sufia/homepage_controller.rb +1 -1
  20. data/app/helpers/sufia/blacklight_override.rb +1 -1
  21. data/app/helpers/sufia/records_helper_behavior.rb +19 -5
  22. data/app/helpers/sufia/sufia_helper_behavior.rb +13 -6
  23. data/app/models/concerns/sufia/solr_document_behavior.rb +4 -0
  24. data/app/views/_user_util_links.html.erb +4 -2
  25. data/app/views/batch/_metadata.html.erb +25 -31
  26. data/app/views/batch/_more_metadata.html.erb +6 -5
  27. data/app/views/batch/edit.html.erb +3 -3
  28. data/app/views/batch_edits/edit.html.erb +1 -1
  29. data/app/views/catalog/_search_form.html.erb +1 -3
  30. data/app/views/collections/_form_for_select_collection.html.erb +6 -3
  31. data/app/views/collections/_show_actions.html.erb +2 -2
  32. data/app/views/collections/edit.html.erb +1 -3
  33. data/app/views/collections/show.html.erb +1 -2
  34. data/app/views/generic_files/_field_form.html.erb +3 -3
  35. data/app/views/generic_files/_permission_form.html.erb +20 -3
  36. data/app/views/generic_files/edit.html.erb +1 -1
  37. data/app/views/generic_files/new.html.erb +8 -7
  38. data/app/views/generic_files/show.html.erb +1 -1
  39. data/app/views/generic_files/stats.html.erb +1 -1
  40. data/app/views/generic_files/upload/_form_fields.html.erb +4 -4
  41. data/app/views/homepage/_featured_fields.html.erb +20 -18
  42. data/app/views/homepage/_home_content.html.erb +8 -7
  43. data/app/views/homepage/_recent_document.html.erb +3 -4
  44. data/app/views/homepage/_recents.html.erb +4 -1
  45. data/app/views/homepage/_tagcloud.html.erb +5 -4
  46. data/app/views/kaminari/blacklight_compact/_paginator.html.erb +23 -0
  47. data/app/views/my/_action_menu.html.erb +15 -12
  48. data/app/views/my/_collection_action_menu.html.erb +8 -6
  49. data/app/views/my/_facets.html.erb +1 -1
  50. data/app/views/my/_index_partials/_default_group.html.erb +1 -1
  51. data/app/views/my/_index_partials/_list_collections.html.erb +12 -6
  52. data/app/views/my/_index_partials/_list_files.html.erb +14 -6
  53. data/app/views/my/index.html.erb +7 -2
  54. data/app/views/records/edit_fields/_suffix.html.erb +0 -1
  55. data/app/views/shared/_attributes.html.erb +6 -6
  56. data/app/views/users/_notify_link.html.erb +1 -0
  57. data/app/views/users/_notify_number.html.erb +3 -2
  58. data/config/locales/sufia.en.yml +24 -4
  59. data/lib/sufia.rb +2 -0
  60. data/lib/sufia/version.rb +1 -1
  61. data/spec/actors/generic_file/actor_spec.rb +21 -2
  62. data/spec/controllers/batch_controller_spec.rb +3 -3
  63. data/spec/controllers/batch_edits_controller_spec.rb +4 -0
  64. data/spec/controllers/catalog_controller_spec.rb +3 -3
  65. data/spec/controllers/collections_controller_spec.rb +5 -1
  66. data/spec/controllers/generic_files_controller_spec.rb +21 -4
  67. data/spec/controllers/homepage_controller_spec.rb +8 -1
  68. data/spec/features/browse_dashboard_files_spec.rb +1 -1
  69. data/spec/features/collection_spec.rb +3 -3
  70. data/spec/helpers/records_helper_spec.rb +53 -25
  71. data/spec/jobs/import_url_job_spec.rb +2 -1
  72. data/spec/lib/sufia/breadcrumbs_spec.rb +80 -0
  73. data/spec/lib/sufia/messages_spec.rb +8 -1
  74. data/spec/models/characterization_spec.rb +23 -0
  75. data/spec/models/fits_datastream_spec.rb +20 -23
  76. data/spec/support/features/session_helpers.rb +1 -1
  77. data/spec/views/catalog/index.html.erb_spec.rb +2 -0
  78. data/spec/views/generic_file/stats.html.erb_spec.rb +0 -6
  79. data/spec/views/users/show.html.erb_spec.rb +19 -0
  80. data/sufia-models/app/actors/sufia/generic_file/actor.rb +2 -1
  81. data/sufia-models/app/models/concerns/sufia/generic_file/characterization.rb +3 -4
  82. data/sufia-models/app/models/concerns/sufia/generic_file/full_text_indexing.rb +21 -14
  83. data/sufia-models/app/models/concerns/sufia/generic_file/mime_types.rb +4 -0
  84. data/sufia-models/app/models/file_usage.rb +6 -2
  85. data/sufia-models/lib/sufia/models/version.rb +1 -1
  86. data/sufia.gemspec +1 -0
  87. metadata +28 -9
  88. data/app/views/generic_files/_breadcrumbs.html.erb +0 -31
  89. data/spec/views/generic_file/_breadcrumbs.html.erb_spec.rb +0 -32
@@ -0,0 +1,41 @@
1
+ module Sufia
2
+ module Breadcrumbs
3
+ extend ActiveSupport::Concern
4
+
5
+ def build_breadcrumbs
6
+ if request.referer
7
+ trail_from_referer
8
+ else
9
+ default_trail
10
+ end
11
+ end
12
+
13
+ def default_trail
14
+ if user_signed_in?
15
+ add_breadcrumb I18n.t('sufia.dashboard.title'), sufia.dashboard_index_path
16
+ end
17
+ end
18
+
19
+ def trail_from_referer
20
+ case request.referer
21
+ when /catalog/
22
+ add_breadcrumb I18n.t('sufia.bread_crumb.search_results'), request.referer
23
+ when /dashboard/
24
+ default_trail
25
+ add_breadcrumb_for_controller
26
+ else
27
+ default_trail
28
+ end
29
+ end
30
+
31
+ def add_breadcrumb_for_controller
32
+ case controller_name
33
+ when /files|batch/
34
+ add_breadcrumb I18n.t('sufia.dashboard.my.files'), sufia.dashboard_files_path
35
+ when /collections/
36
+ add_breadcrumb I18n.t('sufia.dashboard.my.collections'), sufia.dashboard_collections_path
37
+ end
38
+ end
39
+
40
+ end
41
+ end
@@ -8,6 +8,7 @@ module Sufia
8
8
  module FilesControllerBehavior
9
9
  extend ActiveSupport::Concern
10
10
  extend Sufia::FilesController::UploadCompleteBehavior
11
+ include Sufia::Breadcrumbs
11
12
 
12
13
  included do
13
14
  include Hydra::Controller::ControllerBehavior
@@ -34,8 +35,9 @@ module Sufia
34
35
 
35
36
  # actions: audit, index, create, new, edit, show, update,
36
37
  # destroy, permissions, citation, stats
37
- before_filter :authenticate_user!, except: [:show, :citation]
38
+ before_filter :authenticate_user!, except: [:show, :citation, :stats]
38
39
  before_filter :has_access?, except: [:show]
40
+ before_filter :build_breadcrumbs, only: [:show, :edit, :stats]
39
41
  prepend_before_filter :normalize_identifier, except: [:index, :create, :new]
40
42
  load_resource only: [:audit]
41
43
  load_and_authorize_resource except: [:index, :audit]
@@ -8,7 +8,7 @@ module Sufia::HomepageController
8
8
  include Sufia::Controller
9
9
  include Blacklight::SolrHelper
10
10
 
11
- self.solr_search_params_logic += [:only_generic_files]
11
+ self.solr_search_params_logic += [:only_generic_files, :add_access_controls_to_solr_params]
12
12
  layout 'homepage'
13
13
  end
14
14
 
@@ -5,7 +5,7 @@ module Sufia
5
5
  end
6
6
 
7
7
  def url_for_document doc, options = {}
8
- if doc['has_model_ssim'].first == ::Collection.to_class_uri
8
+ if (doc.is_a?(SolrDocument) && doc.hydra_model == 'Collection')
9
9
  [collections, doc]
10
10
  else
11
11
  [sufia, doc]
@@ -13,14 +13,16 @@ module Sufia
13
13
  title = title || get_label(key)
14
14
  link_to '#', id: "generic_file_#{key.to_s}_help", rel: 'popover',
15
15
  'data-content' => content,
16
- 'data-original-title' => title do
17
- content_tag 'i', '', class: "glyphicon glyphicon-question-sign large-icon"
16
+ 'data-original-title' => title,
17
+ 'aria-label' => get_aria_label(key) do
18
+ content_tag 'i', '', "aria-hidden" => true, class: "help-icon"
18
19
  end
19
20
  end
20
21
 
21
22
  def help_icon_modal(modal_id)
22
- link_to '#' + modal_id, id: "generic_file_#{modal_id}_help_modal", rel: 'button', data: { toggle: 'modal' } do
23
- content_tag 'i', '', class: 'glyphicon glyphicon-question-sign large-icon'
23
+ link_to '#' + modal_id, id: "generic_file_#{modal_id}_help_modal", rel: 'button',
24
+ data: { toggle: 'modal' }, 'aria-label' => get_aria_label(modal_id) do
25
+ content_tag 'i', '', "aria-hidden" => true, class: 'help-icon'
24
26
  end
25
27
  end
26
28
 
@@ -31,16 +33,28 @@ module Sufia
31
33
  def get_label(key)
32
34
  I18n.t("sufia.field_label.#{key}", default: key.to_s.humanize)
33
35
  end
36
+
37
+ def get_aria_label(key)
38
+ I18n.t("sufia.aria_label.#{key}", default: default_aria_label(key.to_s.humanize))
39
+ end
34
40
 
35
41
  private
36
42
 
37
43
  def more_or_less_button(key, html_class, symbol)
38
44
  # TODO, there could be more than one element with this id on the page, but the fuctionality doesn't work without it.
39
45
  content_tag('button', class: "#{html_class} btn", id: "additional_#{key}_submit", name: "additional_#{key}") do
40
- (symbol + content_tag('span', class: 'sr-only') do
46
+ (sr_hidden(symbol) + content_tag('span', class: 'sr-only') do
41
47
  "add another #{key.to_s}"
42
48
  end).html_safe
43
49
  end
44
50
  end
51
+
52
+ def sr_hidden text
53
+ content_tag :span, text, "aria-hidden" => true
54
+ end
55
+
56
+ def default_aria_label text
57
+ I18n.t("sufia.aria_label.default", title: text)
58
+ end
45
59
  end
46
60
  end
@@ -5,14 +5,21 @@ module Sufia
5
5
  # example:
6
6
  # config.index.thumbnail_method = :sufia_thumbnail_tag
7
7
  def sufia_thumbnail_tag(document, options)
8
- path = if document.image? || document.pdf? || document.video? || document.office_document?
9
- sufia.download_path document.noid, datastream_id: 'thumbnail'
10
- elsif document.audio?
11
- "audio.png"
8
+ # collection
9
+ if (document.collection?)
10
+ content_tag(:span, "", class: "glyphicon glyphicon-th collection-icon-search")
11
+
12
+ # file
12
13
  else
13
- "default.png"
14
+ path = if document.image? || document.pdf? || document.video? || document.office_document?
15
+ sufia.download_path document.noid, datastream_id: 'thumbnail'
16
+ elsif document.audio?
17
+ "audio.png"
18
+ else
19
+ "default.png"
20
+ end
21
+ image_tag path, options
14
22
  end
15
- image_tag path, options
16
23
  end
17
24
 
18
25
  # Create a link back to the dashboard screen, keeping the user's facet, query and paging choices intact by using session.
@@ -103,5 +103,9 @@ module Sufia
103
103
  Array(self[::Ability.edit_user_field])
104
104
  end
105
105
 
106
+ def collection?
107
+ hydra_model == 'Collection'
108
+ end
109
+
106
110
  end
107
111
  end
@@ -3,9 +3,11 @@
3
3
  <%= render partial: 'users/notify_link' %>
4
4
  <%= link_to sufia.dashboard_index_path, class: "btn btn-default", id: "dashboard_link", title: "click for Dashboard" do %>
5
5
  <span class="glyphicon glyphicon-dashboard"></span>
6
+ <span class="sr-only">click for </span>
6
7
  <span class="hidden-xs">&nbsp;<%= current_user.name %></span>
8
+ <span class="sr-only"> dashboard</span>
7
9
  <% end %>
8
- <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret" title="click for additional menu options"></span></a>
10
+ <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" href="#" title="click for additional menu options"><span class="caret" ></span></a>
9
11
  <ul class="dropdown-menu dropdown-menu-right" role="menu">
10
12
  <li><%= link_to raw('<span class="glyphicon glyphicon-upload"></span> upload'), sufia.new_generic_file_path, id: 'upload_nav_link' %></li>
11
13
  <li><%= link_to raw('<span class="glyphicon glyphicon-user"></span> my profile'), sufia.profile_path(current_user), id: 'profile_nav_link' %></li>
@@ -16,6 +18,6 @@
16
18
  </div><!-- /.btn-group -->
17
19
  <% else %>
18
20
  <div class="btn-group login_button pull-right">
19
- <%= link_to raw('<span class="glyphicon glyphicon-log-in"></span> Login'), new_user_session_path, class: "btn btn-default btn-group" %>
21
+ <%= link_to raw('<span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> Login'), new_user_session_path, class: "btn btn-default btn-group", title: "Login" %>
20
22
  </div>
21
23
  <% end %>
@@ -1,16 +1,15 @@
1
- <h2>Individual Titles <small>(applied to individual files uploaded)</small><small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
1
+ <h2>Individual Titles </h2>
2
2
  <div id="" class="well">
3
- <p>
4
- <i class="glyphicon glyphicon-info-sign"></i> Filename will be the default title. Please provide a more meaningful title, and filenames will still be preserved by the system.
5
- </p>
6
3
  <div class="row">
7
4
  <div class="col-sm-8">
5
+ <h3>Applies to individual files uploaded</h3>
6
+ <%= content_tag :p, t('sufia.batch.help.title'), class: "help-block" %>
8
7
  <% @batch.generic_files.sort! { |a,b| a.label.downcase <=> b.label.downcase }.each_with_index do |gen_f, index| %>
9
- <div class="form-group">
10
- <%= f.label :title, "<span class='error'>*</span> Title #{index + 1}".html_safe, class: "control-label" %>
8
+ <div class="batch-group">
9
+ <%= f.label :title, "<span class='required-field'>*</span> Title #{index + 1}".html_safe, class: "control-label" %>
10
+ <%= help_icon(:title) %>
11
11
  <div id="additional_title_clone">
12
12
  <%= f.text_field :title, name: "title[#{gen_f.id}][]", value: gen_f.label, required: true %>
13
- <%= help_icon(:title) %>
14
13
  </div>
15
14
  </div>
16
15
  <% end %>
@@ -24,55 +23,50 @@
24
23
 
25
24
  <%= hidden_field_tag(:extra_description_count, "1") %>
26
25
  <div id="descriptions_display">
27
- <h2 class="non lower">Bulk Descriptions <small>(applied to all files just uploaded)</small> <small class="pull-right"><span class="error">*</span> indicates required fields</small></h2>
26
+ <h2>Bulk Descriptions</h2>
28
27
  <div class="well">
29
- <div class="form-group" id="resources">
28
+ <h3>Applies to all files just uploaded</h3>
29
+ <div class="batch-group" id="resources">
30
30
  <%# See if this works: render_edit_field_partial(:type, f:f) %>
31
31
  <%= f.label :resource_type, "Resource Types", class: "control-label", for: "resource_type" %>
32
- <p class="help-block">You may select multiple types to apply to all files<p>
33
- <%= f.select "resource_type", Sufia::Engine::config.resource_types, {}, { multiple: true, size: 7 } %>
34
32
  <%= help_icon(:resource_type) %>
33
+ <%= content_tag :p, t('sufia.batch.help.resource_type'), class: "help-block" %>
34
+ <%= f.select "resource_type", Sufia::Engine::config.resource_types, {}, { multiple: true, size: 7, "aria-label" => "Rights combo box" } %>
35
35
  </div>
36
36
 
37
- <div class="form-group">
38
- <%= f.label :tag, "<span class='error'>*</span> Keyword".html_safe, class: "control-label" %>
37
+ <div class="batch-group">
38
+ <%= f.label :tag, "<span class='required-field'>*</span> Keyword".html_safe, class: "control-label" %>
39
+ <%= help_icon(:tag) %>
39
40
  <div id="additional_tag_clone">
40
41
  <%= f.text_field :tag, name: "generic_file[tag][]", value: "", required: true %>
41
- <button class="adder btn" name="additional_tag" id="additional_tag_submit">+<span class="sr-only">add another Tag</span></button>
42
- &nbsp;
43
- <%= help_icon(:tag) %>
42
+ <button class="adder btn" name="additional_tag" id="additional_tag_submit"><span aria-hidden="true">+</span><span class="sr-only">add another Keyword</span></button>
44
43
  </div>
45
44
  <div id="additional_tag_elements"></div>
46
45
  </div>
47
46
 
48
- <div class="form-group">
49
- <%= f.label :creator, "<span class='error'>*</span> Creator".html_safe, class: "control-label" %>
47
+ <div class="batch-group">
48
+ <%= f.label :creator, "<span class='required-field'>*</span> Creator".html_safe, class: "control-label" %>
49
+ <%= help_icon(:creator) %>
50
50
  <div id="additional_creator_clone">
51
51
  <%= f.text_field :creator, name: "generic_file[creator][]", value: "", required: true %>
52
- <button class="adder btn" name="additional_creator" id="additional_creator_submit">+<span class="sr-only">add another Creator</span></button>
53
- &nbsp;
54
- <%= help_icon(:creator) %>
52
+ <button class="adder btn" name="additional_creator" id="additional_creator_submit"><span aria-hidden="true">+</span><span class="sr-only">add another Creator</span></button>
55
53
  </div>
56
54
  <div id="additional_creator_elements"></div>
57
55
  </div>
58
56
 
59
- <div class="form-group">
60
- <%= f.label :rights, '<span class="error">*</span> Rights'.html_safe, class: "control-label" %>
57
+ <div class="batch-group">
58
+ <%= f.label :rights, '<span class="required-field">*</span> Rights'.html_safe, class: "control-label" %>
59
+ <%= help_icon_modal('rightsModal') %>
61
60
  <div id="additional_rights_clone">
62
61
  <%= f.select "rights", options_for_select(Sufia::Engine::config.cc_licenses, 'http://creativecommons.org/licenses/by-nc-nd/3.0/us/'), required: true %>
63
- <button class="adder btn" name="additional_rights" id="additional_rights_submit">+<span class="sr-only">add another Rights</span></button>
64
- &nbsp;
65
- <%= help_icon_modal('rightsModal') %>
62
+ <button class="adder btn" name="additional_rights" id="additional_rights_submit"><span aria-hidden="true">+</span><span class="sr-only">add another Rights</span></button>
66
63
  <%= render partial: "generic_files/rights_modal" %>
67
64
  </div>
68
-
69
65
  <div id="additional_rights_elements"></div>
70
66
  </div>
71
67
 
72
- <div class="row" id="add_descriptions">
73
- <a href="#" id="add_descriptions" >Add More Description Types</a>
74
- </div>
75
- <!-- hidden on initial load -->
68
+ <button id="show_addl_descriptions" class="btn btn-default" aria-label="reveal additional metadata description fields">Show Additional Fields</button>
69
+ <!-- hidden on initial load -->
76
70
 
77
71
  <%= render partial: 'more_metadata', locals: {f:f} %>
78
72
 
@@ -1,5 +1,6 @@
1
- <div id="more_descriptions">
2
- <% (@generic_file.terms_for_editing - [:title, :creator, :rights, :tag, :resource_type]).each do |term| %>
3
- <%= render partial: "generic_files/field_form", locals: { generic_file: @generic_file, f: f, render_req: false, key: term } %>
4
- <% end %>
5
- </div> <!-- /more_descriptions -->
1
+ <div id="more_descriptions">
2
+ <button id="hide_addl_descriptions" class="btn btn-default" aria-label="hide additional metadata description fields">Hide Additional Fields</button>
3
+ <% (@generic_file.terms_for_editing - [:title, :creator, :rights, :tag, :resource_type]).each do |term| %>
4
+ <%= render partial: "generic_files/field_form", locals: { generic_file: @generic_file, f: f, render_req: false, key: term } %>
5
+ <% end %>
6
+ </div> <!-- /more_descriptions -->
@@ -3,13 +3,13 @@
3
3
  <% end %>
4
4
 
5
5
  <h1>Apply Metadata</h1>
6
- <div class="alert">
6
+ <p>
7
7
  The information you provide for Title will be applied to the corresponding file only; however all other
8
8
  information you provide will be applied <em>to the entire batch of files</em> you have just
9
9
  deposited into <%= t('sufia.product_name') %>. You may edit individual files from
10
10
  <%= link_to "<i class='glyphicon glyphicon-dashboard'></i> #{t('sufia.bread_crumb.file_list')}".html_safe, sufia.dashboard_files_path %>
11
- once this step is finished.
12
- </div>
11
+ once this step is finished. <span class="required-field">*</span> indicates required fields.
12
+ </p>
13
13
  <%= form_for([@batch, @generic_file], url: sufia.batch_generic_files_path, html: { multipart: true, class: 'form-horizontal' }) do |f| %>
14
14
 
15
15
  <%= render partial: 'metadata', formats: [:html], locals: {f: f} %>
@@ -1,4 +1,4 @@
1
- <%= render partial: 'generic_files/breadcrumbs', locals: {include_file: false} %>
1
+ <%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
2
2
  <h2 class="non lower">Batch Edit Descriptions &nbsp;&nbsp;&nbsp;<small>Click on labels below to edit file descriptions.</small> </h2>
3
3
  <div class="scrollx scrolly fileHeight"> <!-- original values -->
4
4
  <h3> <b>Changes will be applied to: (<%= @names.size %> files) </b></h3>
@@ -4,11 +4,9 @@
4
4
  <div class="row">
5
5
  <div class="col-xs-12">
6
6
  <div class="input-group">
7
- <%= text_field_tag :q, current_search_parameters , class: "q form-control", id: "search-field-header",
8
- placeholder: t("sufia.search.form.q.placeholder") %>
9
7
 
10
- <%# if this label goes before the search field, it"ll mess up the rounded corners %>
11
8
  <label class="sr-only" for="search-field-header"><%= t("sufia.search.form.q.label") %></label>
9
+ <%= text_field_tag :q, current_search_parameters , class: "q form-control", id: "search-field-header", placeholder: t("sufia.search.form.q.placeholder") %>
12
10
 
13
11
  <div class="input-group-btn">
14
12
  <button type="submit" class="btn btn-primary" id="search-submit-header">
@@ -1,9 +1,9 @@
1
- <div class="modal fade" id="collection-list-container">
1
+ <div role="dialog" class="modal fade" id="collection-list-container" tabindex="-1" aria-labelledby="col_add_title" >
2
2
  <div class="modal-dialog">
3
3
  <div class="modal-content">
4
4
  <div class="modal-header">
5
5
  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
6
- <h4 class="modal-title">Add to collection</h4>
6
+ <h4 class="modal-title" id="col_add_title">Add to collection</h4>
7
7
  </div>
8
8
  <div class="modal-body">
9
9
  <% if user_collections.blank? %>
@@ -14,7 +14,10 @@
14
14
  <ul>
15
15
  <% user_collections.sort! { |c1,c2| c1['desc_metadata__date_modified_dtsi'] <=> c2['desc_metadata__date_modified_dtsi'] } %>
16
16
  <% user_collections.each do |collection| %>
17
- <li> <%= radio_button_tag(:id, collection.id, true, class: "collection-selector") %><%= label_tag(:collection, collection.title) %> </li>
17
+ <li> <label for="<%= collection.id %>" class="sr-only">Add to <%=collection.title%></label>
18
+ <%= radio_button_tag(:id, collection.id, true, class: "collection-selector") %>
19
+ <%= label_tag(:collection, collection.title, "aria-hidden" =>true) %>
20
+ </li>
18
21
  <% end %>
19
22
  </ul>
20
23
  </div><!-- collection-list -->
@@ -1,7 +1,7 @@
1
1
  <h2 class="sr-only">Actions</h2>
2
2
  <div class="actions-controls-collections">
3
3
  <% if can? :edit, @collection %>
4
- <span class="label label-default"><%= link_to "Edit", collections.edit_collection_path %></span> &nbsp;&nbsp;
5
- <span class="label label-default"><%= link_to "Add files", sufia.dashboard_files_path %></span>
4
+ <span class="label label-default"><%= link_to "Edit", collections.edit_collection_path, title: "Edit this Collection" %></span> &nbsp;&nbsp;
5
+ <span class="label label-default"><%= link_to "Add files", sufia.dashboard_files_path, title: "Add files to this Collection" %></span>
6
6
  <%end %>
7
7
  </div>
@@ -1,7 +1,5 @@
1
1
  <% @page_title = "Edit Collection #{display_title(@collection)} - #{application_name}" %>
2
- <%= render partial: 'generic_files/breadcrumbs', locals: {
3
- include_file: false, generic_file: GenericFile.new(title: @collection.title)
4
- } %>
2
+ <%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
5
3
 
6
4
  <h1>Edit Collection: <%= display_title(@collection) %></h1>
7
5
 
@@ -1,7 +1,6 @@
1
1
  <% @page_title = "#{@collection.title} - #{application_name}" %>
2
2
 
3
- <%= render partial: 'generic_files/breadcrumbs', locals: {
4
- include_file: false, generic_file: GenericFile.new(title: @collection.title) } %>
3
+ <%= render_breadcrumbs builder: Sufia::BootstrapBreadcrumbsBuilder %>
5
4
 
6
5
  <div itemscope itemtype="http://schema.org/CollectionPage" class="row">
7
6
  <div class="col-sm-10 pull-right">
@@ -1,5 +1,5 @@
1
1
  <% render_req ||= true # render_req is true for single file edit, false for batch edit%>
2
- <div class="form-group">
2
+ <div class="batch-group">
3
3
  <% vals = generic_file[key] %>
4
4
  <% if render_req && required?(key) %>
5
5
  <% tmp = '<span class="required-field">*</span>' + get_label(key) %>
@@ -7,7 +7,7 @@
7
7
  <% else %>
8
8
  <%= f.label key, get_label(key) %>
9
9
  <% end %>
10
-
10
+ <%= help_icon(key) %>
11
11
  <% if key == :resource_type %>
12
12
  <%# resource_type is a multiselect box, so don't render one row for each %>
13
13
  <%= render_edit_field_partial(key, record: generic_file, f: f, render_req: render_req) %>
@@ -16,4 +16,4 @@
16
16
  <%= render_edit_field_partial(key, record: generic_file, f: f, v: v, index: index, render_req: render_req) %>
17
17
  <% end %>
18
18
  <% end %>
19
- </div><!-- /.form-group -->
19
+ </div><!-- /.batch-group -->
@@ -12,7 +12,12 @@
12
12
  </h2>
13
13
 
14
14
  <div class="alert alert-info hidden" id="save_perm_note">Permissions are <strong>not</strong> saved until the &quot;Save&quot; button is pressed at the bottom of the page.</div>
15
- <div class="alert alert-warning hidden" id="permissions_error"><a class="close" data-dismiss="alert" href="#">×</a><span id="permissions_error_text"></span></div>
15
+ <div class="alert alert-warning hidden" id="permissions_error">
16
+ <a class="close" data-dismiss="alert" href="#">
17
+ <span class="sr-only">Close this alert</span>
18
+ <span aria-hidden="true">×</span>
19
+ </a>
20
+ <span id="permissions_error_text"></span></div>
16
21
 
17
22
  <div class="well">
18
23
 
@@ -44,33 +49,45 @@
44
49
  <span id="share_with_tooltip" class="h5"><%= help_icon('share_with', share_with_text) %></span>
45
50
  </h3>
46
51
  </div>
52
+
47
53
  <div class="form-group">
48
54
  <div id="new-user">
49
55
  <p class="col-sm-12">Enter <%=t('sufia.account_label') %> (one at a time)</p>
56
+ <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>
50
57
  <div class="col-sm-5">
51
58
  <div class="input-group">
59
+ <label for="new_user_name_skel" class="sr-only"><%= t('sufia.account_label') %> (without the <%= t('sufia.directory.suffix') %> part)</label>
52
60
  <%= text_field_tag 'new_user_name_skel', nil, class: "form-control" %><span class="input-group-addon"><%=t('sufia.directory.suffix') %></span>
53
61
  </div>
54
62
  </div>
55
63
  <div class="col-sm-4">
64
+ <label for="new_user_permission_skel" class="sr-only">Access type to grant</label>
56
65
  <%= select_tag 'new_user_permission_skel', options_for_select(Sufia.config.permission_levels), class: 'form-control' %>
57
66
  </div>
58
67
  <div class="col-sm-3">
59
- <button class="btn btn-mini btn-inverse" id="add_new_user_skel"><i class="glyphicon glyphicon-plus"></i> Add</button>
68
+ <button class="btn btn-mini btn-inverse" id="add_new_user_skel">
69
+ <span class="sr-only">Add this <%= t('sufia.account_label') %></span>
70
+ <span aria-hidden="true"><i class="glyphicon glyphicon-plus"></i> Add</span>
71
+ </button>
60
72
  <br /> <span id="directory_user_result"></span>
61
73
  </div>
62
74
  </div>
63
75
  </div>
76
+
64
77
  <div class="form-group">
65
78
  <div id="new-group" >
79
+ <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>
66
80
  <div class="col-sm-5">
81
+ <label for="new_group_name_skel" class="sr-only">Group</label>
67
82
  <%= select_tag 'new_group_name_skel', options_for_select(["Select a group"] + current_user.groups), class: 'form-control' %>
68
83
  </div>
69
84
  <div class="col-sm-4">
85
+ <label for="new_group_permission_skel" class="sr-only">Access type to grant</label>
70
86
  <%= select_tag 'new_group_permission_skel', options_for_select(Sufia.config.permission_levels), class: 'form-control' %>
71
87
  </div>
72
88
  <div class="col-sm-3">
73
- <button class="btn btn-mini btn-inverse" id="add_new_group_skel" ><i class="glyphicon glyphicon-plus"></i> Add</button>
89
+ <span class="sr-only">Add this group</span>
90
+ <button class="btn btn-mini btn-inverse" id="add_new_group_skel"><i class="glyphicon glyphicon-plus"></i> Add</button>
74
91
  <br /><span id="directory_group_result"></span>
75
92
  </div>
76
93
  </div>