view · edit · sidebar · attach · print · history

20120327-update-fachinfo-photo

<< 20120328-improve-fachinfo-photo-de-oddb-org | 2012 | 20120326-update-searchbar >>


summary

  • Added Flickr image to Fachinfo Document
    • used Flickr API via flickaw gem
  • Removed FI link from mymedi lookandfeel(only patinfo).

commit

index


Add photo in fachinfo from flickr

Photo(page) link url (z.B.)

http://www.flickr.com/photos/desitinch/4963215790/ http://www.flickr.com/photos/desitinch/4963215072/sizes/sq/in/photostream/

Resultlist#namebase < DataFormat#name_base
ODDB::Package habe photo_link url.

Fachinfos are in oddb.org by Registrations,
photo_links are by Package.

A Fachinfo has some photo_link of Packages.

bin/admin

ch.oddb> registration('54467').package('036').fachinfo.registrations.first.packages
[#<ODBA::Stub:97465100#248936 @odba_class=ODDB::Package @odba_container=91690360#109642>, #<ODBA::Stub:97681000#248938 @odba_class=ODDB::Package @odba_container=97641130#109644>]
ch.oddb> registration('54467').package('036').photo_link
-> http://www.flickr.com/photos/desitinch/4963212274/

Image in link by HtmlGrid

    link = HtmlGrid::Link.new(:oekk_logo, model, @session, self)
    img = HtmlGrid::Image.new(:oekk_logo, model, @session, self)
    img.set_attribute('src', 
      'http://www.oekk.ch/_img/img_oekk_logo_oddb.gif')
    link.value = img 
    link.href = 'http://www.oekk.ch'
    link

HtmlGrid Note

NOTE
(HtmlGrid)

in HtmlGrid::List

OFFSET_STEPS

to line up elements to direct row.

OMMIT_HEADER

to cut unused th header.

in HtmlGrid::DivComposite

CSS_STYLE_MAP

key is y-position

z.B.

...
  CSS_STYLE_MAP = { 
    0 => 'float-left',
    1 => 'float-left',
    2 => 'float-left',
    3 => 'float-left',
    4 => 'float-left',
  }
...

Flickr API

in etc/oddb.yaml

...
flickr_api_key: "xxxx"
flickr_shared_secret: "xxxx"
...

use these text to access flickr api via flickraw gem.
$ gem install flickraw

refs

view · edit · sidebar · attach · print · history
Page last modified on June 28, 2013, at 05:33 PM