view · edit · sidebar · attach · print · history

20120328-improve-fachinfo-photo

<< 20120329-setup-de-oddb-org | 2012 | 20120327-update-fachinfo-photo >>


summary

  • Photo in Fachinfo
    • updated sort images by size in package name
    • load thumbnails size image (from Flickr) in document
    • created Photo chapter
    • updated image layout
  • Setup de.oddb.org

commit

index


Update ntumbnails in Fachinfo

updated:

  • load thumbnails size image (from Flickr) in document
  • updated image layout

In FachinfoChapterChooser and FachinfoInnerComposite use @photos variable of @container.

FachinfoComposite (as @@container@@)
  @photos (from Fachinfo Model Class) 
  -> FachinfoChapterChooser
  -> FachinfoInnerComposite

And moved Downloading of photos from Flickr to Fachinfo model class (Not FachinfoDocument class)

Note

HtmlGrid::Div < HtmlGrid::Component

HtmlGrid::Componet
  • CSS_CLASS
  • CSS_ID

@value is nil (ininialize)
before to_html are called, set Array or String

photos chapter

In Chapter chooser, added Fotos link.
created :photos (Photo) chapter.

Photo link (F) in result list

Updated photo link in result list as direct link to photos chapter

General way to create event_url for href of link

...
 args = [
   :reg, model.registrations.first.iksnr,
   :chapter, @name,
 ]
 photo.href = @lookandfeel._event_url(:fachinfo, args)
...

Fallback image

some photo doesn't have Small size image.

z.B. http://www.flickr.com/photos/desitinch/4962616055/sizes/t/in/photostream/

If are there photo then use Thumbnail size image instead of Small as fallback
in Photo chapter.

Flickr Image Size

 # "Square"    :  75 x  75 px
 # "Thumbnail" : 100 x 100 px
 # "Small"     : 180 x 240 px
 # "Small320"  : 240 X 320 px
In Fachinfo Document

use Thumbnail size image

In Photo Chapter

use Small size image. If it doesn't exist, use Thumbnail(if possible)

no_method_error_for_sponcer_link? No Method Error for Sponser link

Problem

http://ch.oddb.org

NoMethodError
undefined method `name' for {}:Hash
Error Log
@400000004f733964279dea14 error in SBSM::Session#to_html: /de/gcc/fachinfo/reg/61261/chapter/composition/currency/USD
@400000004f733964279dedfc NoMethodError
@400000004f733964279dedfc undefined method `name' for {}:Hash
@400000004f733964279dedfc /var/www/oddb.org/src/model/sponsor.rb:20:in `company_name'
@400000004f733964279df1e4 (eval):2:in `name'
@400000004f733964279df1e4 /var/www/oddb.org/src/view/sponsorlogo.rb:26:in `init'
@400000004f733964279df1e4 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.5/lib/htmlgrid/component.rb:139:in `initialize'
@400000004f733964279dfd9c /var/www/oddb.org/src/view/logohead.rb:27:in `new'
@400000004f733964279dfd9c /var/www/oddb.org/src/view/logohead.rb:27:in `sponsor'

This also comes from Data Floating.
Then I rebooted via svc

$ svc -h /service/SERVICE_NAME
$ svstat /service/SERVICE_NAME

It works fine again.

Error is Fachinfo Print View

2012-03-28 18:06:20.145339500 error in SBSM::Session#to_html: /fr/gcc/print/fachinfo/37512
2012-03-28 18:06:20.145340500 NoMethodError
2012-03-28 18:06:20.145340500 undefined method `photos' for #<ODDB::View::Drugs::FachinfoPrintComposite:0x00000009a42140>
2012-03-28 18:06:20.145342500 /var/www/oddb.org/src/view/drugs/fachinfo.rb:182:in `init'
2012-03-28 18:06:20.145343500 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.5/lib/htmlgrid/component.rb:139:in `initialize'
2012-03-28 18:06:20.145343500 /var/www/oddb.org/src/view/printtemplate.rb:58:in `new'
2012-03-28 18:06:20.145344500 /var/www/oddb.org/src/view/printtemplate.rb:58:in `document'
2012-03-28 18:06:20.145344500 /usr/local/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.5/lib/htmlgrid/composite.rb:142:in `create'

allowed access to photo in print view.

Setup de.oddb.org

Cloned via git into /var/www/de.oddb.org

$ cd /var/www
$ git clone ssh://ywesee@scm.ywesee.com/home/ywesee/git/de.oddb.org

Created http.conf

<VirtualHost *:80>
  DocumentRoot /var/www/de.oddb.org
  ServerName de.oddb.yasuhiro.org
  DirectoryIndex index.rbx
  RubyAddPath /var/www/de.oddb.org/lib
#RubyAddPath /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.1.5/lib
  RubyRequire 'sbsm/trans_handler'
  SetHandler ruby-object
#RubyTransHandler SBSM::FlavoredTransHandler.instance
  RubyTransHandler SBSM::ZoneTransHandler.instance
  SetEnv DEFAULT_FLAVOR oddb
  SetEnv DRB_SERVER druby://localhost:11000
  Alias /rss /var/www/de.oddb.org/var/rss
  Alias /images /var/www/de.oddb.org/var/images
  Alias /captcha /var/www/de.oddb.org/var/captcha
</VirtualHost>

try run

/var/www/de.oddb.org 498(master) $ bin/oddbd 
bin/oddbd:4: warning: variable $KCODE is no longer effective; ignored
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /var/www/de.oddb.org/lib/oddb/util/quanty/fact.rb:68: invalid multibyte char (US-ASCII) (SyntaxError)
/var/www/de.oddb.org/lib/oddb/util/quanty/fact.rb:68: invalid multibyte char (US-ASCII)
/var/www/de.oddb.org/lib/oddb/util/quanty/fact.rb:68: syntax error, unexpected $end, expecting keyword_then or ';' or '\n'
      if /^([ľA-Za-z_]+([A-Za-z_0-9-]+[A-Za-z_])?)$|^[$%'"]'?$/o =~ a
               ^
        from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
...

Note

de.oddb.org use Ruby 1.8

Tried with Ruby 1.8 (1.8.7)

/var/www/de.oddb.org 500(master) $ ruby18 bin/oddbd 
/var/www/de.oddb.org/lib/oddb/config.rb:4:in `require': no such file to load -- rclconf (LoadError)
        from /var/www/de.oddb.org/lib/oddb/config.rb:4
        from bin/oddbd:7:in `require'
        from bin/oddbd:7

Installed following gems via Ruby 1.8.7

Continue to Tomorrow

Refs

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