From 192eaa83b30513716d2b8ddab968c10c7e76da31 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Tue, 8 Jul 2008 23:05:36 +0000 Subject: [PATCH] ActionItem517: better diplaying for events --- app/models/event.rb | 19 ++++++++++--------- public/designs/themes/ecosol/stylesheets/controller_content_viewer.css | 15 +++++++++++++++ public/designs/themes/zen3/stylesheets/controller_content_viewer.css | 12 ++++++++++++ public/stylesheets/controller_content_viewer.css | 37 +++++++++++++++++++++++++++++++++++++ test/unit/event_test.rb | 2 +- 5 files changed, 75 insertions(+), 10 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 213cde3..2b0b8c8 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -63,24 +63,25 @@ class Event < Article result = '' html = Builder::XmlMarkup.new(:target => result) - html.div { - html.ul { + html.div(:class => 'event-info' ) { + + html.ul(:class => 'event-data' ) { + html.li(:class => 'event-dates' ) { + html.span _('When:') + html.text! show_period(start_date, end_date) + } html.li { - html.strong _('URL:') + html.span _('URL:') html.a(self.link || "", 'href' => self.link || "") } html.li { - html.strong _('Address:') + html.span _('Address:') html.text! self.address || "" } - html.li { - html.strong _('When:') - html.text! show_period(start_date, end_date) - } } if self.description - html.div '_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____' + html.div('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', :class => 'event-description') end } diff --git a/public/designs/themes/ecosol/stylesheets/controller_content_viewer.css b/public/designs/themes/ecosol/stylesheets/controller_content_viewer.css index c189d6f..3cb7d6a 100644 --- a/public/designs/themes/ecosol/stylesheets/controller_content_viewer.css +++ b/public/designs/themes/ecosol/stylesheets/controller_content_viewer.css @@ -16,3 +16,18 @@ color: #058; } + +div.event-info { + -moz-border-radius: 20px; + background-color: #B8CFE7; +} + +li.event-dates { + border: 1px solid #729FCF; + -moz-border-radius: 5px; +} + +div.event-info div.event-description { + border: 1px solid #729FCF; + -moz-border-radius: 10px; +} diff --git a/public/designs/themes/zen3/stylesheets/controller_content_viewer.css b/public/designs/themes/zen3/stylesheets/controller_content_viewer.css index 44c0e5e..7df7340 100644 --- a/public/designs/themes/zen3/stylesheets/controller_content_viewer.css +++ b/public/designs/themes/zen3/stylesheets/controller_content_viewer.css @@ -12,3 +12,15 @@ margin-bottom: 20px; } +div.event-info { + background: #FEA; + border: 2px solid #fcaf3e; +} + +li.event-dates { + border: 1px solid #fcaf3e; +} + +div.event-info div.event-description { + border: 1px solid #fcaf3e; +} diff --git a/public/stylesheets/controller_content_viewer.css b/public/stylesheets/controller_content_viewer.css index dd29a77..277973b 100644 --- a/public/stylesheets/controller_content_viewer.css +++ b/public/stylesheets/controller_content_viewer.css @@ -1,2 +1,39 @@ /************* enterprise homepage style *****************/ +div.event-info { + padding: 10px; +} + +ul.event-data { + margin: 0px; + padding: 0px; +} + +#content .event-data li { + list-style: none; + margin-bottom: 5px; +} + +#content .event-data li span { + font-weight: bold; + padding-right: 0.25em; +} + +li.event-dates span { + display: none; +} +li.event-dates { + padding: 5px; + float: right; + font-style: italic; + + padding-left: 32px; + background: white url(../images/icons-mime/event.png) 5px 50% no-repeat; +} + +div.event-info div.event-description { + margin-top: 10px; + + padding: 5px; + background: white; +} diff --git a/test/unit/event_test.rb b/test/unit/event_test.rb index 32a4185..6d5968a 100644 --- a/test/unit/event_test.rb +++ b/test/unit/event_test.rb @@ -132,7 +132,7 @@ class EventTest < ActiveSupport::TestCase should 'provide nice display format' do e = Event.new(:start_date => Date.new(2008,1,1), :end_date => Date.new(2008,1,1), :link => 'http://www.myevent.org', :description => 'my somewhat short description') - assert_tag_in_string e.to_html, :content => Regexp.new("1 January 2008") + assert_tag_in_string e.to_html, :content => Regexp.new("January 1, 2008") assert_tag_in_string e.to_html, :content => 'my somewhat short description' assert_tag_in_string e.to_html, :tag => 'a', :attributes => { :href => 'http://www.myevent.org' }, :content => 'http://www.myevent.org' -- libgit2 0.21.2