Commit 5926daff817d57d4771061861c0fe22beca1cf58

Authored by Rodrigo Souto
1 parent d08608af

event: not display fields label if the field is empty

ActionItem3106
Showing 1 changed file with 3 additions and 4 deletions   Show diff stats
app/models/event.rb
... ... @@ -102,20 +102,19 @@ class Event < Article
102 102 html = Builder::XmlMarkup.new(:target => result)
103 103  
104 104 html.div(:class => 'event-info' ) {
105   -
106 105 html.ul(:class => 'event-data' ) {
107 106 html.li(:class => 'event-dates' ) {
108 107 html.span _('When:')
109 108 html.text! show_period(start_date, end_date)
110   - }
  109 + } if start_date.present? || end_date.present?
111 110 html.li {
112 111 html.span _('URL:')
113 112 html.a(self.link || "", 'href' => self.link || "")
114   - }
  113 + } if self.link.present?
115 114 html.li {
116 115 html.span _('Address:')
117 116 html.text! self.address || ""
118   - }
  117 + } if self.address.present?
119 118 }
120 119  
121 120 # TODO: some good soul, please clean this ugly hack:
... ...