Commit 192eaa83b30513716d2b8ddab968c10c7e76da31
1 parent
d7cd1af4
Exists in
master
and in
29 other branches
ActionItem517: better diplaying for events
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2177 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
75 additions
and
10 deletions
Show diff stats
app/models/event.rb
... | ... | @@ -63,24 +63,25 @@ class Event < Article |
63 | 63 | result = '' |
64 | 64 | html = Builder::XmlMarkup.new(:target => result) |
65 | 65 | |
66 | - html.div { | |
67 | - html.ul { | |
66 | + html.div(:class => 'event-info' ) { | |
67 | + | |
68 | + html.ul(:class => 'event-data' ) { | |
69 | + html.li(:class => 'event-dates' ) { | |
70 | + html.span _('When:') | |
71 | + html.text! show_period(start_date, end_date) | |
72 | + } | |
68 | 73 | html.li { |
69 | - html.strong _('URL:') | |
74 | + html.span _('URL:') | |
70 | 75 | html.a(self.link || "", 'href' => self.link || "") |
71 | 76 | } |
72 | 77 | html.li { |
73 | - html.strong _('Address:') | |
78 | + html.span _('Address:') | |
74 | 79 | html.text! self.address || "" |
75 | 80 | } |
76 | - html.li { | |
77 | - html.strong _('When:') | |
78 | - html.text! show_period(start_date, end_date) | |
79 | - } | |
80 | 81 | } |
81 | 82 | |
82 | 83 | if self.description |
83 | - html.div '_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____' | |
84 | + html.div('_____XXXX_DESCRIPTION_GOES_HERE_XXXX_____', :class => 'event-description') | |
84 | 85 | end |
85 | 86 | } |
86 | 87 | ... | ... |
public/designs/themes/ecosol/stylesheets/controller_content_viewer.css
... | ... | @@ -16,3 +16,18 @@ |
16 | 16 | color: #058; |
17 | 17 | } |
18 | 18 | |
19 | + | |
20 | +div.event-info { | |
21 | + -moz-border-radius: 20px; | |
22 | + background-color: #B8CFE7; | |
23 | +} | |
24 | + | |
25 | +li.event-dates { | |
26 | + border: 1px solid #729FCF; | |
27 | + -moz-border-radius: 5px; | |
28 | +} | |
29 | + | |
30 | +div.event-info div.event-description { | |
31 | + border: 1px solid #729FCF; | |
32 | + -moz-border-radius: 10px; | |
33 | +} | ... | ... |
public/designs/themes/zen3/stylesheets/controller_content_viewer.css
... | ... | @@ -12,3 +12,15 @@ |
12 | 12 | margin-bottom: 20px; |
13 | 13 | } |
14 | 14 | |
15 | +div.event-info { | |
16 | + background: #FEA; | |
17 | + border: 2px solid #fcaf3e; | |
18 | +} | |
19 | + | |
20 | +li.event-dates { | |
21 | + border: 1px solid #fcaf3e; | |
22 | +} | |
23 | + | |
24 | +div.event-info div.event-description { | |
25 | + border: 1px solid #fcaf3e; | |
26 | +} | ... | ... |
public/stylesheets/controller_content_viewer.css
1 | 1 | /************* enterprise homepage style *****************/ |
2 | 2 | |
3 | +div.event-info { | |
4 | + padding: 10px; | |
5 | +} | |
6 | + | |
7 | +ul.event-data { | |
8 | + margin: 0px; | |
9 | + padding: 0px; | |
10 | +} | |
11 | + | |
12 | +#content .event-data li { | |
13 | + list-style: none; | |
14 | + margin-bottom: 5px; | |
15 | +} | |
16 | + | |
17 | +#content .event-data li span { | |
18 | + font-weight: bold; | |
19 | + padding-right: 0.25em; | |
20 | +} | |
21 | + | |
22 | +li.event-dates span { | |
23 | + display: none; | |
24 | +} | |
25 | +li.event-dates { | |
26 | + padding: 5px; | |
27 | + float: right; | |
28 | + font-style: italic; | |
29 | + | |
30 | + padding-left: 32px; | |
31 | + background: white url(../images/icons-mime/event.png) 5px 50% no-repeat; | |
32 | +} | |
33 | + | |
34 | +div.event-info div.event-description { | |
35 | + margin-top: 10px; | |
36 | + | |
37 | + padding: 5px; | |
38 | + background: white; | |
39 | +} | ... | ... |
test/unit/event_test.rb
... | ... | @@ -132,7 +132,7 @@ class EventTest < ActiveSupport::TestCase |
132 | 132 | should 'provide nice display format' do |
133 | 133 | 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') |
134 | 134 | |
135 | - assert_tag_in_string e.to_html, :content => Regexp.new("1 January 2008") | |
135 | + assert_tag_in_string e.to_html, :content => Regexp.new("January 1, 2008") | |
136 | 136 | assert_tag_in_string e.to_html, :content => 'my somewhat short description' |
137 | 137 | assert_tag_in_string e.to_html, :tag => 'a', :attributes => { :href => 'http://www.myevent.org' }, :content => 'http://www.myevent.org' |
138 | 138 | ... | ... |