Class: SiSU_HTML_Promo::Ad
- Inherits:
-
Object
- Object
- SiSU_HTML_Promo::Ad
- Defined in:
- lib/sisu/html_promo.rb
Instance Method Summary collapse
-
#adsense ⇒ Object
draw content from a configuration file.
-
#advert_extract_all ⇒ Object
extracts all products from list (which is broken down into categories).
-
#advert_extract_subject(category) ⇒ Object
extracts products from category/subject list.
- #adverts(ads) ⇒ Object
- #author ⇒ Object
- #blurb ⇒ Object
- #cell(prod, id) ⇒ Object
- #close ⇒ Object
- #column_right ⇒ Object
- #date ⇒ Object
- #display ⇒ Object
- #div ⇒ Object
- #editor ⇒ Object
- #euro ⇒ Object
- #flyer ⇒ Object
- #form ⇒ Object
- #gbp ⇒ Object
- #image ⇒ Object
-
#initialize(md) ⇒ Ad
constructor
A new instance of Ad.
- #issn ⇒ Object
- #line_single ⇒ Object
- #links ⇒ Object
- #location ⇒ Object
- #major ⇒ Object
- #minor ⇒ Object
- #nick ⇒ Object
- #no_adverts ⇒ Object
- #output_form_book(type, id) ⇒ Object
- #output_form_conference(type, id) ⇒ Object
- #output_form_journal(type, id) ⇒ Object
- #output_form_link(type, id) ⇒ Object
- #output_form_search_hyperestraier(type, id) ⇒ Object
- #output_form_search_sisu(type, id) ⇒ Object
- #output_form_select(type, id) ⇒ Object
- #output_form_sponsor(type, id) ⇒ Object
- #pages ⇒ Object
- #price ⇒ Object
- #search_form_hyperestraier(table = true) ⇒ Object
- #search_form_sisu(table = true) ⇒ Object
- #show ⇒ Object
-
#site_link ⇒ Object
Work area.
- #subtitle ⇒ Object
- #title ⇒ Object
- #update ⇒ Object
- #url ⇒ Object
- #url_link ⇒ Object
- #url_relative ⇒ Object
- #usd ⇒ Object
- #year ⇒ Object
Constructor Details
#initialize(md) ⇒ Ad
Returns a new instance of Ad.
61 62 63 64 65 66 67 68 |
# File 'lib/sisu/html_promo.rb', line 61 def initialize(md) @md=md @env=SiSU_Env::InfoEnv.new(@md.fns,@md) @rc=SiSU_Env::GetInit.new.sisu_yaml.rc @ad=SiSU_Env::GetInit.new.ads @flag=@env..promo? @make=SiSU_Env::ProcessingSettings.new(@md) end |
Instance Method Details
#adsense ⇒ Object
draw content from a configuration file
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/sisu/html_promo.rb', line 253 def adsense #draw content from a configuration file def column_right if defined? @ad[:promo]['ad']['adsense']['column_right'] @ad[:promo]['ad']['adsense']['column_right'].join("\n") else '' end end def line_single if defined? @ad[:promo]['ad']['adsense']['line_single'] @ad[:promo]['ad']['adsense']['line_single'].join("\n") else '' end end self end |
#advert_extract_all ⇒ Object
extracts all products from list (which is broken down into categories)
418 419 420 421 422 423 424 |
# File 'lib/sisu/html_promo.rb', line 418 def advert_extract_all #extracts all products from list (which is broken down into categories) adverts=[] @ad[:promo_list].keys.each do |category| adverts << advert_extract_subject(category) end adverts.flatten end |
#advert_extract_subject(category) ⇒ Object
extracts products from category/subject list
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/sisu/html_promo.rb', line 389 def advert_extract_subject(category) #extracts products from category/subject list adverts=[] if defined? @ad[:promo_list][category] \ and @ad[:promo_list][category] @ad[:promo_list][category].keys.each do |type| @ad[:promo_list][category][type].each do |i| if i id=((i.inspect =~/^\d/) ? "id_#{i.to_s.strip}" : i.to_s.strip) #watch remove .to_s ? if defined? @ad[:promo][type][id] \ and not @ad[:promo][type][id].nil? adverts << output_form_select(type,id) else if defined? @ad[:promo][category][type][id] \ and @ad[:promo][category][type][id].is_a?(Array) \ and @ad[:promo][category][type][id].length > 0 adverts << @ad[:promo][category][type][id].join("\n") end end end end end else SiSU_Screen::Ansi.new( @md.opt.act[:color_state][:set], "*WARN* category not found: #{category}" ).warn unless @md.opt.act[:quiet][:set]==:on end adverts.join end |
#adverts(ads) ⇒ Object
425 426 427 428 429 430 431 |
# File 'lib/sisu/html_promo.rb', line 425 def adverts(ads) <<WOK #{div.minor} #{ads} #{div.close} WOK end |
#author ⇒ Object
120 121 122 |
# File 'lib/sisu/html_promo.rb', line 120 def @prod['author'] ? %{<p class="pane">#{@prod['author']}</p>} : '' end |
#blurb ⇒ Object
150 151 152 |
# File 'lib/sisu/html_promo.rb', line 150 def blurb @prod['blurb'] ? %{<p class="pane_blurb">#{@prod['blurb']}</p>} : '' end |
#cell(prod, id) ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/sisu/html_promo.rb', line 112 def cell(prod,id) @prod,@id=prod,id def title @prod['title'] ? %{<b>#{@prod['title']}</b>} : '' end def subtitle @prod['subtitle'] ? %{ - #{@prod['subtitle']}} : '' end def @prod['author'] ? %{<p class="pane">#{@prod['author']}</p>} : '' end def editor @prod['editor'] ? %{<p class="pane">#{@prod['editor']}</p>} : '' end def year @prod['year'] ? %{<p class="pane">#{@prod['year']}</p>} : '' end def date @prod['date'] ? %{<p class="pane">On: #{@prod['date']}</p>} : '' end def location @prod['at'] ? %{<p class="pane">At: #{@prod['at']}</p>} : '' end def pages @prod['pages'] ? %{<p class="pane">Pages: #{@prod['pages']} pages</p>} : '' end def form @prod['form'] ? %{<p class="pane">#{@prod['form']}</p>} : '' end def nick @prod['nick'] ? %{(#{@prod['nick']})<br>} : '' end def update @prod['update'] ? %{<p class="pane">Updated: #{@prod['update']}</p>} : '' end def issn @prod['issn'] ? %{<p class="pane">issn: #{@prod['issn']}</p>} : '' end def blurb @prod['blurb'] ? %{<p class="pane_blurb">#{@prod['blurb']}</p>} : '' end def search_form_sisu(table=true) db=if @prod['db']=~/\S+/ (@prod['db']=~/^#{Db[:name_prefix]}\S+/) ? @prod['db'] : "#{Db[:name_prefix]}#{@prod['db']}" elsif defined? @rc['search']['sisu']['db'] \ and @rc['search']['sisu']['db'] =~/\S+/ (@rc['search']['sisu']['db']=~/^#{Db[:name_prefix]}\S+/) \ ? @prod['search']['sisu']['db'] : "#{Db[:name_prefix]}#{@prod['db']}" else nil end action=if @prod['action']=~/^https?:\/\// @prod['action'] elsif defined? @rc['search']['sisu']['action'] \ and @rc['search']['sisu']['action'] =~/^https?:\/\// @rc['search']['sisu']['action'] else nil end if action \ and db @env..search_form('sisusearch',action,db,table) else '' end end def search_form_hyperestraier(table=true) action=if defined? @rc['search']['hyperestraier']['action'] \ and @rc['search']['hyperestraier']['action'] =~/^https?:\/\// @rc['search']['hyperestraier']['action'] else nil end form=if action '<br>' + @env..search_form('hyperestraier',action,'',table) else '' end form end def links if @prod['links'] #and @prod['links']==Array links_a=[] @prod['links'].each do |x| if x \ and x['url'] \ and x['title'] subtitle=x['subtitle'] ? %{ - #{x['subtitle']}} : '' url_=(x['url'] =~/https?:/) ? x['url'] : "../#{x['url']}" links_a << %{<p class="pane_link"><a href="#{url_}">#{x['title']}#{subtitle}</a></p>\n} end end links_a.join else '' end end def image @prod['image'] ? %{<img border="0" src="../_sisu/image/#{@prod['image']}" /><br>} : '' end def url_link @url_=if @prod['url'] =~/https?:/ "#{@prod['url']}" else "../#{@prod['url']}" # "#{@env.url.root}/#{@prod['url']}" end def show @prod['url'] ? %{<p class="pane_link"><a href="#{@url_}">#{@url_}</a></p>} : '' end def url @prod['url'] ? %{<a href="#{@url_}">} : '' end def url_relative @prod['url'] ? %{<a href="../#{@prod['url']}/toc.html">} : '' end self end def flyer if @prod['flyer'] %{<p class="pane"><a href="../man/pdf/#{@id}.pdf"><img border="0" height="18" width="15" src="../_sisu/image/b_pdf.png"> PDF flyer</a></p>} else '' end end def price def gbp if defined? @prod['price']['gbp'] \ and @prod['price']['gbp'] " £ #{@prod['price']['gbp']} (GBP) " else '' end end def euro if defined? @prod['price']['euro'] \ and @prod['price']['euro'] " € #{@prod['price']['euro']} (Euro) " else '' end end def usd if defined? @prod['price']['usd'] \ and @prod['price']['usd'] " $ #{@prod['price']['usd']} (USD) " else '' end end %{<p class="pane">Price:#{gbp}#{euro}#{usd}</p>} end def adsense #draw content from a configuration file def column_right if defined? @ad[:promo]['ad']['adsense']['column_right'] @ad[:promo]['ad']['adsense']['column_right'].join("\n") else '' end end def line_single if defined? @ad[:promo]['ad']['adsense']['line_single'] @ad[:promo]['ad']['adsense']['line_single'].join("\n") else '' end end self end def site_link #Work area if url_link.url <<-WOK <p class="pane"> #{url_link.url} #{image} #{title} #{subtitle} </a>#{nick}</p> WOK else <<-WOK <p class="pane"> #{image} #{title} #{subtitle} </p> WOK end end self end |
#close ⇒ Object
82 83 84 85 86 87 |
# File 'lib/sisu/html_promo.rb', line 82 def close (@make.build.html_right_pane? \ && @flag[:ad]) \ ? '</div>' : '' end |
#column_right ⇒ Object
254 255 256 257 258 259 |
# File 'lib/sisu/html_promo.rb', line 254 def column_right if defined? @ad[:promo]['ad']['adsense']['column_right'] @ad[:promo]['ad']['adsense']['column_right'].join("\n") else '' end end |
#date ⇒ Object
129 130 131 |
# File 'lib/sisu/html_promo.rb', line 129 def date @prod['date'] ? %{<p class="pane">On: #{@prod['date']}</p>} : '' end |
#display ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/sisu/html_promo.rb', line 90 def display ads_array,promo_array=[],[] if @make.build.html_right_pane? \ && @flag[:ad] ads=if @md.promo && @md.promo.length > 0 #promo set in document promo_array=@md.promo elsif @flag[:rc] #promo set in rc file promo_array=if @rc['html']['promo'].is_a?(String) @rc['html']['promo'].split(/[,;]\s*/) else @rc['html']['promo'] end else advert_extract_all end ads=if promo_array.length > 0 promo_array.each do |x| ads_array << advert_extract_subject(x) end ads_array end adverts(ads.join) end end |
#div ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/sisu/html_promo.rb', line 69 def div def major (@make.build.html_right_pane? \ && @flag[:ad]) \ ? '<div id="pane_major">' : '' end def minor (@make.build.html_right_pane? \ && @flag[:ad]) \ ? '<div id="pane_minor">' : '' end def close (@make.build.html_right_pane? \ && @flag[:ad]) \ ? '</div>' : '' end self end |
#editor ⇒ Object
123 124 125 |
# File 'lib/sisu/html_promo.rb', line 123 def editor @prod['editor'] ? %{<p class="pane">#{@prod['editor']}</p>} : '' end |
#euro ⇒ Object
237 238 239 240 241 242 243 |
# File 'lib/sisu/html_promo.rb', line 237 def euro if defined? @prod['price']['euro'] \ and @prod['price']['euro'] " € #{@prod['price']['euro']} (Euro) " else '' end end |
#flyer ⇒ Object
223 224 225 226 227 228 |
# File 'lib/sisu/html_promo.rb', line 223 def flyer if @prod['flyer'] %{<p class="pane"><a href="../man/pdf/#{@id}.pdf"><img border="0" height="18" width="15" src="../_sisu/image/b_pdf.png"> PDF flyer</a></p>} else '' end end |
#form ⇒ Object
138 139 140 |
# File 'lib/sisu/html_promo.rb', line 138 def form @prod['form'] ? %{<p class="pane">#{@prod['form']}</p>} : '' end |
#gbp ⇒ Object
230 231 232 233 234 235 236 |
# File 'lib/sisu/html_promo.rb', line 230 def gbp if defined? @prod['price']['gbp'] \ and @prod['price']['gbp'] " £ #{@prod['price']['gbp']} (GBP) " else '' end end |
#image ⇒ Object
204 205 206 |
# File 'lib/sisu/html_promo.rb', line 204 def image @prod['image'] ? %{<img border="0" src="../_sisu/image/#{@prod['image']}" /><br>} : '' end |
#issn ⇒ Object
147 148 149 |
# File 'lib/sisu/html_promo.rb', line 147 def issn @prod['issn'] ? %{<p class="pane">issn: #{@prod['issn']}</p>} : '' end |
#line_single ⇒ Object
260 261 262 263 264 265 |
# File 'lib/sisu/html_promo.rb', line 260 def line_single if defined? @ad[:promo]['ad']['adsense']['line_single'] @ad[:promo]['ad']['adsense']['line_single'].join("\n") else '' end end |
#links ⇒ Object
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/sisu/html_promo.rb', line 188 def links if @prod['links'] #and @prod['links']==Array links_a=[] @prod['links'].each do |x| if x \ and x['url'] \ and x['title'] subtitle=x['subtitle'] ? %{ - #{x['subtitle']}} : '' url_=(x['url'] =~/https?:/) ? x['url'] : "../#{x['url']}" links_a << %{<p class="pane_link"><a href="#{url_}">#{x['title']}#{subtitle}</a></p>\n} end end links_a.join else '' end end |
#location ⇒ Object
132 133 134 |
# File 'lib/sisu/html_promo.rb', line 132 def location @prod['at'] ? %{<p class="pane">At: #{@prod['at']}</p>} : '' end |
#major ⇒ Object
70 71 72 73 74 75 |
# File 'lib/sisu/html_promo.rb', line 70 def major (@make.build.html_right_pane? \ && @flag[:ad]) \ ? '<div id="pane_major">' : '' end |
#minor ⇒ Object
76 77 78 79 80 81 |
# File 'lib/sisu/html_promo.rb', line 76 def minor (@make.build.html_right_pane? \ && @flag[:ad]) \ ? '<div id="pane_minor">' : '' end |
#nick ⇒ Object
141 142 143 |
# File 'lib/sisu/html_promo.rb', line 141 def nick @prod['nick'] ? %{(#{@prod['nick']})<br>} : '' end |
#no_adverts ⇒ Object
432 433 434 435 436 437 |
# File 'lib/sisu/html_promo.rb', line 432 def no_adverts <<WOK #{div.minor} #{div.close} WOK end |
#output_form_book(type, id) ⇒ Object
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/sisu/html_promo.rb', line 321 def output_form_book(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) prod_type=((id=~/id_(?:[0-9x]){10,13}/i) ? 'isbn' : 'id') id_detail=%{<p class="pane">#{prod_type}: #{prod_id}</p>} <<WOK <br> #{cell.site_link} #{cell.} #{cell.year} #{id_detail} #{cell.pages}#{cell.form} #{cell.price} #{cell.flyer} #{cell.blurb} #{cell.links} WOK end |
#output_form_conference(type, id) ⇒ Object
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/sisu/html_promo.rb', line 355 def output_form_conference(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) #translate date (dd month yyyy) from 2007-03-04 and ruby conversion <<WOK <br> #{cell.site_link} #{cell.date} #{cell.location} #{cell.price} #{cell.flyer} #{cell.blurb} #{cell.links} WOK end |
#output_form_journal(type, id) ⇒ Object
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/sisu/html_promo.rb', line 339 def output_form_journal(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) <<WOK <br> #{cell.site_link} #{cell.editor} #{cell.issn} #{cell.update} #{cell.form} #{cell.price.gsub(/Price:/,'Subscription:')} #{cell.flyer} #{cell.blurb} #{cell.links} WOK end |
#output_form_link(type, id) ⇒ Object
299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/sisu/html_promo.rb', line 299 def output_form_link(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) <<WOK <br> #{cell.site_link} #{cell.} #{cell.year} #{cell.blurb} #{cell.links} WOK end |
#output_form_search_hyperestraier(type, id) ⇒ Object
316 317 318 319 320 |
# File 'lib/sisu/html_promo.rb', line 316 def output_form_search_hyperestraier(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) cell.search_form_hyperestraier(false) end |
#output_form_search_sisu(type, id) ⇒ Object
311 312 313 314 315 |
# File 'lib/sisu/html_promo.rb', line 311 def output_form_search_sisu(type,id) prod_id=id.gsub(/id_/,'') cell=cell(@ad[:promo][type][id],prod_id) cell.search_form_sisu(false) end |
#output_form_select(type, id) ⇒ Object
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/sisu/html_promo.rb', line 370 def output_form_select(type,id) case type when /site/ output_form_link(type,id) when /sponsor/ output_form_sponsor(type,id) when /search/ if id=~/hyperestraier/ output_form_search_hyperestraier(type,id) else output_form_search_sisu(type,id) end when /book/ output_form_book(type,id) when /journal/ output_form_journal(type,id) when /conference/ output_form_conference(type,id) end end |
#output_form_sponsor(type, id) ⇒ Object
290 291 292 293 294 295 296 297 298 |
# File 'lib/sisu/html_promo.rb', line 290 def output_form_sponsor(type,id) cell=cell(@ad[:promo][type][id],prod_id) <<-WOK <br> #{cell.site_link} #{cell.blurb} #{cell.links} WOK end |
#pages ⇒ Object
135 136 137 |
# File 'lib/sisu/html_promo.rb', line 135 def pages @prod['pages'] ? %{<p class="pane">Pages: #{@prod['pages']} pages</p>} : '' end |
#price ⇒ Object
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/sisu/html_promo.rb', line 229 def price def gbp if defined? @prod['price']['gbp'] \ and @prod['price']['gbp'] " £ #{@prod['price']['gbp']} (GBP) " else '' end end def euro if defined? @prod['price']['euro'] \ and @prod['price']['euro'] " € #{@prod['price']['euro']} (Euro) " else '' end end def usd if defined? @prod['price']['usd'] \ and @prod['price']['usd'] " $ #{@prod['price']['usd']} (USD) " else '' end end %{<p class="pane">Price:#{gbp}#{euro}#{usd}</p>} end |
#search_form_hyperestraier(table = true) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/sisu/html_promo.rb', line 176 def search_form_hyperestraier(table=true) action=if defined? @rc['search']['hyperestraier']['action'] \ and @rc['search']['hyperestraier']['action'] =~/^https?:\/\// @rc['search']['hyperestraier']['action'] else nil end form=if action '<br>' + @env..search_form('hyperestraier',action,'',table) else '' end form end |
#search_form_sisu(table = true) ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/sisu/html_promo.rb', line 153 def search_form_sisu(table=true) db=if @prod['db']=~/\S+/ (@prod['db']=~/^#{Db[:name_prefix]}\S+/) ? @prod['db'] : "#{Db[:name_prefix]}#{@prod['db']}" elsif defined? @rc['search']['sisu']['db'] \ and @rc['search']['sisu']['db'] =~/\S+/ (@rc['search']['sisu']['db']=~/^#{Db[:name_prefix]}\S+/) \ ? @prod['search']['sisu']['db'] : "#{Db[:name_prefix]}#{@prod['db']}" else nil end action=if @prod['action']=~/^https?:\/\// @prod['action'] elsif defined? @rc['search']['sisu']['action'] \ and @rc['search']['sisu']['action'] =~/^https?:\/\// @rc['search']['sisu']['action'] else nil end if action \ and db @env..search_form('sisusearch',action,db,table) else '' end end |
#show ⇒ Object
212 213 214 |
# File 'lib/sisu/html_promo.rb', line 212 def show @prod['url'] ? %{<p class="pane_link"><a href="#{@url_}">#{@url_}</a></p>} : '' end |
#site_link ⇒ Object
Work area
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/sisu/html_promo.rb', line 268 def site_link #Work area if url_link.url <<-WOK <p class="pane"> #{url_link.url} #{image} #{title} #{subtitle} </a>#{nick}</p> WOK else <<-WOK <p class="pane"> #{image} #{title} #{subtitle} </p> WOK end end |
#subtitle ⇒ Object
117 118 119 |
# File 'lib/sisu/html_promo.rb', line 117 def subtitle @prod['subtitle'] ? %{ - #{@prod['subtitle']}} : '' end |
#title ⇒ Object
114 115 116 |
# File 'lib/sisu/html_promo.rb', line 114 def title @prod['title'] ? %{<b>#{@prod['title']}</b>} : '' end |
#update ⇒ Object
144 145 146 |
# File 'lib/sisu/html_promo.rb', line 144 def update @prod['update'] ? %{<p class="pane">Updated: #{@prod['update']}</p>} : '' end |
#url ⇒ Object
215 216 217 |
# File 'lib/sisu/html_promo.rb', line 215 def url @prod['url'] ? %{<a href="#{@url_}">} : '' end |
#url_link ⇒ Object
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/sisu/html_promo.rb', line 207 def url_link @url_=if @prod['url'] =~/https?:/ "#{@prod['url']}" else "../#{@prod['url']}" # "#{@env.url.root}/#{@prod['url']}" end def show @prod['url'] ? %{<p class="pane_link"><a href="#{@url_}">#{@url_}</a></p>} : '' end def url @prod['url'] ? %{<a href="#{@url_}">} : '' end def url_relative @prod['url'] ? %{<a href="../#{@prod['url']}/toc.html">} : '' end self end |
#url_relative ⇒ Object
218 219 220 |
# File 'lib/sisu/html_promo.rb', line 218 def url_relative @prod['url'] ? %{<a href="../#{@prod['url']}/toc.html">} : '' end |
#usd ⇒ Object
244 245 246 247 248 249 250 |
# File 'lib/sisu/html_promo.rb', line 244 def usd if defined? @prod['price']['usd'] \ and @prod['price']['usd'] " $ #{@prod['price']['usd']} (USD) " else '' end end |
#year ⇒ Object
126 127 128 |
# File 'lib/sisu/html_promo.rb', line 126 def year @prod['year'] ? %{<p class="pane">#{@prod['year']}</p>} : '' end |