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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab713fa903d406d1b3e5d7b019a33fe02c15f5fd
4
- data.tar.gz: d4ec7939d4d45cbf7ae8162554396b9316641940
3
+ metadata.gz: 039a301e82c7cc98a22affacc2f9f73b81acf7ea
4
+ data.tar.gz: c20e49377e2813768a9b7148a131f52bafb65215
5
5
  SHA512:
6
- metadata.gz: abb09cdaf3bbe01eab797de7dd20e5467cc66de304d151b11478f5710b55d41b72c3adcbe8e9e07061089ad628aa7435f01309f6c7db6d4468fd3482738dbb8f
7
- data.tar.gz: 2fc0e8df881f28edfba1a85d28f54c3d802b5d1e09b633b48d79a5be58fb6c1d53654693c73b79b530113e3e0a772c86aa0ffe3c8dfb6e100062fc58a562b2c5
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.each do |value|
6
- if displayForm(value)
7
- return_values << ModsDisplay::Values.new(:label => displayLabel(value) || title_label(value), :values => [displayForm(value)])
8
- else
9
- nonSort = nil
10
- title = nil
11
- subTitle = nil
12
- nonSort = value.nonSort.text.strip unless value.nonSort.text.strip.empty?
13
- title = value.title.text.strip unless value.title.text.strip.empty?
14
- subTitle = value.subTitle.text unless value.subTitle.text.strip.empty?
15
- preSubTitle = [nonSort, title].compact.join(" ")
16
- preSubTitle = nil if preSubTitle.strip.empty?
17
- preParts = [preSubTitle, subTitle].compact.join(" : ")
18
- preParts = nil if preParts.strip.empty?
19
- parts = value.children.select do |child|
20
- ["partName", "partNumber"].include?(child.name)
21
- end.map do |child|
22
- child.text
23
- end.compact.join(parts_delimiter(value))
24
- parts = nil if parts.strip.empty?
25
- return_values << ModsDisplay::Values.new(:label => displayLabel(value) || title_label(value), :values => [[preParts, parts].compact.join(". ")])
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)
@@ -1,3 +1,3 @@
1
1
  module ModsDisplay
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
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.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-20 00:00:00.000000000 Z
11
+ date: 2013-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stanford-mods