blob: 12ce3925450105520a1d0ebce638943ea0acd35d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
module NodesHelper
def title_for_node node
if node.head
node.head.title
else
node.draft.title
end
end
def custom_page_templates
Page.custom_templates.map {|x| [x.gsub("_", " ").titlecase, x]}
end
def event_information
if @node.event
"#{@node.event.start_time} - #{@node.event.end_time} > " \
"#{link_to 'show', event_path(@node.event)} " \
"#{link_to 'edit', edit_event_path(@node.event)}"
else
"no event attached > #{link_to 'add', new_event_path(:node_id => @node.id)}"
end
end
end
|