mods_display 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/mods_display/fields/title.rb +23 -21
- data/lib/mods_display/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 039a301e82c7cc98a22affacc2f9f73b81acf7ea
|
4
|
+
data.tar.gz: c20e49377e2813768a9b7148a131f52bafb65215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00f20b15a395e579a086fa27694b930c994d839ac17571079f58cad414f4ab649eb9e55415c297a5ff724f86bd2b8ddea81e744378b14fe5586b187bcc6675ea
|
7
|
+
data.tar.gz: 2447ea4e991345607673ccbc1dc6e5b9026f36e381c56ccc61da9f7fa54ae38902c19dff908b72d26911a9d373544c009a2cc6ace346824c053ed5a9950268dd
|
data/README.md
CHANGED
@@ -135,6 +135,16 @@ This can be accomplished by setting the hierarchical_link configuration option t
|
|
135
135
|
|
136
136
|
NOTE: The default delimiter is set to > for subjects.
|
137
137
|
|
138
|
+
### Special Access Condition Configuration
|
139
|
+
|
140
|
+
The access condition statement is set to be ignored by default (same as ignore! configuration option). If you would like the access condition statement to display you have to pass the access condition specific display! configuration option.
|
141
|
+
|
142
|
+
configure_mods_display do
|
143
|
+
access_condition do
|
144
|
+
display!
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
138
148
|
## Usage
|
139
149
|
|
140
150
|
Once installed, the class that included the `ControllerExtension` (`MyController`) will have the `render_mods_display` method available. This method takes one argument which is an instance of the class that included the `ModelExtension` (`MyClass`).
|
@@ -2,27 +2,29 @@ class ModsDisplay::Title < ModsDisplay::Field
|
|
2
2
|
|
3
3
|
def fields
|
4
4
|
return_values = []
|
5
|
-
@values
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
child
|
23
|
-
|
24
|
-
|
25
|
-
|
5
|
+
if @values
|
6
|
+
@values.each do |value|
|
7
|
+
if displayForm(value)
|
8
|
+
return_values << ModsDisplay::Values.new(:label => displayLabel(value) || title_label(value), :values => [displayForm(value)])
|
9
|
+
else
|
10
|
+
nonSort = nil
|
11
|
+
title = nil
|
12
|
+
subTitle = nil
|
13
|
+
nonSort = value.nonSort.text.strip unless value.nonSort.text.strip.empty?
|
14
|
+
title = value.title.text.strip unless value.title.text.strip.empty?
|
15
|
+
subTitle = value.subTitle.text unless value.subTitle.text.strip.empty?
|
16
|
+
preSubTitle = [nonSort, title].compact.join(" ")
|
17
|
+
preSubTitle = nil if preSubTitle.strip.empty?
|
18
|
+
preParts = [preSubTitle, subTitle].compact.join(" : ")
|
19
|
+
preParts = nil if preParts.strip.empty?
|
20
|
+
parts = value.children.select do |child|
|
21
|
+
["partName", "partNumber"].include?(child.name)
|
22
|
+
end.map do |child|
|
23
|
+
child.text
|
24
|
+
end.compact.join(parts_delimiter(value))
|
25
|
+
parts = nil if parts.strip.empty?
|
26
|
+
return_values << ModsDisplay::Values.new(:label => displayLabel(value) || title_label(value), :values => [[preParts, parts].compact.join(". ")])
|
27
|
+
end
|
26
28
|
end
|
27
29
|
end
|
28
30
|
collapse_fields(return_values)
|
data/lib/mods_display/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mods_display
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jessie Keck
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stanford-mods
|