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
@@ -0,0 +1,36 @@
|
|
1
|
+
class SelectWithModalHelpInput < MultiValueWithHelpInput
|
2
|
+
def link_to_help
|
3
|
+
template.link_to "##{attribute_name}Modal", id: "#{input_class}_help_modal", rel: 'button',
|
4
|
+
data: { toggle: 'modal' }, :'aria-label' => aria_label do
|
5
|
+
help_icon
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
def select_options
|
11
|
+
@select_options ||= begin
|
12
|
+
collection = options.delete(:collection) || self.class.boolean_collection
|
13
|
+
collection.respond_to?(:call) ? collection.call : collection.to_a
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def build_text_field(value)
|
18
|
+
html_options = input_html_options.dup
|
19
|
+
|
20
|
+
if @rendered_first_element
|
21
|
+
html_options[:id] = nil
|
22
|
+
html_options[:required] = nil
|
23
|
+
else
|
24
|
+
html_options[:id] ||= input_dom_id
|
25
|
+
end
|
26
|
+
html_options[:class] ||= []
|
27
|
+
html_options[:class] += ["#{input_dom_id} form-control multi-text-field"]
|
28
|
+
html_options[:'aria-labelledby'] = label_id
|
29
|
+
html_options.delete(:multiple)
|
30
|
+
@rendered_first_element = true
|
31
|
+
|
32
|
+
html_options.merge!(options.slice(:include_blank))
|
33
|
+
template.select_tag(attribute_name, template.options_for_select(select_options, value), html_options)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module WithHelpIcon
|
2
|
+
def label(wrapper_options = nil)
|
3
|
+
"#{super} #{link_to_help}"
|
4
|
+
end
|
5
|
+
|
6
|
+
protected
|
7
|
+
def link_to_help
|
8
|
+
template.link_to '#', id: "#{input_class}_help", rel: 'popover'.freeze,
|
9
|
+
:'data-content' => metadata_help, :'data-original-title' => raw_label_text,
|
10
|
+
:'aria-label' => aria_label do
|
11
|
+
help_icon
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def help_icon
|
16
|
+
template.content_tag 'i', nil, :"aria-hidden" => true, class: "help-icon"
|
17
|
+
end
|
18
|
+
|
19
|
+
def metadata_help
|
20
|
+
translate_from_namespace(:metadata_help) || attribute_name.to_s.humanize
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
def aria_label
|
25
|
+
translate_from_namespace(:aria_label) || default_aria_label
|
26
|
+
end
|
27
|
+
|
28
|
+
def default_aria_label
|
29
|
+
I18n.t("#{i18n_scope}.aria_label.#{lookup_model_names.join('.')}.default",
|
30
|
+
title: attribute_name.to_s.humanize)
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Sufia
|
2
|
+
class CollectionPresenter
|
3
|
+
include Hydra::Presenter
|
4
|
+
include ActionView::Helpers::NumberHelper
|
5
|
+
|
6
|
+
self.model_class = ::Collection
|
7
|
+
# Terms is the list of fields displayed by app/views/collections/_show_descriptions.html.erb
|
8
|
+
self.terms = [:resource_type, :creator, :contributor, :tag, :rights, :publisher, :date_created,
|
9
|
+
:subject, :language, :identifier, :based_near, :related_url]
|
10
|
+
|
11
|
+
# Depositor and permissions are not displayed in app/views/collections/_show_descriptions.html.erb
|
12
|
+
# so don't include them in `terms'.
|
13
|
+
# delegate :depositor, :permissions, to: :model
|
14
|
+
|
15
|
+
def terms_with_values
|
16
|
+
terms.select { |t| self[t].present? }
|
17
|
+
end
|
18
|
+
|
19
|
+
def size
|
20
|
+
number_to_human_size(model.bytes)
|
21
|
+
end
|
22
|
+
|
23
|
+
def total_items
|
24
|
+
model.members.count
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Sufia
|
2
|
+
class GenericFilePresenter
|
3
|
+
include Hydra::Presenter
|
4
|
+
self.model_class = ::GenericFile
|
5
|
+
# Terms is the list of fields displayed by app/views/generic_files/_show_descriptions.html.erb
|
6
|
+
self.terms = [:resource_type, :title, :creator, :contributor, :description, :tag, :rights,
|
7
|
+
:publisher, :date_created, :subject, :language, :identifier, :based_near, :related_url]
|
8
|
+
|
9
|
+
# Depositor and permissions are not displayed in app/views/generic_files/_show_descriptions.html.erb
|
10
|
+
# so don't include them in `terms'.
|
11
|
+
delegate :depositor, :permissions, to: :model
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Sufia
|
2
|
+
class PresenterRenderer
|
3
|
+
include ActionView::Helpers::TranslationHelper
|
4
|
+
|
5
|
+
def initialize(presenter, view_context)
|
6
|
+
@presenter = presenter
|
7
|
+
@view_context = view_context
|
8
|
+
end
|
9
|
+
|
10
|
+
def value(field_name, locals={})
|
11
|
+
render_show_field_partial(field_name, locals)
|
12
|
+
end
|
13
|
+
|
14
|
+
def label(field)
|
15
|
+
t(:"#{model_name.param_key}.#{field}", scope: label_scope, default: field.to_s.humanize).presence
|
16
|
+
end
|
17
|
+
|
18
|
+
def fields(terms, &block)
|
19
|
+
@view_context.safe_join(terms.map { |term| yield self, term })
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
|
24
|
+
def render_show_field_partial(field_name, locals)
|
25
|
+
partial = find_field_partial(field_name)
|
26
|
+
@view_context.render partial, locals.merge(key: field_name, record: @presenter)
|
27
|
+
end
|
28
|
+
|
29
|
+
def find_field_partial(field_name)
|
30
|
+
["#{collection_path}/show_fields/_#{field_name}", "records/show_fields/_#{field_name}",
|
31
|
+
"#{collection_path}/show_fields/_default", "records/show_fields/_default"].find do |partial|
|
32
|
+
Rails.logger.debug "Looking for show field partial #{partial}"
|
33
|
+
return partial.sub(/\/_/, '/') if partial_exists?(partial)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def collection_path
|
38
|
+
@collection_path ||= ActiveSupport::Inflector.tableize(model_name)
|
39
|
+
end
|
40
|
+
|
41
|
+
def partial_exists?(partial)
|
42
|
+
@view_context.lookup_context.find_all(partial).any?
|
43
|
+
end
|
44
|
+
|
45
|
+
def label_scope
|
46
|
+
:"simple_form.labels"
|
47
|
+
end
|
48
|
+
|
49
|
+
def model_name
|
50
|
+
@presenter.model_class.model_name
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -5,9 +5,8 @@
|
|
5
5
|
<h3>Applies to individual files uploaded</h3>
|
6
6
|
<%= content_tag :p, t('sufia.batch.help.title'), class: "help-block" %>
|
7
7
|
<% @batch.generic_files.sort! { |a,b| a.label.downcase <=> b.label.downcase }.each_with_index do |gen_f, index| %>
|
8
|
-
<div class="
|
9
|
-
<%= f.
|
10
|
-
<%= help_icon(:title) %>
|
8
|
+
<div class="form-group">
|
9
|
+
<%= f.input_label :title, as: :multi_value_with_help, label: "Title #{index + 1}" %>
|
11
10
|
<div id="additional_title_clone">
|
12
11
|
<%= f.text_field :title, name: "title[#{gen_f.id}][]", value: gen_f.label, class: 'form-control', required: true %>
|
13
12
|
</div>
|
@@ -28,50 +27,17 @@
|
|
28
27
|
<div class="row">
|
29
28
|
<div class="col-sm-6">
|
30
29
|
<h3>Applies to all files just uploaded</h3>
|
31
|
-
|
32
|
-
|
33
|
-
<%= f.label :resource_type, "Resource Types", class: "control-label", for: "resource_type" %>
|
34
|
-
<%= help_icon(:resource_type) %>
|
35
|
-
<%= content_tag :p, t('sufia.batch.help.resource_type'), class: "help-block" %>
|
36
|
-
<%= f.select "resource_type", Sufia::Engine::config.resource_types, {}, { multiple: true, class: 'form-control', size: 7, "aria-label" => "Rights combo box" } %>
|
37
|
-
</div>
|
30
|
+
<%= f.input :resource_type, as: :select_with_help, collection: Sufia.config.resource_types,
|
31
|
+
input_html: { class: 'form-control', multiple: true, required: true } %>
|
38
32
|
|
39
|
-
|
40
|
-
<%= f.label :tag, "<span class='required-field'>*</span> Keyword".html_safe, class: "control-label" %>
|
41
|
-
<%= help_icon(:tag) %>
|
42
|
-
<div id="additional_tag_clone" class="input-group">
|
43
|
-
<%= f.text_field :tag, name: "generic_file[tag][]", value: "", class: 'form-control', required: true %>
|
44
|
-
<span class="input-group-btn field-controls">
|
45
|
-
<button class="adder btn" name="additional_tag" id="additional_tag_submit">
|
46
|
-
<span aria-hidden="true"><i class="glyphicon glyphicon-plus"></i></span>
|
47
|
-
<span class="sr-only"><%= t('sufia.batch.metadata.add_another_keyword') %></span>
|
48
|
-
</button>
|
49
|
-
</span>
|
50
|
-
</div>
|
51
|
-
<div id="additional_tag_elements"></div>
|
52
|
-
</div>
|
33
|
+
<%= f.input :tag, as: :multi_value_with_help, input_html: { required: true } %>
|
53
34
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<%= f.text_field :creator, name: "generic_file[creator][]", value: "", class: 'form-control', required: true %>
|
59
|
-
<span class="input-group-btn field-controls">
|
60
|
-
<button class="adder btn" name="additional_creator" id="additional_creator_submit"><span aria-hidden="true"><i class="glyphicon glyphicon-plus"></i></span><span class="sr-only"><%= t('sufia.batch.metadata.add_another_creator') %></span></button>
|
61
|
-
</span>
|
62
|
-
</div>
|
63
|
-
<div id="additional_creator_elements"></div>
|
64
|
-
</div>
|
35
|
+
<%= f.input :creator, as: :multi_value_with_help, input_html: { required: true } %>
|
36
|
+
|
37
|
+
<%= f.input :rights, as: :select_with_modal_help, collection: Sufia.config.cc_licenses,
|
38
|
+
input_html: { class: 'form-control', multiple: true, required: true } %>
|
65
39
|
|
66
|
-
|
67
|
-
<%= f.label :rights, '<span class="required-field">*</span> Rights'.html_safe, class: "control-label" %>
|
68
|
-
<%= help_icon_modal('rightsModal') %>
|
69
|
-
<% f.object[:rights].each_with_index do |v, index| %>
|
70
|
-
<%= render_edit_field_partial(:rights, record: f.object, f: f, v: v, index: index, render_req: true) %>
|
71
|
-
<% end %>
|
72
|
-
<%= render "generic_files/rights_modal" %>
|
73
|
-
<div id="additional_rights_elements"></div>
|
74
|
-
</div>
|
40
|
+
<%= render "generic_files/rights_modal" %>
|
75
41
|
|
76
42
|
<button id="show_addl_descriptions" class="btn btn-default" aria-label="reveal additional metadata description fields">Show Additional Fields</button>
|
77
43
|
<!-- hidden on initial load -->
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<div id="more_descriptions">
|
2
2
|
<button id="hide_addl_descriptions" class="btn btn-default" aria-label="hide additional metadata description fields">Hide Additional Fields</button>
|
3
|
-
<% (
|
4
|
-
<%=
|
3
|
+
<% (f.object.terms - [:title, :creator, :rights, :tag, :resource_type]).each do |term| %>
|
4
|
+
<%# <%= f.input term, as: :multi_value_with_help, input_html: { required: false} %>
|
5
|
+
<%= render_edit_field_partial(term, f: f) %>
|
5
6
|
<% end %>
|
6
7
|
</div> <!-- /more_descriptions -->
|
@@ -8,9 +8,9 @@
|
|
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. <span class="required
|
11
|
+
once this step is finished. <span class="required"><abbr title="required">*</abbr></span> indicates required fields.
|
12
12
|
</p>
|
13
|
-
<%=
|
13
|
+
<%= simple_form_for [sufia, @batch, @form], html: { multipart: true }, builder: Sufia::FormBuilder do |f| %>
|
14
14
|
|
15
15
|
<%= render 'metadata', f: f %>
|
16
16
|
|
@@ -15,29 +15,26 @@
|
|
15
15
|
<div class="tab-content">
|
16
16
|
<div class="well tab-pane active" id="descriptions_display">
|
17
17
|
<% @terms.each do |term| %>
|
18
|
-
<% vals = @generic_file.send(term) %>
|
19
18
|
<div class="row">
|
20
|
-
|
21
|
-
|
22
|
-
<
|
23
|
-
<%=
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
<div class="accordion-body collapse expanded-details scrolly">
|
29
|
-
<%= form_for @generic_file, url: batch_edits_path, method: :put, remote: true, html: { id: "form_#{term.to_s}", class: "ajax-form"} do |f| %>
|
19
|
+
<%= simple_form_for @generic_file, url: batch_edits_path, method: :put, remote: true,
|
20
|
+
builder: Sufia::FormBuilder, html: { id: "form_#{term.to_s}", class: "ajax-form"} do |f| %>
|
21
|
+
<div class="col-sm-2 col-sm-offset-1">
|
22
|
+
<a class="accordion-toggle grey glyphicon-chevron-right-helper collapsed" data-toggle="collapse" href="#collapse_<%= term %>" id="expand_link_<%=term.to_s%>">
|
23
|
+
<%= f.input_label term %> <span class="chevron"></span>
|
24
|
+
</a>
|
25
|
+
</div>
|
26
|
+
<div id="collapse_<%= term %>" class="collapse scrolly col-sm-6">
|
30
27
|
<%= hidden_field_tag('update_type', 'update') %>
|
31
28
|
<%= hidden_field_tag('key', term.to_s) %>
|
32
|
-
|
29
|
+
<%# TODO we don't need to show required %>
|
30
|
+
<%= render_edit_field_partial(term, f: f) %>
|
33
31
|
<div>
|
34
32
|
<%= f.submit "Save changes", class: 'btn btn-primary field-save updates-batches' , id: "#{term.to_s}_save" %>
|
35
|
-
<a class="
|
36
|
-
<div
|
33
|
+
<a class="btn btn-default" data-toggle="collapse" data-parent="#row_<%= term.to_s %>" href="#collapse_<%= term.to_s %>">Cancel </a>
|
34
|
+
<div class="status fleft"></div>
|
37
35
|
</div>
|
38
|
-
<% end %>
|
39
36
|
</div>
|
40
|
-
|
37
|
+
<% end %>
|
41
38
|
</div>
|
42
39
|
<% end %>
|
43
40
|
</div><!-- /well -->
|
@@ -49,7 +46,6 @@
|
|
49
46
|
<%= render "generic_files/permission_form", f: f %>
|
50
47
|
<div class="row">
|
51
48
|
<%= f.submit "Save changes", class: 'btn btn-primary updates-batches', id: 'permissions_save' %>
|
52
|
-
<a class="accordion-toggle btn" data-toggle="collapse" data-parent="#row_permissions" href="#collapse_permissions">Cancel </a>
|
53
49
|
<div id="status_permissions" class="status fleft"></div>
|
54
50
|
</div>
|
55
51
|
<% end %>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<%=
|
1
|
+
<%= simple_form_for [collections, @form], html: {class: 'form-horizontal editor'} do |f| %>
|
2
2
|
<div id="descriptions_display">
|
3
3
|
<h2 class="non lower">Descriptions <small class="pull-right"><span class="error">*</span> indicates required fields</small> </h2>
|
4
4
|
<div class="well">
|
5
|
-
<%
|
6
|
-
<%=
|
5
|
+
<% f.object.terms.each do |term| %>
|
6
|
+
<%= render_edit_field_partial term, f: f %>
|
7
7
|
<% end %>
|
8
8
|
</div><!-- /well -->
|
9
9
|
</div>
|
@@ -16,9 +16,9 @@
|
|
16
16
|
|
17
17
|
<div class="primary-actions">
|
18
18
|
<% if params[:action] == "new" %>
|
19
|
-
<%= f.
|
19
|
+
<%= f.submit 'Create Collection', class: 'btn btn-primary', onclick: "confirmation_needed = false;", id: "create_submit", name: "create_collection" %>
|
20
20
|
<% else %>
|
21
|
-
<%= f.
|
21
|
+
<%= f.submit 'Update Collection', class: 'btn btn-primary', onclick: "confirmation_needed = false;", id: "update_submit", name: "update_collection" %>
|
22
22
|
<% end %>
|
23
23
|
<%= link_to t(:'helpers.action.cancel'), main_app.root_path, class: 'btn btn-link' %>
|
24
24
|
</div>
|
@@ -1,13 +1,11 @@
|
|
1
1
|
<h2 class="sr-only">Descriptions</h2>
|
2
2
|
<dl class="metadata-collections">
|
3
|
-
<dt><%=
|
4
|
-
<dd><%= @
|
5
|
-
<dt><%=
|
6
|
-
<dd><%=
|
7
|
-
<% (@
|
8
|
-
|
9
|
-
<
|
10
|
-
<dd><%= render_show_field_partial_with_action("records", term, {record: @collection}) %></dd>
|
11
|
-
<% end %>
|
3
|
+
<dt><%= t(".total_items") %></dt>
|
4
|
+
<dd><%= @presenter.total_items %></dd>
|
5
|
+
<dt><%= t(".size") %></dt>
|
6
|
+
<dd><%= @presenter.size %></dd>
|
7
|
+
<% present_terms(@presenter, @presenter.terms_with_values) do |r, term| %>
|
8
|
+
<dt><%= r.label(term) %></dt>
|
9
|
+
<dd><%= r.value(term) %></dd>
|
12
10
|
<% end %>
|
13
|
-
</dl>
|
11
|
+
</dl>
|
@@ -5,20 +5,19 @@
|
|
5
5
|
<% unless has_collection_search_parameters? %>
|
6
6
|
<div class="row">
|
7
7
|
<div class="col-xs-12 col-sm-2">
|
8
|
-
<%= render
|
8
|
+
<%= render 'collections/media_display', collection: @collection %>
|
9
9
|
</div>
|
10
10
|
<div class="col-xs-12 col-sm-10"><!-- class="column second"> -->
|
11
|
-
<%= render
|
12
|
-
<%= render
|
11
|
+
<%= render 'collections/edit_actions' %>
|
12
|
+
<%= render 'collections/form' %>
|
13
13
|
</div><!-- /columns second -->
|
14
14
|
</div> <!-- /columns two-b -->
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
<h2>Manage Items in this Collection</h2>
|
18
|
-
<%= render
|
19
|
-
<%= render
|
20
|
-
<%= render
|
18
|
+
<%= render 'search_collection_dashboard_form'%>
|
19
|
+
<%= render 'my/did_you_mean' %>
|
20
|
+
<%= render 'my/facet_selected' %>
|
21
21
|
<%= render 'collections/sort_and_per_page' %>
|
22
|
-
<%= render
|
23
|
-
|
24
|
-
<%= render partial:'paginate' %>
|
22
|
+
<%= render 'document_list', documents: @member_docs, document_list_format: "dashboard" %>
|
23
|
+
<%= render 'paginate' %>
|
@@ -1,4 +1,3 @@
|
|
1
1
|
<div>
|
2
|
-
<%= f.
|
3
|
-
<%= render "records/edit_fields/suffix", key: key, index: index, single: true %>
|
2
|
+
<%= f.input :description, as: :text, input_html: { rows: '14', required: record.required?(key) } %>
|
4
3
|
</div>
|
@@ -8,9 +8,9 @@
|
|
8
8
|
|
9
9
|
<td>
|
10
10
|
<%= t("sufia.dashboard.stats.files") %>
|
11
|
-
<ul>
|
12
|
-
<li
|
13
|
-
<li
|
11
|
+
<ul class="views-downloads-dashboard">
|
12
|
+
<li><span class="badge-optional"><%= @user.total_file_views %></span> <%= t("sufia.dashboard.stats.file_views").pluralize(@user.total_file_views) %></li>
|
13
|
+
<li><span class="badge-optional"><%= @user.total_file_downloads %></span> <%= t("sufia.dashboard.stats.file_downloads").pluralize(@user.total_file_downloads) %></li>
|
14
14
|
</ul>
|
15
15
|
</td>
|
16
16
|
</tr>
|
@@ -1,19 +1,16 @@
|
|
1
|
-
<%# convert class variable to a local variable if the local hasn't been set %>
|
2
|
-
<% generic_file ||= @generic_file %>
|
3
|
-
|
4
1
|
<div id="descriptions_display" class="tab-pane active">
|
5
|
-
<%=
|
2
|
+
<%= simple_form_for [sufia, @form], html: { multipart: true } do |f| %>
|
6
3
|
<%= hidden_field_tag('redirect_tab', 'descriptions') %>
|
7
|
-
<h1>Descriptions <span class="pull-right required
|
4
|
+
<h1>Descriptions <span class="pull-right required"><abbr title="required">*</abbr> indicates required fields</span></h1>
|
8
5
|
<div class="well">
|
9
6
|
|
10
|
-
<%
|
11
|
-
<%=
|
7
|
+
<% f.object.terms.each do |term| %>
|
8
|
+
<%= render_edit_field_partial(term, f: f) %>
|
12
9
|
<% end %>
|
13
10
|
|
14
11
|
</div><!-- /well -->
|
15
12
|
<div>
|
16
|
-
<%= f.
|
13
|
+
<%= f.submit class: 'btn btn-primary', onclick: "confirmation_needed = false;", id: "upload_submit", name: "update_descriptions" do %>
|
17
14
|
<i class="glyphicon glyphicon-floppy-disk"></i> Save Descriptions
|
18
15
|
<% end %>
|
19
16
|
</div>
|