<< 20121001-sponsorlink-update-fi-search-update-style-chooser | 2012 | 20120927-debug-loadpath-of-production-server-sbsm-update >>
I could not replace all style, expectedly.
Because oddb.org have style
and class
and id
in various place (view, lookandfeel etc.).
tried replace in to_html method. But this was not good way.
in pubictemplate.rb
def to_html(context) html = super # oddb-style if style = @session.get_cookie_input(:style) and @lookandfeel.attributes(:styles).keys.include?(style) # html tags html.gsub!(/<TH>/) { "<th class=\"th-#{style}\">" } # css classes html.gsub!(/<(TABLE|TH|TD|A)(\s?class=\")([A-z\s\-_]*)(\")/i) { klass = $&.dup %w[th heading navigation atc explain sidebar].each do |target| klass.gsub!(/#{target}/, "#{target}-#{style}") end klass } end html end
Currently, generated css by update_css
is old.
applied current oddb.css to template.css
First I refactored CSS generator script.
Update update_css script to generate css for oddb.org(gcc) style.
changed Logo image by style.