Class: ODDB::View::CenteredSearchComposite

Inherits:
HtmlGrid::Composite show all
Includes:
ExternalLinks, UserSettings
Defined in:
src/view/centeredsearchform.rb

Direct Known Subclasses

Admin::CenteredSearchComposite, Analysis::CenteredSearchComposite, ODDB::View::Companies::CenteredSearchComposite, Doctors::CenteredSearchComposite, Drugs::CenteredSearchComposite, Hospitals::CenteredSearchComposite, Interactions::CenteredSearchComposite, Migel::CenteredSearchComposite, Substances::CenteredSearchComposite, User::CenteredSearchComposite

Constant Summary

COMPONENTS =
{}
CSS_CLASS =
'composite'
CSS_MAP =
{
  [0,0,1,5]   => 'list center',
  [0,5,1,2]   => 'list small',
  [0,7,1,1]   => 'list center',        
  [0,8,1,1]   => 'list small',
}
COMPONENT_CSS_MAP =
{
  [0,9] =>  'legal-note center',
}
HTML_ATTRIBUTES =
{
  #'align'    =>  'center',
  #'valign' =>  'middle',
}
SYMBOL_MAP =
{
  :atc_chooser_text =>  HtmlGrid::Text,
  :atc_chooser      => CenteredNavigationLink,
  :database_size    =>  HtmlGrid::Text,
  :database_size_text =>  HtmlGrid::Text,
  :ddd_count_text   => HtmlGrid::Text,
  :fipi_offer       => HtmlGrid::Link,
  :interactions     =>  HtmlGrid::Link,
  :mailinglist      => HtmlGrid::Link,
  :narcotics        =>  HtmlGrid::Link,
  :plugin           => HtmlGrid::Link,
  :search_explain   => HtmlGrid::Text,
  :sequences        =>  CenteredNavigationLink,
  :software_feedback=>  HtmlGrid::Link,
}

Instance Method Summary (collapse)

Methods included from UserSettings

#language_chooser, #language_chooser_short

Methods included from ExternalLinks

#contact_link, #data_declaration, #external_link, #faq_link, #generic_definition, #help_link, #legal_note, #meddrugs_update, #wiki_link

Methods inherited from HtmlGrid::Composite

event_link, #hash_insert_col, #hash_insert_row

Instance Method Details

- (Object) atc_chooser(model, session)



138
139
140
141
142
# File 'src/view/centeredsearchform.rb', line 138

def atc_chooser(model, session)
  if(@lookandfeel.enabled?(:atc_chooser))
    CenteredNavigationLink.new(:atc_chooser, model, @session, self)
  end
end

- (Object) atc_ddd_size(mode, session)



143
144
145
# File 'src/view/centeredsearchform.rb', line 143

def atc_ddd_size(mode, session)
  @session.app.atc_ddd_count.to_s << '&nbsp;'
end

- (Object) beta(model, session)



146
147
148
149
150
151
# File 'src/view/centeredsearchform.rb', line 146

def beta(model, session)
  link = HtmlGrid::Link.new(:beta, model, session, self)
  link.href = @lookandfeel.lookup(:ywesee_contact_href)
  link.set_attribute('style','text-decoration: none; color: red; margin: 5px;')
  link
end

- (Object) database_last_updated(model, session = @session)



155
156
157
158
# File 'src/view/centeredsearchform.rb', line 155

def database_last_updated(model, session=@session)
  HtmlGrid::DateValue.new(:last_medication_update, 
                          @session.app, @session, self)
end

- (Object) database_size(model, session)



152
153
154
# File 'src/view/centeredsearchform.rb', line 152

def database_size(model, session)
  @session.app.package_count.to_s << '&nbsp;'
end

- (Object) ddd_count_text(model, session)



159
160
161
162
163
164
165
# File 'src/view/centeredsearchform.rb', line 159

def ddd_count_text(model, session)
  link = HtmlGrid::Link.new(:ddd_count_text, model, session, self)
  link.href = @lookandfeel.event_url(:ddd_count_text)
  link.label = true
  link.set_attribute('class', 'list-b')
  link
end

- (Object) divider(model, session)



166
167
168
169
170
171
# File 'src/view/centeredsearchform.rb', line 166

def divider(model, session)
  span = HtmlGrid::Span.new(model, session, self)
  span.value = '&nbsp;|&nbsp;'
  span.set_attribute('style','color: black;')
  span
end

- (Object) download_ebook(model, session)



172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'src/view/centeredsearchform.rb', line 172

def download_ebook(model, session)
  link = HtmlGrid::Link.new(:download_ebook,
                            model, session, self)
  args = {
    'download[compendium_ch.oddb.org.firefox.epub]' => 1,
    'download[compendium_ch.oddb.org.htc.prc]'      => 1,
    'download[compendium_ch.oddb.org.kindle.mobi]'  => 1,
    'download[compendium_ch.oddb.org.stanza.epub]'  => 1,
  }
  link.href = @lookandfeel._event_url(:download_export, args)
  link.set_attribute('class', 'list')
  link
end

- (Object) download_export(model, session)



185
186
187
188
189
190
191
# File 'src/view/centeredsearchform.rb', line 185

def download_export(model, session)
  link = HtmlGrid::Link.new(:download_export, model, session, self)
  link.href = @lookandfeel._event_url(:download_export)
  link.label = true
  link.set_attribute('class', 'list')
  link
end

- (Object) download_generics(model, session)



192
193
194
195
196
197
198
199
# File 'src/view/centeredsearchform.rb', line 192

def download_generics(model, session)
  link = HtmlGrid::Link.new(:download_generics, 
                            model, session, self)
  args = {'download[generics.xls]' => 1}
  link.href = @lookandfeel._event_url(:download_export, args)
  link.set_attribute('class', 'list')
  link
end

- (Object) export_divider(model, session)



200
201
202
# File 'src/view/centeredsearchform.rb', line 200

def export_divider(model, session)
  divider(model, session)
end

- (Object) fachinfo_size(model, session)



210
211
212
# File 'src/view/centeredsearchform.rb', line 210

def fachinfo_size(model, session)
  @session.app.fachinfo_count.to_s << '&nbsp;'
end

- (Object) fipi_offer(model, session)



203
204
205
206
207
208
209
# File 'src/view/centeredsearchform.rb', line 203

def fipi_offer(model, session)
  link = HtmlGrid::Link.new(:fipi_offer, model, session, self)
  link.href = @lookandfeel._event_url(:fipi_offer_input)
  link.label = true
  link.set_attribute('class', 'list')
  link
end

- (Object) interactions(model, session)



216
217
218
219
220
221
222
# File 'src/view/centeredsearchform.rb', line 216

def interactions(model, session)
  link = HtmlGrid::Link.new(:interactions, model, session, self)
  link.href = @lookandfeel._event_url(:interactions_home)
  link.label = true
  link.set_attribute('class', 'list')
  link
end

- (Object) limitation_size(mode, session)



230
231
232
# File 'src/view/centeredsearchform.rb', line 230

def limitation_size(mode, session)
  @session.app.limitation_text_count.to_s << '&nbsp;'
end

- (Object) mailinglist(model, session)



223
224
225
226
227
228
229
# File 'src/view/centeredsearchform.rb', line 223

def mailinglist(model, session)
  link = HtmlGrid::Link.new(:mailinglist, model, session, self)
  link.href = @lookandfeel._event_url(:mailinglist)
  link.label = true
  link.set_attribute('class', 'list')
  link
end

- (Object) narcotics_size(model, session)



240
241
242
# File 'src/view/centeredsearchform.rb', line 240

def narcotics_size(model, session)
  @session.app.narcotics_count.to_s << '&nbsp;'
end

- (Object) new_feature(model, session)



243
244
245
246
247
248
249
# File 'src/view/centeredsearchform.rb', line 243

def new_feature(model, session)
  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

- (Object) patinfo_size(model, session)



269
270
271
# File 'src/view/centeredsearchform.rb', line 269

def patinfo_size(model, session)
  @session.app.patinfo_count.to_s << '&nbsp;'
end

- (Object) paypal(model, session)



257
258
259
260
261
# File 'src/view/centeredsearchform.rb', line 257

def paypal(model, session)
  if(@lookandfeel.enabled?(:paypal))
    PayPalForm.new(model, session, self)
  end
end

- (Object) plugin(model, session)



233
234
235
236
237
238
239
# File 'src/view/centeredsearchform.rb', line 233

def plugin(model, session)
  link = HtmlGrid::Link.new(:plugin, model, session, self)
  link.href = @lookandfeel._event_url(:plugin)
  link.label = true
  link.set_attribute('class', 'list')
  link
end

- (Object) recent_registrations(model, session)



250
251
252
253
254
255
256
# File 'src/view/centeredsearchform.rb', line 250

def recent_registrations(model, session)
  link = HtmlGrid::Link.new(:new_registrations, model, session, self)
  link.href = @lookandfeel._event_url(:recent_registrations)
  link.set_attribute('class', 'list')
  count = @session.app.recent_registration_count
  [database_last_updated(model), ',&nbsp;', count, '&nbsp;', link]
end

- (Object) vaccines_size(model, session)



272
273
274
# File 'src/view/centeredsearchform.rb', line 272

def vaccines_size(model, session)
  @session.app.vaccine_count.to_s << '&nbsp;'
end