Class: ODDB::View::Drugs::DivExportCSV

Inherits:
HtmlGrid::DivForm
  • Object
show all
Includes:
User::Export
Defined in:
src/view/drugs/result.rb

Constant Summary

COMPONENTS =
{
  [0,0] =>  :new_feature,
  [1,0] =>  :example,
  [2,0] =>  :submit,
}
LEGACY_INTERFACE =
false
EVENT =
:export_csv

Constants included from User::Export

EXPORT_DIR, EXPORT_FILE

Instance Method Summary (collapse)

Methods included from User::Export

#checkbox_with_filesize, #convert_filesize, #datadesc, #display?, #export_link, #file_path, #file_paths, #filesize, #once, #once_or_year, #uncompressed?

Instance Method Details

- (Object) example(model)



38
39
40
# File 'src/view/drugs/result.rb', line 38

def example(model)
  super('Inderal.Preisvergleich.csv')
end

- (Object) hidden_fields(context)



41
42
43
44
45
46
47
48
# File 'src/view/drugs/result.rb', line 41

def hidden_fields(context)
   = super
  [:search_query, :search_type].each { |key|
     << context.(key.to_s, 
      @session.persistent_user_input(key))
  } 
  
end

- (Object) init



28
29
30
31
32
33
34
35
36
37
# File 'src/view/drugs/result.rb', line 28

def init
  super
  data = {
    :zone          => @session.zone,
    :search_query  => @session.persistent_user_input(:search_query).gsub('/', '%2F'),
    :search_type =>  @session.persistent_user_input(:search_type),
  }
  url = @lookandfeel._event_url(:export_csv, data)
  self.onsubmit = "location.href='#{url}';return false;"
end

- (Object) new_feature(model)



49
50
51
52
53
54
55
# File 'src/view/drugs/result.rb', line 49

def new_feature(model)
  span = HtmlGrid::Span.new(model, @session, self)
  span.value = @lookandfeel.lookup(:new_feature)
  span.set_attribute('style','color: red; margin: 5px; font-size: 8pt;')
  #span.set_attribute('style','color: red; margin: 5px; font-size: 11pt;')
  span
end