Commit d66fe2c0f090bf468f9168fb0bbfbbbe1a5d6a51
1 parent
8664a324
Exists in
staging
and in
42 other branches
enable lead view for events
Showing
1 changed file
with
13 additions
and
1 deletions
Show diff stats
app/models/event.rb
| @@ -104,18 +104,30 @@ class Event < Article | @@ -104,18 +104,30 @@ class Event < Article | ||
| 104 | } | 104 | } |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | + # TODO: some good soul, please clean this ugly hack: | ||
| 107 | if self.body | 108 | if self.body |
| 108 | html.div('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', :class => 'event-description') | 109 | html.div('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', :class => 'event-description') |
| 109 | end | 110 | end |
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | if self.body | 113 | if self.body |
| 113 | - result.sub!('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', self.body) | 114 | + if options[:format] == 'short' |
| 115 | + result.sub!('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', display_short_format(self)) | ||
| 116 | + else | ||
| 117 | + result.sub!('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', self.body) | ||
| 118 | + end | ||
| 114 | end | 119 | end |
| 115 | 120 | ||
| 116 | result | 121 | result |
| 117 | end | 122 | end |
| 118 | 123 | ||
| 124 | + def lead | ||
| 125 | + content_tag('div', | ||
| 126 | + show_period(start_date, end_date), | ||
| 127 | + :class => 'event-dates' | ||
| 128 | + ) + super | ||
| 129 | + end | ||
| 130 | + | ||
| 119 | def event? | 131 | def event? |
| 120 | true | 132 | true |
| 121 | end | 133 | end |