Cleaner call to helper methods

This commit is contained in:
echarp 2019-06-25 22:27:24 +02:00
parent f5da88520f
commit 84c04d5fc5
4 changed files with 17 additions and 17 deletions

View File

@ -11,15 +11,15 @@ module EventsHelper
}
end
def set_event_meta
def set_event_meta(event = @event)
set_meta_tags \
keywords: @event.tag_list,
DC: { title: @event.title, date: @event.start_time.to_s },
keywords: event.tag_list,
DC: { title: event.title, date: event.start_time.to_s },
geo: {
placename: @event.city,
region: @event.region,
position: "#{@event.latitude};#{@event.longitude}",
ICBM: "#{@event.latitude}, #{@event.longitude}"
placename: event.city,
region: event.region,
position: "#{event.latitude};#{event.longitude}",
ICBM: "#{event.latitude}, #{event.longitude}"
}
end

View File

@ -1,14 +1,14 @@
# Helper for the orga views
module OrgasHelper
def set_orga_meta
def orga_meta(orga)
set_meta_tags \
description: strip_tags(@orga.description),
DC: { title: @orga.name },
description: strip_tags(orga.description),
DC: { title: orga.name },
geo: {
placename: @orga.city,
region: @orga.region,
position: "#{@orga.latitude};#{@orga.longitude}",
ICBM: "#{@orga.latitude}, #{@orga.longitude}"
placename: orga.city,
region: orga.region,
position: "#{orga.latitude};#{orga.longitude}",
ICBM: "#{orga.latitude}, #{orga.longitude}"
}
end
end

View File

@ -1,4 +1,4 @@
- set_event_meta
- event_meta @event
= render partial: '/tags/context', locals: { tags: @event.tag_list }
@ -14,7 +14,7 @@
%h3= t '.dateAndPlace'
%p= display_date
%p= display_date @event
%p.full_address
- if @event.place_name.present?

View File

@ -1,4 +1,4 @@
- set_orga_meta
- orga_meta @orga
%h2
- if @orga.kind