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,20 +102,19 @@ class Event < Article
102 html = Builder::XmlMarkup.new(:target => result) 102 html = Builder::XmlMarkup.new(:target => result)
103 103
104 html.div(:class => 'event-info' ) { 104 html.div(:class => 'event-info' ) {
105 -  
106 html.ul(:class => 'event-data' ) { 105 html.ul(:class => 'event-data' ) {
107 html.li(:class => 'event-dates' ) { 106 html.li(:class => 'event-dates' ) {
108 html.span _('When:') 107 html.span _('When:')
109 html.text! show_period(start_date, end_date) 108 html.text! show_period(start_date, end_date)
110 - } 109 + } if start_date.present? || end_date.present?
111 html.li { 110 html.li {
112 html.span _('URL:') 111 html.span _('URL:')
113 html.a(self.link || "", 'href' => self.link || "") 112 html.a(self.link || "", 'href' => self.link || "")
114 - } 113 + } if self.link.present?
115 html.li { 114 html.li {
116 html.span _('Address:') 115 html.span _('Address:')
117 html.text! self.address || "" 116 html.text! self.address || ""
118 - } 117 + } if self.address.present?
119 } 118 }
120 119
121 # TODO: some good soul, please clean this ugly hack: 120 # TODO: some good soul, please clean this ugly hack: