blacklight 3.4.2 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +4 -0
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js +15 -474
- data/app/assets/javascripts/blacklight/bookmark_toggle.js +21 -0
- data/app/assets/javascripts/blacklight/checkbox_submit.js +126 -0
- data/app/assets/javascripts/blacklight/core.js +2 -0
- data/app/assets/javascripts/blacklight/facet_expand_contract.js +40 -0
- data/app/assets/javascripts/blacklight/folder_toggle.js +24 -0
- data/app/assets/javascripts/blacklight/lightbox_dialog.js +15 -0
- data/app/assets/javascripts/blacklight/more_facets.js +15 -0
- data/app/assets/javascripts/blacklight/search_context.js +26 -0
- data/app/assets/javascripts/blacklight/select_submit.js +18 -0
- data/app/assets/javascripts/blacklight/zebra_stripe.js +13 -0
- data/app/assets/javascripts/jquery.uiExt.ajaxyDialog.js +180 -0
- data/app/controllers/bookmarks_controller.rb +9 -9
- data/app/controllers/feedback_controller.rb +3 -3
- data/app/controllers/folder_controller.rb +3 -3
- data/app/controllers/saved_searches_controller.rb +7 -7
- data/app/controllers/search_history_controller.rb +2 -2
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +6 -10
- data/app/helpers/blacklight/catalog_helper_behavior.rb +8 -11
- data/app/helpers/blacklight/facets_helper_behavior.rb +2 -2
- data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +2 -2
- data/app/models/bookmark.rb +5 -0
- data/app/models/record_mailer.rb +5 -11
- data/app/views/_user_util_links.html.erb +6 -6
- data/app/views/bookmarks/index.html.erb +8 -8
- data/app/views/catalog/_bookmark_control.html.erb +2 -2
- data/app/views/catalog/_bookmark_form.html.erb +3 -3
- data/app/views/catalog/_citation.html.erb +3 -3
- data/app/views/catalog/_constraints.html.erb +1 -1
- data/app/views/catalog/_constraints_element.html.erb +2 -2
- data/app/views/catalog/_did_you_mean.html.erb +2 -7
- data/app/views/catalog/_document.html.erb +1 -1
- data/app/views/catalog/_email_form.html.erb +4 -4
- data/app/views/catalog/_facet_limit.html.erb +1 -1
- data/app/views/catalog/_facet_pagination.html.erb +7 -7
- data/app/views/catalog/_facets.html.erb +1 -1
- data/app/views/catalog/_folder_control.html.erb +1 -1
- data/app/views/catalog/_home_text.html.erb +1 -1
- data/app/views/catalog/_marc_view.html.erb +2 -2
- data/app/views/catalog/_refworks_form.html.erb +2 -2
- data/app/views/catalog/_results_pagination.html.erb +1 -1
- data/app/views/catalog/_search_form.html.erb +5 -5
- data/app/views/catalog/_show_tools.html.erb +6 -6
- data/app/views/catalog/_sms_form.html.erb +5 -5
- data/app/views/catalog/_sort_and_per_page.html.erb +6 -9
- data/app/views/catalog/index.atom.builder +3 -3
- data/app/views/catalog/index.html.erb +2 -2
- data/app/views/catalog/index.rss.builder +3 -3
- data/app/views/catalog/show.html.erb +2 -2
- data/app/views/feedback/complete.html.erb +2 -2
- data/app/views/feedback/show.html.erb +5 -5
- data/app/views/folder/_tools.html.erb +4 -4
- data/app/views/folder/index.html.erb +1 -1
- data/app/views/layouts/blacklight.html.erb +1 -1
- data/app/views/record_mailer/email_record.text.erb +2 -2
- data/app/views/record_mailer/sms_record.text.erb +1 -1
- data/app/views/saved_searches/index.html.erb +6 -6
- data/app/views/search_history/index.html.erb +6 -6
- data/config/locales/blacklight.en.yml +227 -0
- data/lib/blacklight.rb +0 -2
- data/lib/blacklight/catalog.rb +11 -13
- data/lib/blacklight/configurable.rb +0 -3
- data/lib/blacklight/configuration.rb +0 -42
- data/lib/blacklight/configuration/fields.rb +2 -0
- data/lib/blacklight/routes.rb +14 -2
- data/lib/blacklight/search_fields.rb +1 -1
- data/lib/blacklight/solr/document/email.rb +6 -6
- data/lib/blacklight/solr/document/sms.rb +4 -4
- data/lib/blacklight/solr_helper.rb +1 -3
- data/lib/generators/blacklight/blacklight_generator.rb +3 -0
- data/lib/railties/blacklight_cucumber.rake +12 -3
- data/lib/railties/blacklight_rspec.rake +9 -2
- data/test_support/alternate_controller.rb +4 -0
- data/test_support/bin/test.sh +13 -1
- data/test_support/features/bookmarks.feature +1 -1
- data/test_support/features/librarian_view.feature +2 -1
- data/test_support/features/record_view.feature +1 -0
- data/test_support/features/search.feature +1 -0
- data/test_support/features/step_definitions/general_steps.rb +4 -0
- data/test_support/features/support/env.rb +12 -1
- data/test_support/features/support/paths.rb +2 -1
- data/test_support/spec/helpers/blacklight_helper_spec.rb +8 -2
- data/test_support/spec/helpers/search_history_constraints_helper_spec.rb +6 -18
- data/test_support/spec/lib/search_fields_spec.rb +18 -25
- data/test_support/spec/models/record_mailer_spec.rb +5 -4
- data/test_support/spec/requests/alternate_controller_spec.rb +15 -0
- data/test_support/spec/spec_helper.rb +12 -0
- data/test_support/spec/views/catalog/_index_default.erb_spec.rb +6 -17
- data/test_support/spec/views/catalog/_show_default.erb_spec.rb +7 -17
- metadata +19 -8
- data/config/locales/kaminari.yml +0 -10
- data/lib/blacklight/global_configurable.rb +0 -46
- data/test_support/spec/lib/global_configurable_spec.rb +0 -98
|
@@ -24,9 +24,9 @@ class BookmarksController < ApplicationController
|
|
|
24
24
|
|
|
25
25
|
unless request.xhr?
|
|
26
26
|
if bookmark.save
|
|
27
|
-
flash[:notice] =
|
|
27
|
+
flash[:notice] = I18n.t('blacklight.bookmarks.add.success')
|
|
28
28
|
else
|
|
29
|
-
flash[:error] =
|
|
29
|
+
flash[:error] = I18n.t('blacklight.bookmarks.add.failure')
|
|
30
30
|
end
|
|
31
31
|
redirect_to :back
|
|
32
32
|
else
|
|
@@ -56,9 +56,9 @@ class BookmarksController < ApplicationController
|
|
|
56
56
|
success = false unless current_user.bookmarks.create(bookmark)
|
|
57
57
|
end
|
|
58
58
|
if @bookmarks.length > 0 && success
|
|
59
|
-
flash[:notice] =
|
|
59
|
+
flash[:notice] = I18n.t('blacklight.bookmarks.add.success', :count => @bookmarks.length)
|
|
60
60
|
elsif @bookmarks.length > 0
|
|
61
|
-
flash[:error] =
|
|
61
|
+
flash[:error] = I18n.t('blacklight.bookmarks.add.failure', :count => @bookmarks.length)
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
redirect_to :back
|
|
@@ -73,9 +73,9 @@ class BookmarksController < ApplicationController
|
|
|
73
73
|
|
|
74
74
|
unless request.xhr?
|
|
75
75
|
if success
|
|
76
|
-
flash[:notice] =
|
|
76
|
+
flash[:notice] = I18n.t('blacklight.bookmarks.remove.success')
|
|
77
77
|
else
|
|
78
|
-
flash[:error] =
|
|
78
|
+
flash[:error] = I18n.t('blacklight.bookmarks.remove.failure')
|
|
79
79
|
end
|
|
80
80
|
redirect_to :back
|
|
81
81
|
else
|
|
@@ -86,15 +86,15 @@ class BookmarksController < ApplicationController
|
|
|
86
86
|
|
|
87
87
|
def clear
|
|
88
88
|
if current_user.bookmarks.clear
|
|
89
|
-
flash[:notice] =
|
|
89
|
+
flash[:notice] = I18n.t('blacklight.bookmarks.clear.success')
|
|
90
90
|
else
|
|
91
|
-
flash[:error] =
|
|
91
|
+
flash[:error] = I18n.t('blacklight.bookmarks.clear.failure')
|
|
92
92
|
end
|
|
93
93
|
redirect_to :action => "index"
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
protected
|
|
97
97
|
def verify_user
|
|
98
|
-
flash[:notice] =
|
|
98
|
+
flash[:notice] = I18n.t('blacklight.bookmarks.need_login') and raise Blacklight::Exceptions::AccessDenied unless current_user
|
|
99
99
|
end
|
|
100
100
|
end
|
|
@@ -21,13 +21,13 @@ class FeedbackController < ApplicationController
|
|
|
21
21
|
# returns either an empty array or an array with error messages
|
|
22
22
|
def validate
|
|
23
23
|
unless params[:name] =~ /\w+/
|
|
24
|
-
@errors << '
|
|
24
|
+
@errors << I18n.t('blacklight.feedback.valid_name')
|
|
25
25
|
end
|
|
26
26
|
unless params[:email] =~ /\w+@\w+\.\w+/
|
|
27
|
-
@errors << '
|
|
27
|
+
@errors << I18n.t('blacklight.feedback.valid_email')
|
|
28
28
|
end
|
|
29
29
|
unless params[:message] =~ /\w+/
|
|
30
|
-
@errors << '
|
|
30
|
+
@errors << I18n.t('blacklight.feedback.need_message')
|
|
31
31
|
end
|
|
32
32
|
#unless simple_captcha_valid?
|
|
33
33
|
# @errors << 'Captcha did not match'
|
|
@@ -20,7 +20,7 @@ class FolderController < ApplicationController
|
|
|
20
20
|
# Rails 3 uses a one line notation for setting the flash notice.
|
|
21
21
|
# flash[:notice] = "#{params[:title] || "Item"} successfully added to Folder"
|
|
22
22
|
respond_to do |format|
|
|
23
|
-
format.html { redirect_to :back, :notice =>
|
|
23
|
+
format.html { redirect_to :back, :notice => I18n.t('blacklight.folder.add.success', :title => params[:title] || 'Item') }
|
|
24
24
|
format.js { render :json => session[:folder_document_ids] }
|
|
25
25
|
end
|
|
26
26
|
end
|
|
@@ -31,7 +31,7 @@ class FolderController < ApplicationController
|
|
|
31
31
|
|
|
32
32
|
respond_to do |format|
|
|
33
33
|
format.html do
|
|
34
|
-
flash[:notice] =
|
|
34
|
+
flash[:notice] = I18n.t('blacklight.folder.remove.success', :title => params[:title] || 'Item')
|
|
35
35
|
redirect_to :back
|
|
36
36
|
end
|
|
37
37
|
format.js do
|
|
@@ -43,7 +43,7 @@ class FolderController < ApplicationController
|
|
|
43
43
|
|
|
44
44
|
# get rid of the items in the folder
|
|
45
45
|
def clear
|
|
46
|
-
flash[:notice] =
|
|
46
|
+
flash[:notice] = I18n.t('blacklight.folder.clear.success')
|
|
47
47
|
session[:folder_document_ids] = []
|
|
48
48
|
respond_to do |format|
|
|
49
49
|
format.html { redirect_to :back }
|
|
@@ -13,9 +13,9 @@ class SavedSearchesController < ApplicationController
|
|
|
13
13
|
def save
|
|
14
14
|
current_user.searches << Search.find(params[:id])
|
|
15
15
|
if current_user.save
|
|
16
|
-
flash[:notice] =
|
|
16
|
+
flash[:notice] = I18n.t('blacklight.saved_searches.add.success')
|
|
17
17
|
else
|
|
18
|
-
flash[:error] =
|
|
18
|
+
flash[:error] = I18n.t('blacklight.saved_searches.add.failure')
|
|
19
19
|
end
|
|
20
20
|
redirect_to :back
|
|
21
21
|
end
|
|
@@ -28,9 +28,9 @@ class SavedSearchesController < ApplicationController
|
|
|
28
28
|
search.user_id = nil
|
|
29
29
|
search.save
|
|
30
30
|
|
|
31
|
-
flash[:notice] =
|
|
31
|
+
flash[:notice] =I18n.t('blacklight.saved_searches.remove.success')
|
|
32
32
|
else
|
|
33
|
-
flash[:error] =
|
|
33
|
+
flash[:error] = I18n.t('blacklight.saved_searches.remove.failure')
|
|
34
34
|
end
|
|
35
35
|
redirect_to :back
|
|
36
36
|
end
|
|
@@ -39,9 +39,9 @@ class SavedSearchesController < ApplicationController
|
|
|
39
39
|
# are in the session[:history]
|
|
40
40
|
def clear
|
|
41
41
|
if Search.update_all("user_id = NULL", "user_id = #{current_user.id}")
|
|
42
|
-
flash[:notice] =
|
|
42
|
+
flash[:notice] = I18n.t('blacklight.saved_searches.clear.success')
|
|
43
43
|
else
|
|
44
|
-
flash[:error] =
|
|
44
|
+
flash[:error] = I18n.t('blacklight.saved_searches.clear.failure')
|
|
45
45
|
end
|
|
46
46
|
redirect_to :action => "index"
|
|
47
47
|
end
|
|
@@ -49,6 +49,6 @@ class SavedSearchesController < ApplicationController
|
|
|
49
49
|
|
|
50
50
|
protected
|
|
51
51
|
def verify_user
|
|
52
|
-
flash[:notice] =
|
|
52
|
+
flash[:notice] = I18n.t('blacklight.saved_searches.need_login') and raise Blacklight::Exceptions::AccessDenied unless current_user
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -12,9 +12,9 @@ class SearchHistoryController < ApplicationController
|
|
|
12
12
|
#TODO we may want to remove unsaved (those without user_id) items from the database when removed from history
|
|
13
13
|
def clear
|
|
14
14
|
if session[:history].clear
|
|
15
|
-
flash[:notice] =
|
|
15
|
+
flash[:notice] = I18n.t('blacklight.search_history.clear.success')
|
|
16
16
|
else
|
|
17
|
-
flash[:error] =
|
|
17
|
+
flash[:error] = I18n.t('blacklight.search_history.clear.failure')
|
|
18
18
|
end
|
|
19
19
|
redirect_to :back
|
|
20
20
|
end
|
|
@@ -13,7 +13,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
|
13
13
|
def application_name
|
|
14
14
|
return Rails.application.config.application_name if Rails.application.config.respond_to? :application_name
|
|
15
15
|
|
|
16
|
-
'
|
|
16
|
+
t('blacklight.application_name')
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
# Provide the full, absolute url for an image
|
|
@@ -42,7 +42,7 @@ module Blacklight::BlacklightHelperBehavior
|
|
|
42
42
|
unless( options[:exclude].include?(format) ||
|
|
43
43
|
(options[:unique] && seen.include?(spec[:content_type]))
|
|
44
44
|
)
|
|
45
|
-
html << tag(:link, {:rel=>"alternate", :title=>format, :type => spec[:content_type], :href=>
|
|
45
|
+
html << tag(:link, {:rel=>"alternate", :title=>format, :type => spec[:content_type], :href=> polymorphic_url(document, :format => format)}) << "\n"
|
|
46
46
|
|
|
47
47
|
seen.add(spec[:content_type]) if options[:unique]
|
|
48
48
|
end
|
|
@@ -266,10 +266,6 @@ module Blacklight::BlacklightHelperBehavior
|
|
|
266
266
|
label ||= doc.id
|
|
267
267
|
end
|
|
268
268
|
|
|
269
|
-
|
|
270
|
-
def solr_document_path(*args); catalog_path(*args); end
|
|
271
|
-
def solr_document_url(*args); catalog_url(*args); end
|
|
272
|
-
|
|
273
269
|
# link_to_document(doc, :label=>'VIEW', :counter => 3)
|
|
274
270
|
# Use the catalog_path RESTful route to create a link to the show page for a specific item.
|
|
275
271
|
# catalog_path accepts a HashWithIndifferentAccess object. The solr query params are stored in the session,
|
|
@@ -282,11 +278,11 @@ module Blacklight::BlacklightHelperBehavior
|
|
|
282
278
|
|
|
283
279
|
# link_back_to_catalog(:label=>'Back to Search')
|
|
284
280
|
# Create a link back to the index screen, keeping the user's facet, query and paging choices intact by using session.
|
|
285
|
-
def link_back_to_catalog(opts={:label=>'
|
|
281
|
+
def link_back_to_catalog(opts={:label=>t('blacklight.back_to_search')})
|
|
286
282
|
query_params = session[:search] ? session[:search].dup : {}
|
|
287
283
|
query_params.delete :counter
|
|
288
284
|
query_params.delete :total
|
|
289
|
-
link_url =
|
|
285
|
+
link_url = url_for(query_params)
|
|
290
286
|
link_to opts[:label], link_url
|
|
291
287
|
end
|
|
292
288
|
|
|
@@ -327,12 +323,12 @@ module Blacklight::BlacklightHelperBehavior
|
|
|
327
323
|
|
|
328
324
|
def link_to_previous_document(previous_document)
|
|
329
325
|
return if previous_document == nil
|
|
330
|
-
link_to '
|
|
326
|
+
link_to raw(t('views.pagination.previous')), previous_document, :class => "previous", :'data-counter' => session[:search][:counter].to_i - 1
|
|
331
327
|
end
|
|
332
328
|
|
|
333
329
|
def link_to_next_document(next_document)
|
|
334
330
|
return if next_document == nil
|
|
335
|
-
link_to '
|
|
331
|
+
link_to raw(t('views.pagination.next')), next_document, :class => "next", :'data-counter' => session[:search][:counter].to_i + 1
|
|
336
332
|
end
|
|
337
333
|
|
|
338
334
|
# Use case, you want to render an html partial from an XML (say, atom)
|
|
@@ -39,17 +39,14 @@ module Blacklight::CatalogHelperBehavior
|
|
|
39
39
|
end_num = format_num(start + response.docs.length - 1)
|
|
40
40
|
total_num = format_num(total_hits)
|
|
41
41
|
|
|
42
|
+
# TODO: i18n the entry_name
|
|
42
43
|
entry_name = options[:entry_name] ||
|
|
43
|
-
(response.empty?? '
|
|
44
|
+
(response.empty?? t('blacklight.entry_name.default') : response.docs.first.class.name.underscore.sub('_', ' '))
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
when
|
|
48
|
-
|
|
49
|
-
else; "Displaying <b>all #{total_num}</b> #{entry_name.pluralize}".html_safe
|
|
50
|
-
end
|
|
51
|
-
else
|
|
52
|
-
"Displaying #{h(entry_name.pluralize)} <b>#{start_num} - #{end_num}</b> of <b>#{total_num}</b>".html_safe
|
|
46
|
+
case response.docs.length
|
|
47
|
+
when 0; t('blacklight.search.pagination_info.no_items_found', :entry_name => entry_name.pluralize ).html_safe
|
|
48
|
+
when 1; t('blacklight.search.pagination_info.single_item_found', :entry_name => entry_name).html_safe
|
|
49
|
+
else; t('blacklight.search.pagination_info.pages', :entry_name => entry_name.pluralize, :current_page => current_page, :num_pages => num_pages, :start_num => start_num, :end_num => end_num, :total_num => total_num, :count => num_pages).html_safe
|
|
53
50
|
end
|
|
54
51
|
end
|
|
55
52
|
|
|
@@ -59,7 +56,7 @@ module Blacklight::CatalogHelperBehavior
|
|
|
59
56
|
# Code should call this method rather than interrogating session directly,
|
|
60
57
|
# because implementation of where this data is stored/retrieved may change.
|
|
61
58
|
def item_page_entry_info
|
|
62
|
-
|
|
59
|
+
t('blacklight.search.entry_pagination_info.other', :current => format_num(session[:search][:counter]), :total => format_num(session[:search][:total]), :count => session[:search][:total].to_i).html_safe
|
|
63
60
|
end
|
|
64
61
|
|
|
65
62
|
# Look up search field user-displayable label
|
|
@@ -70,7 +67,7 @@ module Blacklight::CatalogHelperBehavior
|
|
|
70
67
|
|
|
71
68
|
# Export to Refworks URL, called in _show_tools
|
|
72
69
|
def refworks_export_url(document = @document)
|
|
73
|
-
"http://www.refworks.com/express/expressimport.asp?vendor=#{CGI.escape(application_name)}&filter=MARC%20Format&encoding=65001&url=#{CGI.escape(
|
|
70
|
+
"http://www.refworks.com/express/expressimport.asp?vendor=#{CGI.escape(application_name)}&filter=MARC%20Format&encoding=65001&url=#{CGI.escape(polymorphic_path(document, :format => 'refworks_marc_txt', :only_path => false))}"
|
|
74
71
|
end
|
|
75
72
|
|
|
76
73
|
def render_document_class(document = @document)
|
|
@@ -102,14 +102,14 @@ module Blacklight::FacetsHelperBehavior
|
|
|
102
102
|
# with class, and 'remove' button.
|
|
103
103
|
def render_selected_facet_value(facet_solr_field, item)
|
|
104
104
|
content_tag(:span, render_facet_value(facet_solr_field, item, :suppress_link => true), :class => "selected label") +
|
|
105
|
-
link_to(
|
|
105
|
+
link_to(t('blacklight.search.facets.selected.remove'), remove_facet_params(facet_solr_field, item.value, params), :class=>"remove")
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
# Renders a count value for facet limits. Can be over-ridden locally
|
|
109
109
|
# to change style, for instance not use parens. And can be called
|
|
110
110
|
# by plugins to get consistent display.
|
|
111
111
|
def render_facet_count(num)
|
|
112
|
-
content_tag("span",
|
|
112
|
+
content_tag("span", t('blacklight.search.facets.count', :number => num), :class => "count")
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
# adds the value and/or field to params[:f]
|
|
@@ -32,7 +32,7 @@ module Blacklight::SearchHistoryConstraintsHelperBehavior
|
|
|
32
32
|
render_search_to_s_element(blacklight_config.facet_fields[facet_field].label,
|
|
33
33
|
value_list.collect do |value|
|
|
34
34
|
render_filter_value(value)
|
|
35
|
-
end.join(content_tag(:span, 'and', :class =>'label')).html_safe
|
|
35
|
+
end.join(content_tag(:span, t('blacklight.and'), :class =>'label')).html_safe
|
|
36
36
|
)
|
|
37
37
|
end.join(" \n ").html_safe
|
|
38
38
|
end
|
|
@@ -46,7 +46,7 @@ module Blacklight::SearchHistoryConstraintsHelperBehavior
|
|
|
46
46
|
|
|
47
47
|
def render_filter_name name
|
|
48
48
|
return "".html_safe if name.blank?
|
|
49
|
-
content_tag(:span,
|
|
49
|
+
content_tag(:span, t('blacklight.search.filters.label', :label => name), :class => 'filterName')
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
def render_filter_value value
|
data/app/models/bookmark.rb
CHANGED
data/app/models/record_mailer.rb
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
# Only works for documents with a #to_marc right now.
|
|
3
3
|
class RecordMailer < ActionMailer::Base
|
|
4
|
-
|
|
5
|
-
def email_record(documents, details, from_host, url_gen_params)
|
|
4
|
+
def email_record(documents, details, url_gen_params)
|
|
6
5
|
#raise ArgumentError.new("RecordMailer#email_record only works with documents with a #to_marc") unless document.respond_to?(:to_marc)
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
subject = "Item Record: #{documents.first.to_semantic_values[:title] rescue 'N/A'}"
|
|
10
|
-
else
|
|
11
|
-
subject = "Item records"
|
|
12
|
-
end
|
|
7
|
+
subject = I18n.t('blacklight.email.text.subject', :count => documents.length, :title => (documents.first.to_semantic_values[:title] rescue 'N/A') )
|
|
13
8
|
|
|
14
9
|
@documents = documents
|
|
15
10
|
@message = details[:message]
|
|
16
11
|
@url_gen_params = url_gen_params
|
|
17
12
|
|
|
18
|
-
mail(:to => details[:to], :
|
|
13
|
+
mail(:to => details[:to], :subject => subject)
|
|
19
14
|
end
|
|
20
15
|
|
|
21
|
-
def sms_record(documents, details,
|
|
16
|
+
def sms_record(documents, details, url_gen_params)
|
|
22
17
|
if sms_mapping[details[:carrier]]
|
|
23
18
|
to = "#{details[:to]}@#{sms_mapping[details[:carrier]]}"
|
|
24
19
|
end
|
|
25
20
|
@documents = documents
|
|
26
|
-
@host = from_host
|
|
27
21
|
@url_gen_params = url_gen_params
|
|
28
|
-
mail(:to => to, :
|
|
22
|
+
mail(:to => to, :subject => "")
|
|
29
23
|
end
|
|
30
24
|
|
|
31
25
|
protected
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<% if has_user_authentication_provider? %>
|
|
2
2
|
<% if current_user%>
|
|
3
|
-
<%= link_to
|
|
3
|
+
<%= link_to t('blacklight.header_links.logout'), destroy_user_session_path %> [<%= link_to current_user, edit_user_registration_path %>]
|
|
4
4
|
|
|
|
5
|
-
<%= link_to '
|
|
5
|
+
<%= link_to t('blacklight.header_links.bookmarks'), bookmarks_path %>
|
|
6
6
|
|
|
|
7
|
-
<%= link_to
|
|
7
|
+
<%= link_to t('blacklight.header_links.saved_searches'), saved_searches_path %>
|
|
8
8
|
<% else %>
|
|
9
|
-
<%= link_to '
|
|
9
|
+
<%= link_to t('blacklight.header_links.login'), new_user_session_path %>
|
|
10
10
|
<% end %>
|
|
11
11
|
|
|
|
12
12
|
<% end %>
|
|
13
|
-
<%= link_to
|
|
13
|
+
<%= link_to t('blacklight.header_links.selected_items'), folder_index_path %> (<span id="folder_number"><%= "#{session[:folder_document_ids] ? session[:folder_document_ids].length : 0}" %></span>)
|
|
14
14
|
|
|
|
15
|
-
<%= link_to
|
|
15
|
+
<%= link_to t('blacklight.header_links.search_history'), search_history_path %>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
<h1
|
|
1
|
+
<h1><%= t('blacklight.bookmarks.title') %></h1>
|
|
2
2
|
|
|
3
3
|
<%- if current_user.blank? -%>
|
|
4
4
|
|
|
5
|
-
<h2
|
|
5
|
+
<h2><%= t('blacklight.bookmarks.need_login') %></h2>
|
|
6
6
|
|
|
7
7
|
<%- elsif @bookmarks.blank? -%>
|
|
8
8
|
|
|
9
|
-
<h2
|
|
9
|
+
<h2><%= t('blacklight.bookmarks.no_bookmarks') %></h2>
|
|
10
10
|
|
|
11
11
|
<%- else -%>
|
|
12
12
|
|
|
13
13
|
<%= paginate @bookmarks, :theme => 'blacklight' %>
|
|
14
14
|
<div id="userBookmarks">
|
|
15
15
|
<p>
|
|
16
|
-
|
|
16
|
+
<%= link_to t('blacklight.bookmarks.clear.action_title'), clear_bookmarks_path, :method => :delete, :data => { :confirm => t('blacklight.bookmarks.clear.action_confirm') } %>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
<h2
|
|
19
|
+
<h2><%= t('blacklight.bookmarks.list_title') %></h2>
|
|
20
20
|
|
|
21
21
|
<table class="zebra">
|
|
22
22
|
<% @bookmarks.each do |bm| %>
|
|
23
23
|
<tr>
|
|
24
|
-
<td><%= link_to h(bm.title),
|
|
25
|
-
<td><%= button_to '
|
|
26
|
-
:method => :delete, :confirm => '
|
|
24
|
+
<td><%= link_to h(bm.title), polymorphic_path(bm.document) %></td>
|
|
25
|
+
<td><%= button_to t('blacklight.bookmarks.delete'), {:controller => "bookmarks", :action => "destroy", :id => CGI.escape(bm.document_id)},
|
|
26
|
+
:method => :delete, :confirm => t('blacklight.bookmarks.remove.action_confirm') %></td>
|
|
27
27
|
</tr>
|
|
28
28
|
<% end %>
|
|
29
29
|
</table>
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
<%= form_tag( bookmark_path( document ), :method => :put, :class => "bookmark_toggle", "data-doc-id" => document.id, :title=> document[document_show_link_field] ) do %>
|
|
11
11
|
<%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %>
|
|
12
|
-
<%= submit_tag(
|
|
12
|
+
<%= submit_tag(t('blacklight.bookmarks.add.button'), :id => "bookmark_toggle_#{document.id.to_s.parameterize}", :class => "bookmark_add") %>
|
|
13
13
|
<% end %>
|
|
14
14
|
|
|
15
15
|
<% else %>
|
|
16
16
|
|
|
17
17
|
<%= form_tag( bookmark_path( document ), :method => :delete, :class => "bookmark_toggle", "data-doc-id" => document.id, :title=> document[document_show_link_field]) do %>
|
|
18
18
|
<%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %>
|
|
19
|
-
<%= submit_tag(
|
|
19
|
+
<%= submit_tag(t('blacklight.bookmarks.remove.button'), :id => "bookmark_toggle_#{document.id.to_s.parameterize}", :class => "bookmark_remove") %>
|
|
20
20
|
<% end %>
|
|
21
21
|
|
|
22
22
|
<% end %>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<%= form_tag
|
|
1
|
+
<%= form_tag bookmarks_url, :name => "bookmarks" do %>
|
|
2
2
|
<% documents.each_with_index do |document, index| %>
|
|
3
3
|
<%= hidden_field_tag "bookmarks[#{index}][document_id]", document.get(:id)%>
|
|
4
4
|
<%= hidden_field_tag "bookmarks[#{index}][title]", h(document[document_show_link_field])%>
|
|
5
5
|
<% end %>
|
|
6
|
-
<%= link_to_function
|
|
7
|
-
<%= submit_tag '
|
|
6
|
+
<%= link_to_function t('blacklight.bookmarks.collection.add.button'), "document.bookmarks.submit()" %>
|
|
7
|
+
<%= submit_tag t('blacklight.bookmarks.collection.add.button'), :class => 'hide' %>
|
|
8
8
|
<% end %>
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
<h1><%= citation_title(document) %></h1>
|
|
4
4
|
|
|
5
5
|
<% if document.respond_to?(:export_as_mla_citation_txt) %>
|
|
6
|
-
<h4
|
|
6
|
+
<h4><%= t('blacklight.citation.mla') %></h4>
|
|
7
7
|
<%= document.send(:export_as_mla_citation_txt).html_safe %><br/><br/>
|
|
8
8
|
<% end %>
|
|
9
9
|
|
|
10
10
|
<% if document.respond_to?(:export_as_apa_citation_txt) %>
|
|
11
|
-
<h4
|
|
11
|
+
<h4><%= t('blacklight.citation.apa') %></h4>
|
|
12
12
|
<%= document.send(:export_as_apa_citation_txt).html_safe %><br/><br/>
|
|
13
13
|
<% end %>
|
|
14
14
|
|
|
15
15
|
<%- if document.respond_to?(:export_as_chicago_citation_txt) -%>
|
|
16
|
-
<h4
|
|
16
|
+
<h4><%= t('blacklight.citation.chicago') %></h4>
|
|
17
17
|
<%= document.send(:export_as_chicago_citation_txt).html_safe %>
|
|
18
18
|
<%- end -%>
|
|
19
19
|
|