Commit b11a31f615ebbb453f1e1bea22dd1f5b47749c25
1 parent
37c662dc
Exists in
master
and in
29 other branches
ActionItem21: another checkpoint
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@971 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
36 additions
and
29 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -346,7 +346,11 @@ module ApplicationHelper | @@ -346,7 +346,11 @@ module ApplicationHelper | ||
346 | end | 346 | end |
347 | 347 | ||
348 | def icon(icon_name) | 348 | def icon(icon_name) |
349 | - design_display_icon(icon_name, :style => 'width: 24px; height: 24px; display: inline;') | 349 | + design_display_icon(icon_name) |
350 | + end | ||
351 | + | ||
352 | + def button_bar(options = {}, &block) | ||
353 | + concat(content_tag('div', capture(&block) + tag('br', :style => 'clear: left;'), options), block.binding) | ||
350 | end | 354 | end |
351 | 355 | ||
352 | end | 356 | end |
app/views/cms/view.rhtml
@@ -9,45 +9,46 @@ | @@ -9,45 +9,46 @@ | ||
9 | <%= icon('cms') %> | 9 | <%= icon('cms') %> |
10 | <%= _('Content management') %> | 10 | <%= _('Content management') %> |
11 | </h2> | 11 | </h2> |
12 | - <div style='margin-bottom: 1em;'> | 12 | + |
13 | + <% button_bar(:style => 'margin-bottom: 1em;') do %> | ||
13 | <%= button('new', _('New article'), :action => 'new') %> | 14 | <%= button('new', _('New article'), :action => 'new') %> |
14 | - </div> | 15 | + <% end %> |
16 | + | ||
15 | <% end %> | 17 | <% end %> |
16 | 18 | ||
17 | <%# subitem %> | 19 | <%# subitem %> |
20 | + | ||
18 | <%= toggle_panel(_('Hide subitems'), _('Show subitems'), 'article-subitems') unless @subitems.empty? %> | 21 | <%= toggle_panel(_('Hide subitems'), _('Show subitems'), 'article-subitems') unless @subitems.empty? %> |
22 | + | ||
19 | <div id='article-subitems'> | 23 | <div id='article-subitems'> |
20 | - <div class='file-manager-title'><%= @article ? _('Subitems') : _('Articles') %></div> | ||
21 | - <div class='file-manager-small'> | ||
22 | - <% unless @subitems.empty? %> | ||
23 | - <ul> | ||
24 | - <% @subitems.each do |item| %> | ||
25 | - <li> | ||
26 | - <%= file_manager_button(item.name, "icons-mime/#{item.icon_name}", :action => 'view', :id => item.id) %> | ||
27 | - </li> | ||
28 | - <% end %> | ||
29 | - </ul> | ||
30 | - <% end %> | 24 | + <div class='file-manager-title'><%= @article ? _('Subitems') : _('Articles') %></div> |
25 | + <div class='file-manager-small'> | ||
26 | + <% unless @subitems.empty? %> | ||
27 | + <ul> | ||
28 | + <% @subitems.each do |item| %> | ||
29 | + <li> | ||
30 | + <%= file_manager_button(item.name, "icons-mime/#{item.icon_name}", :action => 'view', :id => item.id) %> | ||
31 | + </li> | ||
32 | + <% end %> | ||
33 | + </ul> | ||
34 | + <% end %> | ||
31 | 35 | ||
32 | - <% if @article %> | ||
33 | - <div class='file-manager-controls'> | ||
34 | - <%= button('new', _('New subitem'), :action => 'new', :parent_id => @article.id) %> | ||
35 | - </div> | 36 | + <% if @article %> |
37 | + <% button_bar(:class => 'file-manager-controls') do %> | ||
38 | + <%= button('new', _('New subitem'), :action => 'new', :parent_id => @article.id) %> | ||
36 | <% end %> | 39 | <% end %> |
37 | - | ||
38 | - </div> | 40 | + <% end %> |
41 | + </div> | ||
39 | </div> <!-- article-children --> | 42 | </div> <!-- article-children --> |
40 | 43 | ||
41 | <%# display the article content %> | 44 | <%# display the article content %> |
42 | -<div id='article-contents'> | 45 | +<div id='article-contents' style='clear: left;'> |
43 | <% if @article %> | 46 | <% if @article %> |
44 | <h2><%= @article.name %></h2> | 47 | <h2><%= @article.name %></h2> |
45 | - <div id='article-controls'> | ||
46 | - | 48 | + <% button_bar(:id => 'article-controls') do %> |
47 | <%= link_to_edit_article(@article) %> | 49 | <%= link_to_edit_article(@article) %> |
48 | - | ||
49 | <%= button('home', _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post }) %> | 50 | <%= button('home', _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post }) %> |
50 | - </div> | 51 | + <% end %> |
51 | <%= @article.to_html %> | 52 | <%= @article.to_html %> |
52 | <% end %> | 53 | <% end %> |
53 | </div> | 54 | </div> |
public/designs/icons/default/abiword_48.png
public/stylesheets/button.css
@@ -6,6 +6,10 @@ | @@ -6,6 +6,10 @@ | ||
6 | background-position: 0px; | 6 | background-position: 0px; |
7 | 7 | ||
8 | padding-left: 25px; | 8 | padding-left: 25px; |
9 | + | ||
10 | + float: left; | ||
11 | + display: block; | ||
12 | + height: 26px; | ||
9 | } | 13 | } |
10 | 14 | ||
11 | a.button , a.button:visited { | 15 | a.button , a.button:visited { |
@@ -17,4 +21,3 @@ a.button:hover { | @@ -17,4 +21,3 @@ a.button:hover { | ||
17 | background-color: #ace; | 21 | background-color: #ace; |
18 | } | 22 | } |
19 | 23 | ||
20 | - |
public/stylesheets/common.css
@@ -198,7 +198,6 @@ div.file-manager-button a:hover { | @@ -198,7 +198,6 @@ div.file-manager-button a:hover { | ||
198 | 198 | ||
199 | #article-subitems-hide.hide-button { | 199 | #article-subitems-hide.hide-button { |
200 | float: right; | 200 | float: right; |
201 | - margin-top: 2px; | ||
202 | margin-right: 4px; | 201 | margin-right: 4px; |
203 | color: white; | 202 | color: white; |
204 | } | 203 | } |
@@ -219,6 +218,6 @@ div.file-manager-button a:hover { | @@ -219,6 +218,6 @@ div.file-manager-button a:hover { | ||
219 | #article-controls { | 218 | #article-controls { |
220 | background: white; | 219 | background: white; |
221 | border: 1px solid gray; | 220 | border: 1px solid gray; |
222 | - padding-top: 8px; | ||
223 | - padding-bottom: 8px; | 221 | + padding-top: 4px; |
222 | + padding-bottom: 4px; | ||
224 | } | 223 | } |