sufia 7.0.0.beta2 → 7.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/sufia/admin/stats_behavior.rb +1 -0
- data/app/controllers/concerns/sufia/batch_uploads_controller_behavior.rb +1 -7
- data/app/controllers/concerns/sufia/works_controller_behavior.rb +1 -5
- data/app/forms/sufia/forms/collection_form.rb +8 -3
- data/app/helpers/sufia/sufia_helper_behavior.rb +10 -10
- data/app/models/concerns/sufia/ability.rb +8 -11
- data/app/models/concerns/sufia/file_set_behavior.rb +5 -0
- data/app/models/featured_work.rb +1 -1
- data/app/models/featured_work_list.rb +9 -6
- data/app/search_builders/sufia/homepage_search_builder.rb +6 -1
- data/app/search_builders/sufia/my_collections_search_builder.rb +4 -9
- data/app/search_builders/sufia/my_works_search_builder.rb +6 -5
- data/app/search_builders/sufia/search_builder.rb +0 -7
- data/app/views/_toolbar.html.erb +13 -29
- data/app/views/admin/_menu.html.erb +8 -0
- data/app/views/collections/_document_list.html.erb +1 -1
- data/app/views/collections/_edit_actions.html.erb +4 -3
- data/app/views/collections/_form.html.erb +18 -4
- data/app/views/collections/_media_display.html.erb +3 -1
- data/app/views/collections/_show_actions.html.erb +19 -5
- data/app/views/collections/_show_document_list_menu.html.erb +5 -5
- data/app/views/collections/_show_document_list_row.html.erb +3 -3
- data/app/views/collections/_work_action_menu.html.erb +4 -4
- data/app/views/collections/edit.html.erb +2 -2
- data/app/views/collections/show.html.erb +23 -26
- data/app/views/curation_concerns/base/_form_metadata.html.erb +1 -1
- data/app/views/curation_concerns/base/_form_relationships.html.erb +1 -1
- data/app/views/curation_concerns/base/_guts4form.html.erb +3 -1
- data/app/views/curation_concerns/file_sets/_descriptions.html.erb +1 -1
- data/app/views/curation_concerns/file_sets/edit.html.erb +1 -1
- data/app/views/curation_concerns/permissions/confirm.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_contents.html.erb +1 -1
- data/app/views/dashboard/_index_partials/_proxy_rights.html.erb +3 -3
- data/app/views/dashboard/_index_partials/_transfers.html.erb +2 -2
- data/app/views/my/_collection_action_menu.html.erb +7 -7
- data/app/views/my/_index_partials/_default_group.html.erb +5 -5
- data/app/views/my/_index_partials/_list_collections.html.erb +13 -13
- data/app/views/my/_index_partials/_list_works.html.erb +2 -2
- data/app/views/my/_work_action_menu.html.erb +11 -8
- data/app/views/sufia/homepage/_featured.html.erb +4 -4
- data/app/views/sufia/homepage/_featured_fields.html.erb +2 -2
- data/app/views/sufia/homepage/_recent_document.html.erb +1 -1
- data/app/views/sufia/homepage/_sortable_featured.html.erb +7 -7
- data/app/views/transfers/index.html.erb +3 -3
- data/app/views/users/_contributions.html.erb +2 -2
- data/app/views/users/_trophy_edit.html.erb +1 -1
- data/config/locales/sufia.en.yml +82 -25
- data/config/routes.rb +3 -7
- data/lib/generators/sufia/assets_generator.rb +4 -0
- data/lib/generators/sufia/install_generator.rb +15 -2
- data/lib/generators/sufia/templates/sufia.scss +5 -0
- data/lib/generators/sufia/upgrade700_generator.rb +0 -8
- data/lib/sufia/version.rb +1 -1
- data/spec/controllers/admin_stats_controller_spec.rb +17 -10
- data/spec/controllers/generic_works_controller_spec.rb +2 -2
- data/spec/features/collection_spec.rb +3 -3
- data/spec/features/edit_file_spec.rb +5 -3
- data/spec/forms/sufia/collection_form_spec.rb +12 -3
- data/spec/models/ability_spec.rb +2 -0
- data/spec/models/featured_work_list_spec.rb +6 -6
- data/spec/presenters/work_usage_spec.rb +1 -1
- data/spec/search_builder/sufia/my_shares_search_builder_spec.rb +4 -2
- data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
- data/spec/views/_toolbar.html.erb_spec.rb +11 -0
- data/spec/views/collections/_form.html.erb_spec.rb +1 -1
- data/spec/views/collections/_show_document_list_menu.html.erb_spec.rb +5 -5
- data/spec/views/collections/edit.html.erb_spec.rb +24 -0
- data/spec/views/collections/show.html.erb_spec.rb +32 -0
- data/spec/views/curation_concerns/base/_form.html.erb_spec.rb +2 -0
- data/spec/views/curation_concerns/permissions/confirm.html.erb_spec.rb +1 -8
- data/spec/views/my/_list_collections.html.erb_spec.rb +37 -0
- data/spec/views/my/_list_works.html.erb_spec.rb +1 -1
- data/spec/views/sufia/batch_uploads/_form.html.erb_spec.rb +2 -0
- data/sufia.gemspec +1 -1
- metadata +11 -6
- data/lib/generators/sufia/admin_stat_generator.rb +0 -14
- data/lib/generators/sufia/templates/sufia/stats_admin.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 425e77caaca484e6386192bbda30de4535f2e3c7
|
4
|
+
data.tar.gz: b0bf0312c34896bfe6d74bec79edaa4291ba20e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81ac16b3e74bd6f433903f9b595afabda03f6a1a9dd9674f844fb758ff069428e9e917ee8b46f16b28446cd7550e203390502f1e20d7331f65a57b3637bc1e7
|
7
|
+
data.tar.gz: 0ec61fb29710436341b2d47d6601c610ff4ad02e545f69aa3a913134e0374d97ef9ca9c044d1ae59c66668bde59c385f2ba3f9cbea55b991dc171c0dea4ff8e1
|
@@ -13,13 +13,7 @@ module Sufia
|
|
13
13
|
def create
|
14
14
|
authenticate_user!
|
15
15
|
create_update_job
|
16
|
-
flash[:notice] =
|
17
|
-
Your files are being processed by #{view_context.application_name} in
|
18
|
-
the background. The metadata and access controls you specified are being applied.
|
19
|
-
Files will be marked <span class="label label-danger" title="Private">Private</span>
|
20
|
-
until this process is complete (shouldn't take too long, hang in there!). You may need
|
21
|
-
to refresh your dashboard to see these updates.
|
22
|
-
EOS
|
16
|
+
flash[:notice] = t('sufia.generic_works.new.after_create_html', application_name: view_context.application_name)
|
23
17
|
redirect_after_update
|
24
18
|
end
|
25
19
|
|
@@ -45,11 +45,7 @@ module Sufia
|
|
45
45
|
def after_create_response
|
46
46
|
respond_to do |wants|
|
47
47
|
wants.html do
|
48
|
-
flash[:notice] =
|
49
|
-
"the background. The metadata and access controls you specified are being applied. " \
|
50
|
-
"Files will be marked <span class=\"label label-danger\" title=\"Private\">Private</span> " \
|
51
|
-
"until this process is complete (shouldn't take too long, hang in there!). You may need " \
|
52
|
-
"to refresh your dashboard to see these updates."
|
48
|
+
flash[:notice] = t('sufia.generic_works.new.after_create_html', application_name: view_context.application_name)
|
53
49
|
redirect_to [main_app, curation_concern]
|
54
50
|
end
|
55
51
|
wants.json { render :show, status: :created, location: polymorphic_path([main_app, curation_concern]) }
|
@@ -1,8 +1,13 @@
|
|
1
1
|
module Sufia::Forms
|
2
2
|
class CollectionForm < CurationConcerns::Forms::CollectionEditForm
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
delegate :id, to: :model
|
4
|
+
|
5
|
+
def primary_terms
|
6
|
+
[:title]
|
7
|
+
end
|
8
|
+
|
9
|
+
def secondary_terms
|
10
|
+
[:creator,
|
6
11
|
:contributor,
|
7
12
|
:description,
|
8
13
|
:keyword,
|
@@ -159,16 +159,6 @@ module Sufia
|
|
159
159
|
id: "permission_" + document.id, class: "visibility-link"
|
160
160
|
end
|
161
161
|
|
162
|
-
def render_visibility_label(document)
|
163
|
-
if document.registered?
|
164
|
-
content_tag :span, institution_name, class: "label label-info", title: institution_name
|
165
|
-
elsif document.public?
|
166
|
-
content_tag :span, t('sufia.visibility.open'), class: "label label-success", title: t('sufia.visibility.open_title_attr')
|
167
|
-
else
|
168
|
-
content_tag :span, t('sufia.visibility.private'), class: "label label-danger", title: t('sufia.visibility.private_title_attr')
|
169
|
-
end
|
170
|
-
end
|
171
|
-
|
172
162
|
def user_display_name_and_key(user_key)
|
173
163
|
user = ::User.find_by_user_key(user_key)
|
174
164
|
return user_key if user.nil?
|
@@ -182,6 +172,16 @@ module Sufia
|
|
182
172
|
|
183
173
|
private
|
184
174
|
|
175
|
+
def render_visibility_label(document)
|
176
|
+
if document.registered?
|
177
|
+
content_tag :span, institution_name, class: "label label-info", title: institution_name
|
178
|
+
elsif document.public?
|
179
|
+
content_tag :span, t('sufia.visibility.open'), class: "label label-success", title: t('sufia.visibility.open_title_attr')
|
180
|
+
else
|
181
|
+
content_tag :span, t('sufia.visibility.private'), class: "label label-danger", title: t('sufia.visibility.private_title_attr')
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
185
|
def user_agent
|
186
186
|
request.user_agent || ''
|
187
187
|
end
|
@@ -3,17 +3,13 @@ module Sufia
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
self.ability_logic += [:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
stats_abilities
|
14
|
-
citation_abilities
|
15
|
-
proxy_deposit_abilities
|
16
|
-
uploaded_file_abilities
|
6
|
+
self.ability_logic += [:user_abilities,
|
7
|
+
:featured_work_abilities,
|
8
|
+
:editor_abilities,
|
9
|
+
:stats_abilities,
|
10
|
+
:citation_abilities,
|
11
|
+
:proxy_deposit_abilities,
|
12
|
+
:uploaded_file_abilities]
|
17
13
|
end
|
18
14
|
|
19
15
|
def uploaded_file_abilities
|
@@ -51,6 +47,7 @@ module Sufia
|
|
51
47
|
end
|
52
48
|
|
53
49
|
def stats_abilities
|
50
|
+
can :read, Sufia::Statistics if admin?
|
54
51
|
alias_action :stats, to: :read
|
55
52
|
end
|
56
53
|
|
data/app/models/featured_work.rb
CHANGED
@@ -16,8 +16,8 @@ class FeaturedWorkList
|
|
16
16
|
@works = FeaturedWork.all
|
17
17
|
add_solr_document_to_works
|
18
18
|
@works = @works.reject do |work|
|
19
|
-
work.destroy if work.
|
20
|
-
work.
|
19
|
+
work.destroy if work.presenter.blank?
|
20
|
+
work.presenter.blank?
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -26,8 +26,8 @@ class FeaturedWorkList
|
|
26
26
|
private
|
27
27
|
|
28
28
|
def add_solr_document_to_works
|
29
|
-
|
30
|
-
work_with_id(
|
29
|
+
work_presenters.each do |presenter|
|
30
|
+
work_with_id(presenter.id).presenter = presenter
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -35,8 +35,11 @@ class FeaturedWorkList
|
|
35
35
|
@works.pluck(:work_id)
|
36
36
|
end
|
37
37
|
|
38
|
-
def
|
39
|
-
|
38
|
+
def work_presenters
|
39
|
+
ability = nil
|
40
|
+
CurationConcerns::PresenterFactory.build_presenters(ids,
|
41
|
+
Sufia::WorkShowPresenter,
|
42
|
+
ability)
|
40
43
|
end
|
41
44
|
|
42
45
|
def work_with_id(id)
|
@@ -1,4 +1,9 @@
|
|
1
1
|
# Added to allow for the My controller to show only things I have edit access to
|
2
2
|
class Sufia::HomepageSearchBuilder < Sufia::SearchBuilder
|
3
|
-
|
3
|
+
include CurationConcerns::FilterByType
|
4
|
+
self.default_processor_chain += [:add_access_controls_to_solr_params]
|
5
|
+
|
6
|
+
def only_works?
|
7
|
+
true
|
8
|
+
end
|
4
9
|
end
|
@@ -1,16 +1,11 @@
|
|
1
1
|
# Added to allow for the My controller to show only things I have edit access to
|
2
2
|
class Sufia::MyCollectionsSearchBuilder < Sufia::SearchBuilder
|
3
3
|
include Sufia::MySearchBuilderBehavior
|
4
|
+
include CurationConcerns::FilterByType
|
4
5
|
|
5
|
-
self.default_processor_chain += [
|
6
|
-
:show_only_resources_deposited_by_current_user,
|
7
|
-
:show_only_collections
|
8
|
-
]
|
6
|
+
self.default_processor_chain += [:show_only_resources_deposited_by_current_user]
|
9
7
|
|
10
|
-
def
|
11
|
-
|
12
|
-
solr_parameters[:fq] += [
|
13
|
-
ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: Collection.to_class_uri)
|
14
|
-
]
|
8
|
+
def only_collections?
|
9
|
+
true
|
15
10
|
end
|
16
11
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# Added to allow for the My controller to show only things I have edit access to
|
2
2
|
class Sufia::MyWorksSearchBuilder < Sufia::SearchBuilder
|
3
3
|
include Sufia::MySearchBuilderBehavior
|
4
|
+
include CurationConcerns::FilterByType
|
4
5
|
|
5
|
-
self.default_processor_chain
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
self.default_processor_chain += [:add_advanced_search_to_solr, :show_only_resources_deposited_by_current_user]
|
7
|
+
|
8
|
+
def only_works?
|
9
|
+
true
|
10
|
+
end
|
10
11
|
end
|
@@ -10,11 +10,4 @@ class Sufia::SearchBuilder < Blacklight::SearchBuilder
|
|
10
10
|
ActiveFedora::SolrQueryBuilder.construct_query_for_rel(depositor: scope.current_user.user_key)
|
11
11
|
]
|
12
12
|
end
|
13
|
-
|
14
|
-
def show_only_generic_works(solr_parameters)
|
15
|
-
solr_parameters[:fq] ||= []
|
16
|
-
solr_parameters[:fq] += [
|
17
|
-
ActiveFedora::SolrQueryBuilder.construct_query_for_rel(has_model: ::GenericWork.to_class_uri)
|
18
|
-
]
|
19
|
-
end
|
20
13
|
end
|
data/app/views/_toolbar.html.erb
CHANGED
@@ -1,55 +1,39 @@
|
|
1
1
|
<% if user_signed_in? %>
|
2
2
|
<ul class="nav navbar-nav">
|
3
|
-
|
4
|
-
<li class="dropdown">
|
5
|
-
<%= link_to sufia.admin_stats_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
|
6
|
-
<span class="fa fa-gear"></span> Admin <span class="caret"></span>
|
7
|
-
<% end %>
|
8
|
-
<ul class="dropdown-menu">
|
9
|
-
<% if respond_to? :admin_stats_path %>
|
10
|
-
<li><%= link_to 'Repository Statistics', sufia.admin_stats_path %></li>
|
11
|
-
<% end %>
|
12
|
-
|
13
|
-
<% if respond_to? :admin_queues_path %>
|
14
|
-
<li><%= link_to 'Message Queues', sufia.admin_queues_path %></li>
|
15
|
-
<% end %>
|
16
|
-
</ul>
|
17
|
-
</li>
|
18
|
-
<% end %>
|
19
|
-
|
3
|
+
<%= render '/admin/menu' if can? :manage, :all %>
|
20
4
|
<li class="dropdown">
|
21
5
|
<%= link_to sufia.dashboard_index_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
|
22
|
-
<span class="fa fa-tachometer"></span>
|
6
|
+
<span class="fa fa-tachometer"></span> <%= t("sufia.toolbar.dashboard.menu") %> <span class="caret"></span>
|
23
7
|
<% end %>
|
24
8
|
<ul class="dropdown-menu">
|
25
|
-
<li><%= link_to
|
9
|
+
<li><%= link_to t("sufia.toolbar.dashboard.my"), sufia.dashboard_index_path %></li>
|
26
10
|
<li class="divider"></li>
|
27
|
-
<li><%= link_to
|
11
|
+
<li><%= link_to t("sufia.toolbar.dashboard.transfers"), sufia.transfers_path %></li>
|
28
12
|
<li class="divider"></li>
|
29
|
-
<li><%= link_to
|
30
|
-
<li><%= link_to
|
13
|
+
<li><%= link_to t("sufia.toolbar.dashboard.highlights"), sufia.dashboard_highlights_path %></li>
|
14
|
+
<li><%= link_to t("sufia.toolbar.dashboard.shares"), sufia.dashboard_shares_path %></li>
|
31
15
|
</ul>
|
32
16
|
</li>
|
33
17
|
|
34
18
|
<% if can_ever_create_works? %>
|
35
19
|
<li class="dropdown">
|
36
20
|
<%= link_to sufia.dashboard_works_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
|
37
|
-
<span class="fa fa-cube"></span>
|
21
|
+
<span class="fa fa-cube"></span> <%= t("sufia.toolbar.works.menu") %> <span class="caret"></span>
|
38
22
|
<% end %>
|
39
23
|
<ul class="dropdown-menu">
|
40
|
-
<li><%= link_to
|
24
|
+
<li><%= link_to t("sufia.toolbar.works.my"), sufia.dashboard_works_path %></li>
|
41
25
|
|
42
26
|
<% classification = CurationConcerns::QuickClassificationQuery.new(current_user) %>
|
43
27
|
<% classification.each do |concern| %>
|
44
28
|
<li><%= link_to(
|
45
|
-
"
|
29
|
+
"#{t("sufia.toolbar.works.new")} #{concern.human_readable_type}",
|
46
30
|
new_polymorphic_path([main_app, concern]),
|
47
31
|
class: "item-option contextual-quick-classify #{dom_class(concern, 'new').gsub('_', '-')}",
|
48
32
|
role: 'menuitem'
|
49
33
|
) %>
|
50
34
|
</li>
|
51
35
|
<% end %>
|
52
|
-
<li><%= link_to
|
36
|
+
<li><%= link_to t("sufia.toolbar.works.batch"), sufia.new_batch_upload_path %></li>
|
53
37
|
</ul>
|
54
38
|
</li>
|
55
39
|
<% end %>
|
@@ -57,11 +41,11 @@
|
|
57
41
|
<% if can?(:create, Collection) %>
|
58
42
|
<li class="dropdown">
|
59
43
|
<%= link_to sufia.dashboard_collections_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
|
60
|
-
<span class="fa fa-cubes"></span>
|
44
|
+
<span class="fa fa-cubes"></span> <%= t("sufia.toolbar.collections.menu") %> <span class="caret"></span>
|
61
45
|
<% end %>
|
62
46
|
<ul class="dropdown-menu">
|
63
|
-
<li><%= link_to
|
64
|
-
<li><%= link_to
|
47
|
+
<li><%= link_to t("sufia.toolbar.collections.my"), sufia.dashboard_collections_path %></li>
|
48
|
+
<li><%= link_to t("sufia.toolbar.collections.new"), main_app.new_collection_path %></li>
|
65
49
|
</ul>
|
66
50
|
</li>
|
67
51
|
<% end %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<li class="dropdown">
|
2
|
+
<%= link_to sufia.admin_stats_path, role: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false } do %>
|
3
|
+
<span class="fa fa-gear"></span> <%= t("sufia.toolbar.admin.menu") %> <span class="caret"></span>
|
4
|
+
<% end %>
|
5
|
+
<ul class="dropdown-menu">
|
6
|
+
<li><%= link_to t("sufia.toolbar.admin.statistics"), sufia.admin_stats_path %></li>
|
7
|
+
</ul>
|
8
|
+
</li>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% @max_batch_size = 100 %>
|
4
4
|
<% @user = current_user %>
|
5
5
|
<% if documents.empty? %>
|
6
|
-
<div class="alert alert-warning" role="alert"><%= t('sufia.collection.no_visible_works') %></div>
|
6
|
+
<div class="alert alert-warning" role="alert"><%= t('sufia.collection.document_list.no_visible_works') %></div>
|
7
7
|
<% else %>
|
8
8
|
<% @document_list = documents %>
|
9
9
|
<% if params[:action] == "edit" %>
|
@@ -1,5 +1,6 @@
|
|
1
|
-
<h2 class="sr-only"
|
1
|
+
<h2 class="sr-only"><%= t('sufia.collection.actions.header') %></h2>
|
2
2
|
<div class="actions-controls-collections">
|
3
|
-
|
4
|
-
|
3
|
+
<%= link_to t('sufia.collection.actions.add_works.label'),
|
4
|
+
sufia.dashboard_works_path(add_files_to_collection: @form.id),
|
5
|
+
title: t('sufia.collection.actions.add_works.desc') %>
|
5
6
|
</div>
|
@@ -1,9 +1,23 @@
|
|
1
1
|
<%= simple_form_for @form, html: { class: 'editor' } do |f| %>
|
2
2
|
<div id="descriptions_display">
|
3
|
-
<h2 class="non lower"
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
<h2 class="non lower"><%= t('sufia.collection.edit.description') %></h2>
|
4
|
+
<div id="base-terms">
|
5
|
+
<% f.object.primary_terms.each do |term| %>
|
6
|
+
<%= render_edit_field_partial(term, f: f) %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
<%= link_to t('sufia.collection.edit.additional_fields'),
|
10
|
+
'#extended-terms',
|
11
|
+
class: 'btn btn-default',
|
12
|
+
data: { toggle: 'collapse' },
|
13
|
+
role: "button",
|
14
|
+
'aria-expanded'=> "false",
|
15
|
+
'aria-controls'=> "extended-terms" %>
|
16
|
+
<div id="extended-terms" class='collapse'>
|
17
|
+
<% f.object.secondary_terms.each do |term| %>
|
18
|
+
<%= render_edit_field_partial(term, f: f) %>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
7
21
|
</div>
|
8
22
|
<%= hidden_field_tag :type, params[:type] %>
|
9
23
|
<% if params[:batch_document_ids].present? %>
|
@@ -1,7 +1,21 @@
|
|
1
|
-
<h2 class="sr-only"
|
1
|
+
<h2 class="sr-only"><%= t('sufia.collection.actions.header') %></h2>
|
2
2
|
<div class="actions-controls-collections">
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
<% if can? :edit, presenter.solr_document %>
|
4
|
+
<%= link_to t('sufia.collection.actions.edit.label'),
|
5
|
+
edit_collection_path(presenter),
|
6
|
+
title: t('sufia.collection.actions.edit.desc'),
|
7
|
+
class: 'btn btn-default' %>
|
8
|
+
<%= link_to t('sufia.collection.actions.add_works.label'),
|
9
|
+
sufia.dashboard_works_path(add_files_to_collection: presenter.id),
|
10
|
+
title: t('sufia.collection.actions.add_works.desc') %>
|
11
|
+
<%end %>
|
12
|
+
|
13
|
+
<% if can? :destroy, presenter.solr_document %>
|
14
|
+
<%= link_to t('sufia.collection.actions.delete.label'),
|
15
|
+
collection_path(presenter),
|
16
|
+
title: t('sufia.collection.actions.delete.desc'),
|
17
|
+
class: 'btn btn-danger',
|
18
|
+
data: { confirm: t('sufia.collection.actions.delete.confirmation'),
|
19
|
+
method: :delete } %>
|
20
|
+
<% end %>
|
7
21
|
</div>
|
@@ -3,16 +3,16 @@
|
|
3
3
|
</button>
|
4
4
|
<ul class="dropdown-menu dropdown-menu-right">
|
5
5
|
<li>
|
6
|
-
<%= link_to
|
6
|
+
<%= link_to [:edit, document],
|
7
7
|
class: "itemicon itemedit",
|
8
|
-
title: t('sufia.collection.
|
9
|
-
id: "edit_work_link_#{id}" do %>
|
10
|
-
<i class='glyphicon glyphicon-pencil'></i> <%= t('sufia.collection.
|
8
|
+
title: t('sufia.collection.document_list.edit'),
|
9
|
+
id: "edit_work_link_#{document.id}" do %>
|
10
|
+
<i class='glyphicon glyphicon-pencil'></i> <%= t('sufia.collection.document_list.edit') %>
|
11
11
|
<% end %>
|
12
12
|
</li>
|
13
13
|
<% if current_user %>
|
14
14
|
<li>
|
15
|
-
<%= display_trophy_link(current_user, id) do |text| %>
|
15
|
+
<%= display_trophy_link(current_user, document.id) do |text| %>
|
16
16
|
<i class='glyphicon glyphicon-star'></i> <%= text %>
|
17
17
|
<% end %>
|
18
18
|
</li>
|