<< | Index | >>
Goal/Estimate/Evaluation:
Next
Experiment
def search_migel_alphabetical(query, lang) p "getin search_migel_alphabetical" st = Time.now search_method = 'search_by_name_' + lang.downcase.to_s if result = MIGEL_SERVER.migelid.send(search_method, query) p Time.now - st p "search done" result end end
Run
Search
Result (Log)
"getin search_migel_alphabetical" 0.233934 "search done"
Note
Experiment
def migel_code(model) p "getin migel_code" $st = Time.now #if model.respond_to?(:items) and items = model.items and !items.empty? if model.respond_to?(:items) and items = model.items and !items.select{|i| i.ean_code != nil and i.status != 'I'}.empty? link = PointerLink.new(:to_s, model, @session, self) link.value = model.migel_code link.href = @lookandfeel._event_url(:migel_search, {:migel_code => model.migel_code.gsub(/\./, '')}) p "done create link" p Time.now - $st link else model.migel_code end end
Result
"getin search_migel_alphabetical" "search done" 0.002609 "getin Migel::List#init" 0.034016 "getin migel_code" "getin migel_code" "getin migel_code" "getin migel_code" "done create link" 0.026033 "getin migel_code" "getin migel_code" "done create link" 0.010139 "getin migel_code" "done create link" 0.055793 "getin migel_code" "done create link" 7.651953 "getin migel_code" "done create link" 15.42268 "getin migel_code" "done create link" 1.287826 "getin migel_code" "done create link" 0.007752 "getin migel_code" "done create link" 0.59323 "getin migel_code" "done create link" 0.049668 "getin migel_code" "done create link" 7.41381 "getin migel_code" "done create link" 0.922883 "getin migel_code" "done create link" 0.01656 "getin migel_code" "done create link" 3.437128 "getin migel_code" "done create link" 0.105157 "getin migel_code" "done create link" 0.158244 "getin migel_code" "done create link" 0.938088 "getin migel_code" "done create link" 1.868578 "getin migel_code" "done create link" 0.830815 "getin migel_code" "getin migel_code" "getin migel_code" "done create link" 0.016293 "getin migel_code" "done create link" 0.018165 "getin migel_code" "done create link" 0.007947 "getin migel_code" "getin migel_code" "getin migel_code" "done create link" 0.037804 "getin migel_code" "done create link" 0.258004 "getin migel_code" "getin migel_code" "getin migel_code" "done create link" 0.007043
Note
Bingo
!items.select{|i| i.ean_code != nil and i.status != 'I'}
Next
suspend
Update
def migel_code(model) #if model.respond_to?(:items) and items = model.items and !items.select{|i| i.ean_code != nil and i.status != 'I'}.empty? if model.respond_to?(:items) and items = model.items and !items.empty? # If a migelid has only inactive products, link to empty result
Note
Commit
Update
class SubHeader < HtmlGrid::Composite COMPONENTS = { #[0,0,0] => 'Höchstvergütungsbetrag: ', [0,0,0] => :max_insure_value, ... def max_insure_value(model = @model, session = @session) if session.language == 'de' 'Höchstvergütungsbetrag: ' else 'Montants Maximaux: ' end end
DICTIONARIES = { 'fr' => { :th_article_name => 'Nom de produit',
Result
Updates
def localized_name(language) self.name.send(language) end
Note
Result
Task
Experiment
require 'view/facebook' module ODDB module View module Migel class List < HtmlGrid::List include View::Facebook def notify(model=@model, session=@session) facebook_share(model, session) end
Result
Reference
Experiment
def facebook_share(model, session=@session, share_url=nil) if share_url <<-EOS <a name="fb_share" share_url="#{share_url}" type="button_count" href="http://www.facebook.com/sharer.php">Share</a> <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> EOS else <<-EOS <a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Share</a> <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> EOS end end
@facebook_link = @lookandfeel._event_url(:migel_search, {:migel_product => model.migel_code.gsub(/\./, '')})
if model.respond_to?(:items) and items = model.items and !items.empty?
# If a migelid has only inactive products, link to empty result
link = PointerLink.new(:to_s, model, @session, self)
link.value = model.migel_code
link.href = @lookandfeel._event_url(:migel_search, {:migel_code => model.migel_code.gsub(/\./, '')})
link
else
model.migel_code
end
def notify(model=@model, session=@session)
facebook_share(model, session, @facebook_link)
end
Result
Next
Experiment
class Product < View::PrivateTemplate def meta_tags(context) super << context.meta('name' => 'title', 'content' => @model.name) end
Access
Result
<META name="title" content="Système de traitement par pression négative, location ">
Note
Result
Commit