lib/stanford-mods/searchworks.rb in stanford-mods-1.5.1 vs lib/stanford-mods/searchworks.rb in stanford-mods-1.5.2
- old
+ new
@@ -321,10 +321,11 @@
when 'text'
val << 'Book' if genres && !(genres & article_genres).empty?
val << 'Book' if issuance && issuance.include?('monographic')
val << 'Book' if genres && !(genres & book_genres).empty?
val << 'Journal/Periodical' if issuance && issuance.include?('continuing')
+ val << 'Archived website' if genres && genres.include?('archived website')
when 'three dimensional object'
val << 'Object'
end
end
end
@@ -334,35 +335,33 @@
# return values for the genre facet in SearchWorks
# @return <Array[String]>
def sw_genre
val = []
genres = self.term_values(:genre)
+ types = self.term_values(:typeOfResource)
if genres
val << genres.map(&:capitalize)
val.flatten! if !val.empty?
if genres.include?('thesis') || genres.include?('Thesis')
val << 'Thesis/Dissertation'
val.delete 'Thesis'
end
conf_pub = ['conference publication', 'Conference publication', 'Conference Publication']
if !(genres & conf_pub).empty?
- types = self.term_values(:typeOfResource)
if types && types.include?('text')
val << 'Conference proceedings'
val.delete 'Conference publication'
end
end
gov_pub = ['government publication', 'Government publication', 'Government Publication']
if !(genres & gov_pub).empty?
- types = self.term_values(:typeOfResource)
if types && types.include?('text')
val << 'Government document'
val.delete 'Government publication'
end
end
tech_rpt = ['technical report', 'Technical report', 'Technical Report']
if !(genres & tech_rpt).empty?
- types = self.term_values(:typeOfResource)
if types && types.include?('text')
val << 'Technical report'
end
end
end