Module: BiovisionHelper
- Defined in:
- app/helpers/biovision_helper.rb
Instance Method Summary collapse
- #back_icon(path, title = t(:back), options = {}) ⇒ Object
- #create_icon(path, title = t(:create), options = {}) ⇒ Object
- #destroy_icon(entity, title = t(:delete), options = {}) ⇒ Object
- #destroy_path_icon(path, title = t(:delete), options = {}) ⇒ Object
- #edit_icon(path, title = t(:edit), options = {}) ⇒ Object
- #gear_icon(path, title = t(:view_as_administrator), options = {}) ⇒ Object
- #icon_with_link(source, path, title, options = {}) ⇒ Object
- #lock_icons(entity, path) ⇒ Object
- #return_icon(path, title = t(:back), options = {}) ⇒ Object
- #title_for_archive(year, month) ⇒ Object
- #world_icon(path, title = t(:view_as_visitor), options = {}) ⇒ Object
Instance Method Details
#back_icon(path, title = t(:back), options = {}) ⇒ Object
39 40 41 |
# File 'app/helpers/biovision_helper.rb', line 39 def back_icon(path, title = t(:back), = {}) icon_with_link('biovision/base/icons/back.svg', path, title, ) end |
#create_icon(path, title = t(:create), options = {}) ⇒ Object
32 33 34 |
# File 'app/helpers/biovision_helper.rb', line 32 def create_icon(path, title = t(:create), = {}) icon_with_link('biovision/base/icons/create.svg', path, title, ) end |
#destroy_icon(entity, title = t(:delete), options = {}) ⇒ Object
60 61 62 63 64 65 66 |
# File 'app/helpers/biovision_helper.rb', line 60 def destroy_icon(entity, title = t(:delete), = {}) default = { method: :delete, data: { confirm: t(:are_you_sure), tootik: title, tootik_conf: 'danger' } } icon_with_link('biovision/base/icons/destroy.svg', entity, title, default.merge()) end |
#destroy_path_icon(path, title = t(:delete), options = {}) ⇒ Object
71 72 73 74 75 76 77 |
# File 'app/helpers/biovision_helper.rb', line 71 def destroy_path_icon(path, title = t(:delete), = {}) default = { method: :delete, data: { confirm: t(:are_you_sure), tootik: title, tootik_conf: 'danger' } } icon_with_link('biovision/base/icons/destroy.svg', path, title, default.merge()) end |
#edit_icon(path, title = t(:edit), options = {}) ⇒ Object
53 54 55 |
# File 'app/helpers/biovision_helper.rb', line 53 def edit_icon(path, title = t(:edit), = {}) icon_with_link('biovision/base/icons/edit.svg', path, title, ) end |
#gear_icon(path, title = t(:view_as_administrator), options = {}) ⇒ Object
25 26 27 |
# File 'app/helpers/biovision_helper.rb', line 25 def gear_icon(path, title = t(:view_as_administrator), = {}) icon_with_link('biovision/base/icons/gear.svg', path, title, ) end |
#icon_with_link(source, path, title, options = {}) ⇒ Object
82 83 84 85 |
# File 'app/helpers/biovision_helper.rb', line 82 def icon_with_link(source, path, title, = {}) default = { data: { tootik: title } } link_to(image_tag(source, alt: title), path, default.merge()) end |
#lock_icons(entity, path) ⇒ Object
89 90 91 |
# File 'app/helpers/biovision_helper.rb', line 89 def lock_icons(entity, path) render partial: 'shared/actions/locks', locals: { path: path, entity: entity } end |
#return_icon(path, title = t(:back), options = {}) ⇒ Object
46 47 48 |
# File 'app/helpers/biovision_helper.rb', line 46 def return_icon(path, title = t(:back), = {}) icon_with_link('biovision/base/icons/return.svg', path, title, ) end |
#title_for_archive(year, month) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/helpers/biovision_helper.rb', line 4 def title_for_archive(year, month) if year && month month_name = t('date.nominative_months')[month.to_i] t(:archive_month, year: year.to_i, month: month_name) elsif year t(:archive_year, year: year.to_i) else '' end end |
#world_icon(path, title = t(:view_as_visitor), options = {}) ⇒ Object
18 19 20 |
# File 'app/helpers/biovision_helper.rb', line 18 def world_icon(path, title = t(:view_as_visitor), = {}) icon_with_link('biovision/base/icons/world.svg', path, title, ) end |