umlaut 3.1.0.pre2 → 3.1.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.
- checksums.yaml +8 -8
- data/app/assets/javascripts/umlaut/expand_contract_toggle.js +5 -3
- data/app/assets/javascripts/umlaut/load_permalink.js +4 -4
- data/app/assets/javascripts/umlaut_ui.js +33 -4
- data/app/assets/stylesheets/umlaut/_expand_contract.scss +10 -0
- data/app/assets/stylesheets/umlaut/_layout.scss +1 -0
- data/app/assets/stylesheets/umlaut/_misc.scss +12 -2
- data/app/assets/stylesheets/umlaut/_resolve.scss +12 -7
- data/app/assets/stylesheets/umlaut.css.scss +3 -0
- data/app/controllers/umlaut/error_handling.rb +10 -4
- data/app/helpers/umlaut/footer_helper.rb +0 -4
- data/app/helpers/umlaut/helper.rb +5 -3
- data/app/mixin_logic/umlaut_http.rb +4 -1
- data/app/models/referent.rb +2 -2
- data/app/models/request.rb +31 -11
- data/app/models/service_wave.rb +5 -17
- data/app/service_adaptors/blacklight.rb +13 -4
- data/app/service_adaptors/internet_archive.rb +2 -2
- data/app/service_adaptors/service.rb +1 -9
- data/app/views/layouts/umlaut.html.erb +1 -7
- data/app/views/resolve/_fulltext.html.erb +2 -2
- data/app/views/search/_citation.html.erb +3 -3
- data/app/views/umlaut/_footer.html.erb +15 -0
- data/app/views/umlaut/error.html.erb +3 -5
- data/lib/generators/templates/umlaut_services.yml +0 -12
- data/lib/generators/umlaut/asset_hooks_generator.rb +0 -14
- data/lib/umlaut/routes.rb +3 -1
- data/lib/umlaut/version.rb +1 -1
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGI2MGIwNmNkODZjOGY4MGRiZmVkYTBiYTBkYjdhYjE0NGU4Y2MyNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjJhNWI0MDY3YjRkYTYwYTNiYzE4NDU0YTRhMGZkNmRmODE2YzMxYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDAyY2I2NDE5NTY4ZDg3ZDlmNWYxNzc5MDQ1ZTgwM2E3NmM5OWI2NTNlMzEx
|
10
|
+
MmFhN2U3ZTI2YzhlZGI4MjI0OTc0YTUwYWRmNTJlOTQyZWM5MGViODgzYWYy
|
11
|
+
ODlhYjk5OTQwZDBhNWYwYmUzZmZmM2M1NGE2YWUyYjZhY2M4NWE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2MwZGE5MGU2NjJhMDQ1Y2NiNjRhODgwZWVkZTU4YWZiNDYwNjQ5YjgxOTE5
|
14
|
+
NDc4ZTgxMjY2OTAxNTc3NTZmYzNkYzZjNTE2NjRmOWE5NGI3MzM4YjdmOTk4
|
15
|
+
ODExOTdmNDBhZWFlYWQzNTRhZjY2MDRiY2U2ODg0Zjc1OTI4MmQ=
|
@@ -1,9 +1,10 @@
|
|
1
1
|
/* expand_contract_toggle.js: Support for show more/hide more in lists of umlaut content.
|
2
|
+
|
3
|
+
Expand/collapse elements are already controlled via Bootstrap toggle,
|
4
|
+
this just adds some additional behavior in hooks to change our labels
|
5
|
+
and disclosure icons appropriately, and prevent following non-js href links.
|
2
6
|
*/
|
3
7
|
jQuery(document).ready(function($) {
|
4
|
-
$(".collapse_toggle").each(function(){
|
5
|
-
$(this).collapse('toggle');
|
6
|
-
});
|
7
8
|
$(document).on("click", ".collapse-toggle", function(event) {
|
8
9
|
event.preventDefault();
|
9
10
|
return false;
|
@@ -23,3 +24,4 @@ jQuery(document).ready(function($) {
|
|
23
24
|
|
24
25
|
});
|
25
26
|
});
|
27
|
+
|
@@ -5,14 +5,14 @@ jQuery(document).ready(function($) {
|
|
5
5
|
event.preventDefault();
|
6
6
|
|
7
7
|
var originalLink = $(this)
|
8
|
-
var valueContainer = $("#umlaut-permalink-
|
8
|
+
var valueContainer = $("#umlaut-permalink-container");
|
9
9
|
|
10
10
|
if (! valueContainer.data("loaded")) {
|
11
|
-
valueContainer.html('<i class="spinner"></i>').show();
|
11
|
+
valueContainer.html('<span class="umlaut-permalink-content"><i class="spinner"></i></span>').show();
|
12
12
|
|
13
13
|
$.getJSON( originalLink.attr('href'), function(data) {
|
14
14
|
var href = data.permalink;
|
15
|
-
var a = $("<a/>");
|
15
|
+
var a = $("<a class='umlaut-permalink-content'/>");
|
16
16
|
a.attr("href", href);
|
17
17
|
a.text(href);
|
18
18
|
valueContainer.html(a).data("loaded", true).show();
|
@@ -23,4 +23,4 @@ jQuery(document).ready(function($) {
|
|
23
23
|
}
|
24
24
|
});
|
25
25
|
|
26
|
-
});
|
26
|
+
});
|
@@ -6,10 +6,39 @@
|
|
6
6
|
|
7
7
|
At present, only expand/contract toggle behavior is actually supported,
|
8
8
|
others are non-applicable or hard to get working on an external site
|
9
|
-
due to cross-domain-origin stuff.
|
10
|
-
|
9
|
+
due to cross-domain-origin stuff.
|
10
|
+
|
11
|
+
And even this has become VERY HACKY AND FRAGILE these days --
|
12
|
+
this whole concept may be nontenable.
|
11
13
|
|
12
14
|
*= require 'umlaut/expand_contract_toggle.js'
|
13
|
-
|
14
|
-
|
15
|
+
|
15
16
|
*/
|
17
|
+
|
18
|
+
/* Normal umlaut uses bootstrap collapse, and expand_contract_toggle.js
|
19
|
+
assumes bootstrap collapse. For vended use as here, provide our own
|
20
|
+
simple kind of crappy replacement for bootstrap collapse, which
|
21
|
+
will combine with expand_contract_toggle.js above to completely implement. */
|
22
|
+
|
23
|
+
jQuery(document).ready(function($) {
|
24
|
+
|
25
|
+
// In ordinary umlaut bootstrap collapsible, it automatically hides
|
26
|
+
// .collapse, but not with display:none. For our replacement here,
|
27
|
+
// we need to make sure it's initially hidden with display:none,
|
28
|
+
// we'll add a style to do so.
|
29
|
+
$('html > head').append($('<style> .collapse { display:none; }</style>'));
|
30
|
+
|
31
|
+
|
32
|
+
$(document).on("click", ".collapse-toggle", function(event) {
|
33
|
+
content = $( $(this).attr('data-target') );
|
34
|
+
|
35
|
+
if ( content.is(":visible") ) {
|
36
|
+
content.slideUp();
|
37
|
+
content.trigger("hide");
|
38
|
+
}
|
39
|
+
else {
|
40
|
+
content.slideDown();
|
41
|
+
content.trigger("show");
|
42
|
+
}
|
43
|
+
});
|
44
|
+
});
|
@@ -35,8 +35,18 @@
|
|
35
35
|
margin-left: $umlautIndent;
|
36
36
|
}
|
37
37
|
|
38
|
-
.umlaut-permalink-
|
39
|
-
|
38
|
+
.umlaut-permalink-container {
|
39
|
+
color: $grayDark;
|
40
|
+
@include text-overflow;
|
41
|
+
}
|
42
|
+
.umlaut-permalink-content {
|
43
|
+
background-color: $umlautBackgroundColor;
|
44
|
+
border-radius: $borderRadiusSmall;
|
45
|
+
border: 1px solid $btnBorder;
|
46
|
+
padding: 3px 6px;
|
47
|
+
.spinner {
|
48
|
+
vertical-align: baseline;
|
49
|
+
}
|
40
50
|
}
|
41
51
|
|
42
52
|
.umlaut-load-permalink i {
|
@@ -65,6 +65,14 @@
|
|
65
65
|
}
|
66
66
|
}
|
67
67
|
|
68
|
+
&.related_items {
|
69
|
+
// Margin between the 'cited by' and 'similar' lists
|
70
|
+
.response_list + .response_list {
|
71
|
+
margin-top: $baseLineHeight * 1.5;
|
72
|
+
}
|
73
|
+
|
74
|
+
}
|
75
|
+
|
68
76
|
&.holding {
|
69
77
|
.response_item i {
|
70
78
|
@extend .umlaut_icons-famfamfam-book;
|
@@ -88,11 +96,9 @@
|
|
88
96
|
.item_status_row {
|
89
97
|
min-height: 0;
|
90
98
|
}
|
91
|
-
.
|
92
|
-
margin-left: 0;
|
93
|
-
|
94
|
-
min-height: 0;
|
95
|
-
}
|
99
|
+
.collection-str, .call-number, .holding-status, .holding-actions {
|
100
|
+
margin-left: 0;
|
101
|
+
min-height: 0;
|
96
102
|
}
|
97
103
|
.call-number, .holding-status, .holding-actions {
|
98
104
|
padding-left: $umlautIndent;
|
@@ -223,8 +229,7 @@
|
|
223
229
|
|
224
230
|
.resource-type {
|
225
231
|
@extend .muted;
|
226
|
-
margin: 0;
|
227
|
-
font-weight: bold;
|
232
|
+
margin: 0;
|
228
233
|
}
|
229
234
|
h2.title {
|
230
235
|
margin-top: 0;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
# A mix-in for Rails controllers with some standard error recovery
|
2
1
|
# logic.
|
3
2
|
module Umlaut::ErrorHandling
|
4
3
|
extend ActiveSupport::Concern
|
@@ -13,11 +12,18 @@ module Umlaut::ErrorHandling
|
|
13
12
|
end
|
14
13
|
|
15
14
|
def handle_general_error(exception)
|
15
|
+
|
16
16
|
log_error_with_context(exception)
|
17
17
|
@page_title = "Error!"
|
18
18
|
# Only render this if we haven't done anything else
|
19
|
-
# e.g. if some other gem may be handling its own errors
|
20
|
-
|
19
|
+
# e.g. if some other gem may be handling its own errors
|
20
|
+
unless performed?
|
21
|
+
if params[:format] == "html"
|
22
|
+
render "error", :status => 500
|
23
|
+
else
|
24
|
+
render :text => "Unexpected fatal error, has been logged.", :status => 500
|
25
|
+
end
|
26
|
+
end
|
21
27
|
end
|
22
28
|
protected :handle_general_error
|
23
29
|
|
@@ -42,4 +48,4 @@ module Umlaut::ErrorHandling
|
|
42
48
|
logger.send(severity, "#{message}\n\n")
|
43
49
|
end
|
44
50
|
protected :log_error_with_context
|
45
|
-
end
|
51
|
+
end
|
@@ -11,10 +11,6 @@ module Umlaut::FooterHelper
|
|
11
11
|
if @collection
|
12
12
|
content = "".html_safe
|
13
13
|
|
14
|
-
if umlaut_config.footer_credit
|
15
|
-
content << umlaut_config.footer_credit + " | "
|
16
|
-
end
|
17
|
-
|
18
14
|
content << "Powered by ".html_safe + link_to("Umlaut", "https://github.com/team-umlaut/umlaut") + ". ".html_safe
|
19
15
|
|
20
16
|
credit_segments = []
|
@@ -84,11 +84,13 @@ module Umlaut::Helper
|
|
84
84
|
# and loaded with content AJAXy.
|
85
85
|
def render_umlaut_permalink_content
|
86
86
|
content_tag("div",
|
87
|
-
:id => "umlaut-permalink-
|
88
|
-
:class=> "umlaut-permalink-
|
87
|
+
:id => "umlaut-permalink-container",
|
88
|
+
:class=> "umlaut-permalink-container",
|
89
89
|
:style => "display: none;",
|
90
90
|
:'data-loaded' => current_permalink_url.present? ) do
|
91
|
-
|
91
|
+
content_tag("span", :class => "umlaut-permalink-content") do
|
92
|
+
link_to(current_permalink_url, current_permalink_url) if current_permalink_url
|
93
|
+
end
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
@@ -91,7 +91,10 @@ module UmlautHttp
|
|
91
91
|
|
92
92
|
return http_fetch(response['location'], options)
|
93
93
|
else
|
94
|
-
|
94
|
+
if options[:raise_on_http_error_code]
|
95
|
+
Rails.logger.warn("UmlautHttp#http_fetch: unexpected non-successful response: #{uri}: #{response}") unless response.is_a?(Net::HTTPSuccess)
|
96
|
+
response.value
|
97
|
+
end
|
95
98
|
return response
|
96
99
|
end
|
97
100
|
end
|
data/app/models/referent.rb
CHANGED
@@ -286,7 +286,7 @@ class Referent < ActiveRecord::Base
|
|
286
286
|
# keep calling it. profiling shows it DOES make a difference.
|
287
287
|
my_metadata = self.metadata
|
288
288
|
|
289
|
-
if my_metadata['atitle']
|
289
|
+
if my_metadata['atitle'].present?
|
290
290
|
citation[:title] = my_metadata['atitle']
|
291
291
|
citation[:title_label], citation[:container_label] =
|
292
292
|
case my_metadata['genre']
|
@@ -382,7 +382,7 @@ class Referent < ActiveRecord::Base
|
|
382
382
|
case self.metadata["genre"]
|
383
383
|
when 'article' then 'journal'
|
384
384
|
when 'bookitem' then 'book'
|
385
|
-
else self.metadata['genre']
|
385
|
+
else self.metadata['genre'] || self.format
|
386
386
|
end
|
387
387
|
end
|
388
388
|
|
data/app/models/request.rb
CHANGED
@@ -162,17 +162,7 @@ class Request < ActiveRecord::Base
|
|
162
162
|
end
|
163
163
|
|
164
164
|
|
165
|
-
|
166
|
-
# This method checks to see if a particular service has been dispatched, and
|
167
|
-
# is succesful or in progress---that is, if this method returns false,
|
168
|
-
# you might want to dispatch the service (again). If it returns true though,
|
169
|
-
# don't, it's been done.
|
170
|
-
def dispatched?(service)
|
171
|
-
ds= self.dispatched_services.find(:first, :conditions=>{:service_id => service.service_id})
|
172
|
-
# Return true if it exists and is any value but FailedTemporary.
|
173
|
-
# FailedTemporary, it's worth running again, the others we shouldn't.
|
174
|
-
return (! ds.nil?) && (ds.status != DispatchedService::FailedTemporary)
|
175
|
-
end
|
165
|
+
|
176
166
|
# Someone asks us if it's okay to dispatch this guy. Only if it's
|
177
167
|
# marked as Queued, or Failed---otherwise it should be already working,
|
178
168
|
# or done.
|
@@ -182,6 +172,36 @@ class Request < ActiveRecord::Base
|
|
182
172
|
return ds.nil? || (ds.status == DispatchedService::Queued) || (ds.status == DispatchedService::FailedTemporary)
|
183
173
|
end
|
184
174
|
|
175
|
+
# Sets a DispatchedService object attached to this Request, for given
|
176
|
+
# service, marked InProgress -- but only if existing DispatchedService object did
|
177
|
+
# not already exist, or existed and was marked Queued or FailedTemporary.
|
178
|
+
# Returns true if was able to register as InProgress for given service,
|
179
|
+
# otherwise false.
|
180
|
+
#
|
181
|
+
# Wrapped in a connection_pool.with_connection, safe for calling from threaded
|
182
|
+
# context.
|
183
|
+
def register_in_progress(service)
|
184
|
+
ActiveRecord::Base.connection_pool.with_connection do
|
185
|
+
ds = self.find_dispatch_object( service )
|
186
|
+
if ds
|
187
|
+
# Already existed, need to update atomically, only if it's got
|
188
|
+
# a compatible existing status.
|
189
|
+
updated_count = self.dispatched_services.where(:id => ds.id,
|
190
|
+
:status => [DispatchedService::Queued || DispatchedService::FailedTemporary] ).
|
191
|
+
update_all(:status => DispatchedService::InProgress)
|
192
|
+
|
193
|
+
return (updated_count > 0)
|
194
|
+
else
|
195
|
+
# create new one, if race condition happened in between `find` above and now,
|
196
|
+
# we might wind up with a constraint violation raised, sorry.
|
197
|
+
ds= self.new_dispatch_object!(service, DispatchedService::InProgress)
|
198
|
+
ds.save!
|
199
|
+
return true
|
200
|
+
end
|
201
|
+
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
185
205
|
|
186
206
|
|
187
207
|
# Create a ServiceResponse and it's associated ServiceType(s) object,
|
data/app/models/service_wave.rb
CHANGED
@@ -24,20 +24,8 @@ class ServiceWave
|
|
24
24
|
|
25
25
|
# Safe to call in a thread. Returns true or false depending on
|
26
26
|
# whether dispatch should proceed.
|
27
|
-
def prepare_dispatch!(request, service
|
28
|
-
|
29
|
-
|
30
|
-
Request.connection_pool.with_connection do
|
31
|
-
if request.can_dispatch?( service)
|
32
|
-
# Mark this service as in progress in the dispatch table.
|
33
|
-
request.dispatched( service, DispatchedService::InProgress )
|
34
|
-
# remember the rails session id.
|
35
|
-
service.session_id = session_id
|
36
|
-
|
37
|
-
can_dispatch = true
|
38
|
-
end
|
39
|
-
end
|
40
|
-
return can_dispatch
|
27
|
+
def prepare_dispatch!(request, service)
|
28
|
+
return request.register_in_progress(service)
|
41
29
|
end
|
42
30
|
|
43
31
|
def handle(request, session_id)
|
@@ -80,7 +68,7 @@ class ServiceWave
|
|
80
68
|
end
|
81
69
|
|
82
70
|
|
83
|
-
if prepare_dispatch!(local_request, local_service
|
71
|
+
if prepare_dispatch!(local_request, local_service)
|
84
72
|
local_service.handle_wrapper(local_request)
|
85
73
|
else
|
86
74
|
Rails.logger.info("NOT launching service #{local_service.service_id}, level #{@priority_level}, request #{local_request.id}: not in runnable state") if @log_timing
|
@@ -97,7 +85,7 @@ class ServiceWave
|
|
97
85
|
|
98
86
|
# Log it too, although experience shows it may never make it to the
|
99
87
|
# log for mysterious reasons.
|
100
|
-
Rails.logger.error(TermColor.color("Umlaut: Threaded service raised exception.", :red, true) + " Service: #{service.service_id}, #{e.class} #{e.message}
|
88
|
+
Rails.logger.error(TermColor.color("Umlaut: Threaded service raised exception.", :red, true) + " Service: #{service.service_id}, #{e.class} #{e.message}. Backtrace:\n #{e.backtrace.join("\n ")}")
|
101
89
|
|
102
90
|
# And stick it in a thread variable too
|
103
91
|
Thread.current[:exception] = e
|
@@ -107,7 +95,7 @@ class ServiceWave
|
|
107
95
|
end
|
108
96
|
else # not threaded
|
109
97
|
begin
|
110
|
-
if prepare_dispatch!(request, service
|
98
|
+
if prepare_dispatch!(request, service)
|
111
99
|
service.handle_wrapper(request)
|
112
100
|
else
|
113
101
|
Rails.logger.info("NOT launching service #{service.service_id}, level #{@priority_level}, request #{request.id}: not in runnable state") if @log_timing
|
@@ -155,6 +155,7 @@ class Blacklight < Service
|
|
155
155
|
# Send a CQL request for any identifiers present.
|
156
156
|
# Ask for for an atom response with embedded marc21 back.
|
157
157
|
def blacklight_precise_search_url(request, format = "marc")
|
158
|
+
|
158
159
|
# Add search clauses for our identifiers, if we have them and have a configured search field for them.
|
159
160
|
clauses = []
|
160
161
|
added = []
|
@@ -209,10 +210,8 @@ class Blacklight < Service
|
|
209
210
|
# phrase search for title, just raw dismax for author
|
210
211
|
# Embed quotes inside the quoted value, need to backslash-quote for CQL,
|
211
212
|
# and backslash the backslashes for ruby literal.
|
212
|
-
clauses.push("#{@bl_fields["title"]} = \"\\\"#{title}\\\"\"")
|
213
|
-
clauses.push("#{@bl_fields["author"]} = \"#{author}\"") if author
|
214
|
-
|
215
|
-
|
213
|
+
clauses.push("#{@bl_fields["title"]} = \"\\\"#{remove_quotes_for_phrase_value title}\\\"\"")
|
214
|
+
clauses.push("#{@bl_fields["author"]} = \"#{remove_quotes_for_phrase_value author}\"") if author
|
216
215
|
|
217
216
|
url = base_url + "?search_field=#{@cql_search_field}&content_format=#{options[:content_format]}&q=#{CGI.escape(clauses.join(" AND "))}"
|
218
217
|
|
@@ -224,6 +223,16 @@ class Blacklight < Service
|
|
224
223
|
return url
|
225
224
|
end
|
226
225
|
|
226
|
+
# We're putting a value inside of CQL double quotes. What if
|
227
|
+
# it has double quote literal in it already? Will be a CQL syntax
|
228
|
+
# error if we do nothing. Can we escape it somehow? CQL is really
|
229
|
+
# unclear, we're ALREADY backslash escaping the phrase quotes themselves!
|
230
|
+
# We just replace them with space, should work for our actual indexing.
|
231
|
+
def remove_quotes_for_phrase_value(str)
|
232
|
+
str.gsub('"', " ")
|
233
|
+
end
|
234
|
+
|
235
|
+
|
227
236
|
# Takes a url that will return atom response of dlf_expanded content.
|
228
237
|
# Adds Umlaut "holding" ServiceResponses for dlf_expanded, as appropriate.
|
229
238
|
# Returns number of holdings added.
|
@@ -249,14 +249,14 @@ class InternetArchive < Service
|
|
249
249
|
# commands even within quotes.
|
250
250
|
output = string.downcase
|
251
251
|
|
252
|
-
# Remove parens, semi-colons, brackets, hyphens -- they all mess
|
252
|
+
# Remove parens, semi-colons, brackets, hyphens, colons -- they all mess
|
253
253
|
# up IA, which thinks they are special chars. Remove double quote,
|
254
254
|
# special char, which sometimes we want to use ourselves. Replace
|
255
255
|
# all with spaces to avoid accidentally conjoining words.
|
256
256
|
# (could be
|
257
257
|
# escaping instead? Not worth it, we don't want to search
|
258
258
|
# on these anyway. Remove ALL punctuation? Not sure.)
|
259
|
-
output.gsub!(/[)(\]\[;"
|
259
|
+
output.gsub!(/[)(\]\[;"\=\-\:]/, ' ')
|
260
260
|
|
261
261
|
return output
|
262
262
|
end
|
@@ -33,7 +33,6 @@
|
|
33
33
|
|
34
34
|
class Service
|
35
35
|
attr_reader :priority, :service_id, :url, :task, :status, :name, :group
|
36
|
-
attr_writer :session_id
|
37
36
|
attr_accessor :request
|
38
37
|
@@required_params_for_subclass = {} # initialize class var
|
39
38
|
|
@@ -169,14 +168,7 @@ class Service
|
|
169
168
|
end
|
170
169
|
|
171
170
|
|
172
|
-
|
173
|
-
unless (@session_id)
|
174
|
-
raise Exception.new("This service has not been initialized with a request!") unless request
|
175
|
-
|
176
|
-
@session_id = request.session_id
|
177
|
-
end
|
178
|
-
return @session_id
|
179
|
-
end
|
171
|
+
|
180
172
|
|
181
173
|
# This method is called by Umlaut when user clicks on a service response.
|
182
174
|
# Default implementation here just returns response['url']. You can
|
@@ -17,13 +17,7 @@
|
|
17
17
|
<%= yield %>
|
18
18
|
</div>
|
19
19
|
|
20
|
-
|
21
|
-
<%= render_service_credits %>
|
22
|
-
<!-- links to aid in debugging openurls gone wrong when in production -->
|
23
|
-
<%= link_to_test_resolve %>
|
24
|
-
<%= link_to_direct_sfx %>
|
25
|
-
<%= link_to_toggle_debug_info %>
|
26
|
-
</div>
|
20
|
+
<%= render :partial => "umlaut/footer" %>
|
27
21
|
</div>
|
28
22
|
</body>
|
29
23
|
</html>
|
@@ -17,7 +17,7 @@ all_responses = fulltxt + title_level_fulltxt %>
|
|
17
17
|
if (index == fulltxt.length && !title_level_request?) %>
|
18
18
|
</ul>
|
19
19
|
<div class="section-subheading title-level-link-warning">
|
20
|
-
<h4><%= @user_request.referent.container_type_of_thing.titlecase %>-level Page Only</h4>
|
20
|
+
<h4><%= (@user_request.referent.container_type_of_thing || "Container").titlecase %>-level Page Only</h4>
|
21
21
|
<p><span class="notice">Can not link directly to citation. Dates or extent of coverage may be unknown.</span></p>
|
22
22
|
</div>
|
23
23
|
<ul class="response_list"><%
|
@@ -29,4 +29,4 @@ all_responses = fulltxt + title_level_fulltxt %>
|
|
29
29
|
end %>
|
30
30
|
<%= render( renderer.spinner_render_hash) if renderer.services_in_progress? %>
|
31
31
|
</div>
|
32
|
-
</div>
|
32
|
+
</div>
|
@@ -61,8 +61,8 @@
|
|
61
61
|
end %>
|
62
62
|
<%= # Pages
|
63
63
|
if ref_meta.has_key?("spage")
|
64
|
-
|
65
|
-
|
64
|
+
pages = ref_meta["spage"]
|
65
|
+
pages = "#{pages} - #{ref_meta["epage"]}" if ref_meta.has_key?("epage")
|
66
66
|
content_tag(:dt, "Page:", :class => "page") +
|
67
67
|
content_tag(:dd, pages, :class => "page")
|
68
68
|
end %>
|
@@ -70,4 +70,4 @@
|
|
70
70
|
<div class="umlaut-citation-link span3">
|
71
71
|
<%= resolver_link(@current_context_object, {:target => search_result_target_window}) %>
|
72
72
|
</div>
|
73
|
-
</div>
|
73
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%# local implementers may over-ride this partial for custom local header.
|
2
|
+
This partial is called by default umlaut layout. %>
|
3
|
+
|
4
|
+
<div id="footer" class="footer">
|
5
|
+
<% if umlaut_config.footer_credit.present? %>
|
6
|
+
<%= umlaut_config.footer_credit %> |
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= render_service_credits %>
|
10
|
+
|
11
|
+
<!-- links to aid in debugging openurls gone wrong when in production -->
|
12
|
+
<%= link_to_test_resolve %>
|
13
|
+
<%= link_to_direct_sfx %>
|
14
|
+
<%= link_to_toggle_debug_info %>
|
15
|
+
</div>
|
@@ -3,11 +3,9 @@
|
|
3
3
|
<div class="error_section">
|
4
4
|
|
5
5
|
<div class="heading">
|
6
|
-
|
7
|
-
<h1>Sorry, there was an error processing your request.</h1>
|
6
|
+
<h1>Sorry, something has gone wrong.</h1>
|
8
7
|
</div>
|
9
|
-
|
10
|
-
|
8
|
+
|
11
9
|
<h2>Please try one of the following options:</h2>
|
12
10
|
<ol>
|
13
11
|
<li>If you entered this URL yourself, please check your URL for errors. </li>
|
@@ -42,4 +40,4 @@
|
|
42
40
|
|
43
41
|
<br/>
|
44
42
|
|
45
|
-
</div>
|
43
|
+
</div>
|
@@ -237,15 +237,3 @@ default:
|
|
237
237
|
# list them in array here:
|
238
238
|
#exclude: [ host.unversity.edu, otherhost.somewhere.com]
|
239
239
|
|
240
|
-
|
241
|
-
# Use of SFX api means that SFX can no longer keep statistics on
|
242
|
-
# clickthroughs. This link out filter will attempt to fake SFX into
|
243
|
-
# thinking a direct click happened when user clicks on an SFX link
|
244
|
-
# via Umlaut. This is VERY fragile logic, required reverse engineering
|
245
|
-
# SFX and faking it out, still doesn't work all the time. But works
|
246
|
-
# much of the time.
|
247
|
-
SFX_backchannel_record:
|
248
|
-
disabled: true
|
249
|
-
type: SfxBackchannelRecord
|
250
|
-
task: link_out_filter
|
251
|
-
priority: 6
|
@@ -20,20 +20,6 @@ module Umlaut
|
|
20
20
|
*= require 'umlaut'
|
21
21
|
*}
|
22
22
|
end
|
23
|
-
append_to_file("app/assets/stylesheets/application.css") do
|
24
|
-
%q{
|
25
|
-
|
26
|
-
/* Umlaut needs a jquery-ui theme CSS. Here's an easy way to get one,
|
27
|
-
* you can replace with another theme.
|
28
|
-
*
|
29
|
-
* Note, CSS @import needs to be the first line in a CSS file. This will
|
30
|
-
* become so if 'require_self' is included above, as the FIRST sprockets
|
31
|
-
* require, and this @import line is the first non-comment line in this
|
32
|
-
* file.
|
33
|
-
*/
|
34
|
-
@import url(//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css);
|
35
|
-
}
|
36
|
-
end
|
37
23
|
else
|
38
24
|
say_status("skipped", "Your application.css already references Umlaut", :yellow)
|
39
25
|
end
|
data/lib/umlaut/routes.rb
CHANGED
@@ -76,7 +76,9 @@ module Umlaut
|
|
76
76
|
# ResolveController still uses rails 2.0 style 'wildcard' routes,
|
77
77
|
# TODO tighten this up to only match what oughta be matched.
|
78
78
|
# Note: This route will make all actions in this controller accessible via GET requests.
|
79
|
-
|
79
|
+
# We do make sure to prevent resolve/index/:id, should always be resolve/index?id=foo,
|
80
|
+
# to keep OpenURLs good, and avoid errors with DOI's with slashes in em etc.
|
81
|
+
match 'resolve(.:format)' => "resolve#index"
|
80
82
|
match 'resolve(/:action(/:id(.:format)))' => "resolve"
|
81
83
|
end
|
82
84
|
end
|
data/lib/umlaut/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umlaut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind, et al
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -204,42 +204,42 @@ dependencies:
|
|
204
204
|
requirements:
|
205
205
|
- - ~>
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version: 1.3
|
207
|
+
version: '1.3'
|
208
208
|
type: :development
|
209
209
|
prerelease: false
|
210
210
|
version_requirements: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
212
|
- - ~>
|
213
213
|
- !ruby/object:Gem::Version
|
214
|
-
version: 1.3
|
214
|
+
version: '1.3'
|
215
215
|
- !ruby/object:Gem::Dependency
|
216
216
|
name: vcr
|
217
217
|
requirement: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
219
|
- - ~>
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: 2.
|
221
|
+
version: 2.5.0
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - ~>
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: 2.
|
228
|
+
version: 2.5.0
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: webmock
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
233
|
- - ~>
|
234
234
|
- !ruby/object:Gem::Version
|
235
|
-
version: 1.
|
235
|
+
version: 1.11.0
|
236
236
|
type: :development
|
237
237
|
prerelease: false
|
238
238
|
version_requirements: !ruby/object:Gem::Requirement
|
239
239
|
requirements:
|
240
240
|
- - ~>
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
version: 1.
|
242
|
+
version: 1.11.0
|
243
243
|
- !ruby/object:Gem::Dependency
|
244
244
|
name: sunspot_rails
|
245
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,6 +318,7 @@ files:
|
|
318
318
|
- app/assets/stylesheets/umlaut.css.scss
|
319
319
|
- app/assets/stylesheets/umlaut/_modal.scss
|
320
320
|
- app/assets/stylesheets/umlaut/_spinner.scss
|
321
|
+
- app/assets/stylesheets/umlaut/_expand_contract.scss
|
321
322
|
- app/assets/stylesheets/umlaut/_mixins.scss
|
322
323
|
- app/assets/stylesheets/umlaut/_admin.scss
|
323
324
|
- app/assets/stylesheets/umlaut/_misc.scss
|
@@ -438,6 +439,7 @@ files:
|
|
438
439
|
- app/views/resolve/_manually_entered_warning.html.erb
|
439
440
|
- app/views/resolve/_api_in_progress.xml.erb
|
440
441
|
- app/views/testing/index.html.erb
|
442
|
+
- app/views/umlaut/_footer.html.erb
|
441
443
|
- app/views/umlaut/_header.html.erb
|
442
444
|
- app/views/umlaut/error.html.erb
|
443
445
|
- app/views/umlaut/README
|
@@ -713,9 +715,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
713
715
|
version: '0'
|
714
716
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
715
717
|
requirements:
|
716
|
-
- - ! '
|
718
|
+
- - ! '>='
|
717
719
|
- !ruby/object:Gem::Version
|
718
|
-
version:
|
720
|
+
version: '0'
|
719
721
|
requirements: []
|
720
722
|
rubyforge_project:
|
721
723
|
rubygems_version: 2.0.3
|