blacklight 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/VERSION +1 -1
- data/app/controllers/catalog_controller.rb +6 -0
- data/app/helpers/blacklight/blacklight_helper_behavior.rb +416 -0
- data/app/helpers/blacklight/catalog_helper_behavior.rb +87 -0
- data/app/helpers/blacklight/facets_helper_behavior.rb +114 -0
- data/app/helpers/{hash_as_hidden_fields.rb → blacklight/hash_as_hidden_fields_helper_behavior.rb} +1 -1
- data/app/helpers/blacklight/html_head_helper_behavior.rb +103 -0
- data/app/helpers/blacklight/render_constraints_helper_behavior.rb +121 -0
- data/app/helpers/blacklight_helper.rb +1 -395
- data/app/helpers/catalog_helper.rb +1 -85
- data/app/helpers/facets_helper.rb +1 -112
- data/app/helpers/hash_as_hidden_fields_helper.rb +3 -0
- data/app/helpers/html_head_helper.rb +1 -101
- data/app/helpers/render_constraints_helper.rb +1 -119
- data/app/views/catalog/{_index_partials/_default.erb → _index_default.html.erb} +0 -0
- data/app/views/catalog/{_show_partials/_default.html.erb → _show_default.html.erb} +0 -0
- data/lib/blacklight/solr/document/marc_export.rb +2 -6
- data/test_support/spec/helpers/hash_as_hidden_fields_spec.rb +2 -2
- data/test_support/spec/lib/marc_export_spec.rb +1 -1
- data/test_support/spec/views/catalog/{_index_partials/_default.erb_spec.rb → _index_default.erb_spec.rb} +2 -2
- data/test_support/spec/views/catalog/{_show_partials/_default.html.erb_spec.rb → _show_default.erb_spec.rb} +2 -2
- metadata +31 -31
- data/app/helpers/bookmarks_helper.rb +0 -4
- data/app/helpers/feedback_helper.rb +0 -3
- data/app/helpers/saved_searches_helper.rb +0 -3
- data/app/helpers/search_history_helper.rb +0 -3
- data/test_support/spec/helpers/search_history_helper_spec.rb +0 -12
@@ -1,87 +1,3 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
1
|
module CatalogHelper
|
3
|
-
|
4
|
-
# Pass in an RSolr::Response (or duck-typed similar) object,
|
5
|
-
# it translates to a Kaminari-paginatable
|
6
|
-
# object, with the keys Kaminari views expect.
|
7
|
-
def paginate_params(response)
|
8
|
-
per_page = response.rows
|
9
|
-
per_page = 1 if per_page < 1
|
10
|
-
current_page = (response.start / per_page).ceil + 1
|
11
|
-
num_pages = (response.total / per_page.to_f).ceil
|
12
|
-
Struct.new(:current_page, :num_pages, :limit_value).new(current_page, num_pages, per_page)
|
13
|
-
end
|
14
|
-
|
15
|
-
# Equivalent to kaminari "paginate", but takes an RSolr::Response as first argument.
|
16
|
-
# Will convert it to something kaminari can deal with (using #paginate_params), and
|
17
|
-
# then call kaminari paginate with that. Other arguments (options and block) same as
|
18
|
-
# kaminari paginate, passed on through.
|
19
|
-
# will output HTML pagination controls.
|
20
|
-
def paginate_rsolr_response(response, options = {}, &block)
|
21
|
-
paginate paginate_params(response), options, &block
|
22
|
-
end
|
23
|
-
|
24
|
-
#
|
25
|
-
# shortcut for built-in Rails helper, "number_with_delimiter"
|
26
|
-
#
|
27
|
-
def format_num(num); number_with_delimiter(num) end
|
28
|
-
|
29
|
-
#
|
30
|
-
# Pass in an RSolr::Response. Displays the "showing X through Y of N" message.
|
31
|
-
def render_pagination_info(response, options = {})
|
32
|
-
start = response.start + 1
|
33
|
-
per_page = response.rows
|
34
|
-
current_page = (response.start / per_page).ceil + 1
|
35
|
-
num_pages = (response.total / per_page.to_f).ceil
|
36
|
-
total_hits = response.total
|
37
|
-
|
38
|
-
start_num = format_num(start)
|
39
|
-
end_num = format_num(start + response.docs.length - 1)
|
40
|
-
total_num = format_num(total_hits)
|
41
|
-
|
42
|
-
entry_name = options[:entry_name] ||
|
43
|
-
(response.empty?? 'entry' : response.docs.first.class.name.underscore.sub('_', ' '))
|
44
|
-
|
45
|
-
if num_pages < 2
|
46
|
-
case response.docs.length
|
47
|
-
when 0; "No #{h(entry_name.pluralize)} found".html_safe
|
48
|
-
when 1; "Displaying <b>1</b> #{h(entry_name)}".html_safe
|
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
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
# Like #render_pagination_info above, but for an individual
|
57
|
-
# item show page. Displays "showing X of Y items" message. Actually takes
|
58
|
-
# data from session though (not a great design).
|
59
|
-
# Code should call this method rather than interrogating session directly,
|
60
|
-
# because implementation of where this data is stored/retrieved may change.
|
61
|
-
def item_page_entry_info
|
62
|
-
"Showing item <b>#{session[:search][:counter].to_i} of #{format_num(session[:search][:total])}</b> from your search.".html_safe
|
63
|
-
end
|
64
|
-
|
65
|
-
# Look up search field user-displayable label
|
66
|
-
# based on params[:qt] and configuration.
|
67
|
-
def search_field_label(params)
|
68
|
-
h( Blacklight.label_for_search_field(params[:search_field]) )
|
69
|
-
end
|
70
|
-
|
71
|
-
# Export to Refworks URL, called in _show_tools
|
72
|
-
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(catalog_path(document.id, :format => 'refworks_marc_txt', :only_path => false))}"
|
74
|
-
end
|
75
|
-
|
76
|
-
def render_document_class(document = @document)
|
77
|
-
'blacklight-' + document.get(Blacklight.config[:index][:record_display_type]).parameterize rescue nil
|
78
|
-
end
|
79
|
-
|
80
|
-
def render_document_sidebar_partial(document = @document)
|
81
|
-
render :partial => 'show_sidebar'
|
82
|
-
end
|
83
|
-
|
84
|
-
def has_search_parameters?
|
85
|
-
!params[:q].blank? or !params[:f].blank? or !params[:search_field].blank?
|
86
|
-
end
|
2
|
+
include Blacklight::CatalogHelperBehavior
|
87
3
|
end
|
@@ -1,114 +1,3 @@
|
|
1
1
|
module FacetsHelper
|
2
|
-
|
3
|
-
#
|
4
|
-
# Blacklight.config based helpers ->
|
5
|
-
#
|
6
|
-
|
7
|
-
# used in the catalog/_facets partial
|
8
|
-
def facet_field_labels
|
9
|
-
Blacklight.config[:facet][:labels]
|
10
|
-
end
|
11
|
-
|
12
|
-
# used in the catalog/_facets partial
|
13
|
-
def facet_field_names
|
14
|
-
Blacklight.config[:facet][:field_names]
|
15
|
-
end
|
16
|
-
|
17
|
-
# used in the catalog/_facets partial and elsewhere
|
18
|
-
# Renders a single section for facet limit with a specified
|
19
|
-
# solr field used for faceting. Can be over-ridden for custom
|
20
|
-
# display on a per-facet basis.
|
21
|
-
def render_facet_limit(solr_field)
|
22
|
-
render( :partial => "catalog/facet_limit", :locals => {:solr_field =>solr_field })
|
23
|
-
end
|
24
|
-
|
25
|
-
#
|
26
|
-
# facet param helpers ->
|
27
|
-
#
|
28
|
-
|
29
|
-
# Standard display of a facet value in a list. Used in both _facets sidebar
|
30
|
-
# partial and catalog/facet expanded list. Will output facet value name as
|
31
|
-
# a link to add that to your restrictions, with count in parens.
|
32
|
-
# first arg item is a facet value item from rsolr-ext.
|
33
|
-
# options consist of:
|
34
|
-
# :suppress_link => true # do not make it a link, used for an already selected value for instance
|
35
|
-
def render_facet_value(facet_solr_field, item, options ={})
|
36
|
-
(link_to_unless(options[:suppress_link], item.value, add_facet_params_and_redirect(facet_solr_field, item.value), :class=>"facet_select label") + " " + render_facet_count(item.hits)).html_safe
|
37
|
-
end
|
38
|
-
|
39
|
-
# Standard display of a SELECTED facet value, no link, special span
|
40
|
-
# with class, and 'remove' button.
|
41
|
-
def render_selected_facet_value(facet_solr_field, item)
|
42
|
-
content_tag(:span, render_facet_value(facet_solr_field, item, :suppress_link => true), :class => "selected label") +
|
43
|
-
link_to("[remove]", remove_facet_params(facet_solr_field, item.value, params), :class=>"remove")
|
44
|
-
end
|
45
|
-
|
46
|
-
# Renders a count value for facet limits. Can be over-ridden locally
|
47
|
-
# to change style, for instance not use parens. And can be called
|
48
|
-
# by plugins to get consistent display.
|
49
|
-
def render_facet_count(num)
|
50
|
-
content_tag("span", "(" + format_num(num) + ")", :class => "count")
|
51
|
-
end
|
52
|
-
|
53
|
-
# adds the value and/or field to params[:f]
|
54
|
-
# Does NOT remove request keys and otherwise ensure that the hash
|
55
|
-
# is suitable for a redirect. See
|
56
|
-
# add_facet_params_and_redirect
|
57
|
-
def add_facet_params(field, value)
|
58
|
-
p = params.dup
|
59
|
-
p[:f] = (p[:f] || {}).dup # the command above is not deep in rails3, !@#$!@#$
|
60
|
-
p[:f][field] = (p[:f][field] || []).dup
|
61
|
-
p[:f][field].push(value)
|
62
|
-
p
|
63
|
-
end
|
64
|
-
|
65
|
-
# Used in catalog/facet action, facets.rb view, for a click
|
66
|
-
# on a facet value. Add on the facet params to existing
|
67
|
-
# search constraints. Remove any paginator-specific request
|
68
|
-
# params, or other request params that should be removed
|
69
|
-
# for a 'fresh' display.
|
70
|
-
# Change the action to 'index' to send them back to
|
71
|
-
# catalog/index with their new facet choice.
|
72
|
-
def add_facet_params_and_redirect(field, value)
|
73
|
-
new_params = add_facet_params(field, value)
|
74
|
-
|
75
|
-
# Delete page, if needed.
|
76
|
-
new_params.delete(:page)
|
77
|
-
|
78
|
-
# Delete any request params from facet-specific action, needed
|
79
|
-
# to redir to index action properly.
|
80
|
-
Blacklight::Solr::FacetPaginator.request_keys.values.each do |paginator_key|
|
81
|
-
new_params.delete(paginator_key)
|
82
|
-
end
|
83
|
-
new_params.delete(:id)
|
84
|
-
|
85
|
-
# Force action to be index.
|
86
|
-
new_params[:action] = "index"
|
87
|
-
new_params
|
88
|
-
end
|
89
|
-
# copies the current params (or whatever is passed in as the 3rd arg)
|
90
|
-
# removes the field value from params[:f]
|
91
|
-
# removes the field if there are no more values in params[:f][field]
|
92
|
-
# removes additional params (page, id, etc..)
|
93
|
-
def remove_facet_params(field, value, source_params=params)
|
94
|
-
p = source_params.dup
|
95
|
-
# need to dup the facet values too,
|
96
|
-
# if the values aren't dup'd, then the values
|
97
|
-
# from the session will get remove in the show view...
|
98
|
-
p[:f] = (p[:f] || {}).dup
|
99
|
-
p[:f][field] = (p[:f][field] || []).dup
|
100
|
-
p.delete :page
|
101
|
-
p.delete :id
|
102
|
-
p.delete :counter
|
103
|
-
p.delete :commit
|
104
|
-
p[:f][field] = p[:f][field] - [value]
|
105
|
-
p[:f].delete(field) if p[:f][field].size == 0
|
106
|
-
p
|
107
|
-
end
|
108
|
-
|
109
|
-
# true or false, depending on whether the field and value is in params[:f]
|
110
|
-
def facet_in_params?(field, value)
|
111
|
-
params[:f] and params[:f][field] and params[:f][field].include?(value)
|
112
|
-
end
|
113
|
-
|
2
|
+
include Blacklight::FacetsHelperBehavior
|
114
3
|
end
|
@@ -1,103 +1,3 @@
|
|
1
1
|
module HtmlHeadHelper
|
2
|
-
|
3
|
-
# This method should be included in any Blacklight layout, including
|
4
|
-
# custom ones. It will output results of #render_js_includes,
|
5
|
-
# #render_stylesheet_includes, all the content of
|
6
|
-
# current_controller#extra_head_content as well as any content passed
|
7
|
-
# in any content_for(:head) blocks.
|
8
|
-
#
|
9
|
-
# Uses controller methods #extra_head_content, #javascript_includes,
|
10
|
-
# and #stylesheet_links to find content. Tolerates it if those
|
11
|
-
# methods don't exist, silently skipping.
|
12
|
-
#
|
13
|
-
# By a layout outputting this in html HEAD, it provides an easy way for
|
14
|
-
# local config or extra plugins to add HEAD content.
|
15
|
-
#
|
16
|
-
# Add your own css or remove the defaults by simply editing
|
17
|
-
# controller.stylesheet_links, controller.javascript_includes,
|
18
|
-
# or controller.extra_head_content.
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
# in an initializer or other startup file (plugin init.rb?):
|
23
|
-
#
|
24
|
-
# == Apply to all actions in all controllers:
|
25
|
-
#
|
26
|
-
# ApplicationController.before_filter do |controller|
|
27
|
-
# # remove default jquery-ui theme.
|
28
|
-
# controller.stylesheet_links.each do |args|
|
29
|
-
# args.delete_if {|a| a =~ /^|\/jquery-ui-[\d.]+\.custom\.css$/ }
|
30
|
-
# end
|
31
|
-
#
|
32
|
-
# # add in a different jquery-ui theme, or any other css or what have you
|
33
|
-
# controller.stylesheet_links << 'my_css.css'
|
34
|
-
#
|
35
|
-
# controller.javascript_includes << "my_local_behaviors.js"
|
36
|
-
#
|
37
|
-
# controller.extra_head_content << '<link rel="something" href="something">'
|
38
|
-
# end
|
39
|
-
#
|
40
|
-
# == Apply to a particular action in a particular controller:
|
41
|
-
#
|
42
|
-
# CatalogController.before_filter :only => :show |controller|
|
43
|
-
# controller.extra_head_content << '<link rel="something" href="something">'
|
44
|
-
# end
|
45
|
-
#
|
46
|
-
# == Or in a view file that wants to add certain header content? no problem:
|
47
|
-
#
|
48
|
-
# <% stylesheet_links << "mystylesheet.css" %>
|
49
|
-
# <% javascript_includes << "my_js.js" %>
|
50
|
-
# <% extra_head_content << capture do %>
|
51
|
-
# <%= tag :link, { :href => some_method_for_something, :rel => "alternate" } %>
|
52
|
-
# <% end %>
|
53
|
-
#
|
54
|
-
# == Full power of javascript_include_tag and stylesheet_link_tag
|
55
|
-
# Note that the elements added to stylesheet_links and javascript_links
|
56
|
-
# are arguments to Rails javascript_include_tag and stylesheet_link_tag
|
57
|
-
# respectively, you can pass complex arguments. eg:
|
58
|
-
#
|
59
|
-
# stylesheet_links << ["stylesheet1.css", "stylesheet2.css", {:cache => "mykey"}]
|
60
|
-
# javascript_includes << ["myjavascript.js", {:plugin => :myplugin} ]
|
61
|
-
def render_head_content
|
62
|
-
render_stylesheet_includes +
|
63
|
-
render_js_includes +
|
64
|
-
render_extra_head_content +
|
65
|
-
content_for(:head)
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
# Assumes controller has a #stylesheet_link_tag method, array with
|
70
|
-
# each element being a set of arguments for stylesheet_link_tag
|
71
|
-
# See #render_head_content for instructions on local code or plugins
|
72
|
-
# adding stylesheets.
|
73
|
-
def render_stylesheet_includes
|
74
|
-
return "".html_safe unless respond_to?(:stylesheet_links)
|
75
|
-
|
76
|
-
stylesheet_links.uniq.collect do |args|
|
77
|
-
stylesheet_link_tag(*args)
|
78
|
-
end.join("\n").html_safe
|
79
|
-
end
|
80
|
-
|
81
|
-
|
82
|
-
##
|
83
|
-
# Assumes controller has a #js_includes method, array with each
|
84
|
-
# element being a set of arguments for javsascript_include_tag.
|
85
|
-
# See #render_head_content for instructions on local code or plugins
|
86
|
-
# adding js files.
|
87
|
-
def render_js_includes
|
88
|
-
return "".html_safe unless respond_to?(:javascript_includes)
|
89
|
-
|
90
|
-
javascript_includes.uniq.collect do |args|
|
91
|
-
javascript_include_tag(*args)
|
92
|
-
end.join("\n").html_safe
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# Assumes controller has a #extra_head_content method
|
97
|
-
#
|
98
|
-
def render_extra_head_content
|
99
|
-
return "".html_safe unless respond_to?(:extra_head_content)
|
100
|
-
|
101
|
-
extra_head_content.join("\n").html_safe
|
102
|
-
end
|
2
|
+
include Blacklight::HtmlHeadHelperBehavior
|
103
3
|
end
|
@@ -1,121 +1,3 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
# All methods in here are 'api' that may be over-ridden by plugins and local
|
3
|
-
# code, so method signatures and semantics should not be changed casually.
|
4
|
-
# implementations can be of course.
|
5
|
-
#
|
6
|
-
# Includes methods for rendering contraints graphically on the
|
7
|
-
# search results page (render_constraints(_*)), and also
|
8
|
-
# for rendering more textually on Search History page
|
9
|
-
# (render_search_to_s(_*))
|
10
1
|
module RenderConstraintsHelper
|
11
|
-
|
12
|
-
# Render actual constraints, not including header or footer
|
13
|
-
# info.
|
14
|
-
def render_constraints(localized_params = params)
|
15
|
-
(render_constraints_query(localized_params) + render_constraints_filters(localized_params)).html_safe
|
16
|
-
end
|
17
|
-
|
18
|
-
def render_constraints_query(localized_params = params)
|
19
|
-
# So simple don't need a view template, we can just do it here.
|
20
|
-
if (!localized_params[:q].blank?)
|
21
|
-
label =
|
22
|
-
if (localized_params[:search_field] == Blacklight.default_search_field[:key] or localized_params[:search_field].blank? )
|
23
|
-
nil
|
24
|
-
else
|
25
|
-
Blacklight.label_for_search_field(localized_params[:search_field])
|
26
|
-
end
|
27
|
-
|
28
|
-
render_constraint_element(label,
|
29
|
-
localized_params[:q],
|
30
|
-
:classes => ["query"],
|
31
|
-
:remove => catalog_index_path(localized_params.merge(:q=>nil, :action=>'index')))
|
32
|
-
else
|
33
|
-
"".html_safe
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def render_constraints_filters(localized_params = params)
|
38
|
-
return "".html_safe unless localized_params[:f]
|
39
|
-
content = ""
|
40
|
-
localized_params[:f].each_pair do |facet,values|
|
41
|
-
values.each do |val|
|
42
|
-
content << render_constraint_element( facet_field_labels[facet],
|
43
|
-
val,
|
44
|
-
:remove => catalog_index_path(remove_facet_params(facet, val, localized_params)),
|
45
|
-
:classes => ["filter", "filter-" + facet.parameterize]
|
46
|
-
) + "\n"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
return content.html_safe
|
51
|
-
end
|
52
|
-
|
53
|
-
# Render a label/value constraint on the screen. Can be called
|
54
|
-
# by plugins and such to get application-defined rendering.
|
55
|
-
#
|
56
|
-
# Can be over-ridden locally to render differently if desired,
|
57
|
-
# although in most cases you can just change CSS instead.
|
58
|
-
#
|
59
|
-
# Can pass in nil label if desired.
|
60
|
-
#
|
61
|
-
# options:
|
62
|
-
# [:remove]
|
63
|
-
# url to execute for a 'remove' action
|
64
|
-
# [:classes]
|
65
|
-
# can be an array of classes to add to container span for constraint.
|
66
|
-
# [:escape_label]
|
67
|
-
# default true, HTML escape.
|
68
|
-
# [:escape_value]
|
69
|
-
# default true, HTML escape.
|
70
|
-
def render_constraint_element(label, value, options = {})
|
71
|
-
render(:partial => "catalog/constraints_element", :locals => {:label => label, :value => value, :options => options})
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
|
-
# Simpler textual version of constraints, used on Search History page.
|
76
|
-
# Theoretically can may be DRY'd up with results page render_constraints,
|
77
|
-
# maybe even using the very same HTML with different CSS?
|
78
|
-
# But too tricky for now, too many changes to existing CSS. TODO.
|
79
|
-
def render_search_to_s(params)
|
80
|
-
render_search_to_s_q(params) +
|
81
|
-
render_search_to_s_filters(params)
|
82
|
-
end
|
83
|
-
|
84
|
-
def render_search_to_s_q(params)
|
85
|
-
return "".html_safe if params[:q].blank?
|
86
|
-
|
87
|
-
label = (params[:search_field] == Blacklight.default_search_field[:key]) ?
|
88
|
-
nil :
|
89
|
-
Blacklight.label_for_search_field(params[:search_field])
|
90
|
-
|
91
|
-
render_search_to_s_element(label , params[:q] )
|
92
|
-
end
|
93
|
-
def render_search_to_s_filters(params)
|
94
|
-
return "".html_safe unless params[:f]
|
95
|
-
|
96
|
-
params[:f].collect do |facet_field, value_list|
|
97
|
-
render_search_to_s_element(Blacklight.config[:facet][:labels][facet_field],
|
98
|
-
value_list.collect do |value|
|
99
|
-
render_filter_value(value)
|
100
|
-
end.join(content_tag(:span, 'and', :class =>'label')).html_safe
|
101
|
-
)
|
102
|
-
end.join(" \n ").html_safe
|
103
|
-
end
|
104
|
-
|
105
|
-
# value can be Array, in which case elements are joined with
|
106
|
-
# 'and'. Pass in option :escape_value => false to pass in pre-rendered
|
107
|
-
# html for value. key with escape_key if needed.
|
108
|
-
def render_search_to_s_element(key, value, options = {})
|
109
|
-
content_tag(:span, render_filter_name(key) + render_filter_value(value), :class => 'constraint')
|
110
|
-
end
|
111
|
-
|
112
|
-
def render_filter_name name
|
113
|
-
return "".html_safe if name.blank?
|
114
|
-
content_tag(:span, h(name) + ":", :class => 'filterName')
|
115
|
-
end
|
116
|
-
|
117
|
-
def render_filter_value value
|
118
|
-
content_tag(:span, h(value), :class => 'filterValue')
|
119
|
-
end
|
120
|
-
|
2
|
+
include Blacklight::RenderConstraintsHelperBehavior
|
121
3
|
end
|
File without changes
|
File without changes
|
@@ -165,13 +165,9 @@ module Blacklight::Solr::Document::MarcExport
|
|
165
165
|
}
|
166
166
|
marc_obj = to_marc
|
167
167
|
|
168
|
-
# TODO. This
|
169
|
-
# but it wasn't actually clear that :display_type would
|
170
|
-
# be used this way. This should be rewritten to guess
|
168
|
+
# TODO. This should be rewritten to guess
|
171
169
|
# from actual Marc instead, probably.
|
172
|
-
format_str =
|
173
|
-
format_str = format_str[0] if format_str.kind_of?(Array)
|
174
|
-
format_str = format_str.titlecase
|
170
|
+
format_str = 'Generic'
|
175
171
|
|
176
172
|
text = ''
|
177
173
|
text << "%0 #{ format_str }\n"
|