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 | 346 | end |
347 | 347 | |
348 | 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 | 354 | end |
351 | 355 | |
352 | 356 | end | ... | ... |
app/views/cms/view.rhtml
... | ... | @@ -9,45 +9,46 @@ |
9 | 9 | <%= icon('cms') %> |
10 | 10 | <%= _('Content management') %> |
11 | 11 | </h2> |
12 | - <div style='margin-bottom: 1em;'> | |
12 | + | |
13 | + <% button_bar(:style => 'margin-bottom: 1em;') do %> | |
13 | 14 | <%= button('new', _('New article'), :action => 'new') %> |
14 | - </div> | |
15 | + <% end %> | |
16 | + | |
15 | 17 | <% end %> |
16 | 18 | |
17 | 19 | <%# subitem %> |
20 | + | |
18 | 21 | <%= toggle_panel(_('Hide subitems'), _('Show subitems'), 'article-subitems') unless @subitems.empty? %> |
22 | + | |
19 | 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 | 39 | <% end %> |
37 | - | |
38 | - </div> | |
40 | + <% end %> | |
41 | + </div> | |
39 | 42 | </div> <!-- article-children --> |
40 | 43 | |
41 | 44 | <%# display the article content %> |
42 | -<div id='article-contents'> | |
45 | +<div id='article-contents' style='clear: left;'> | |
43 | 46 | <% if @article %> |
44 | 47 | <h2><%= @article.name %></h2> |
45 | - <div id='article-controls'> | |
46 | - | |
48 | + <% button_bar(:id => 'article-controls') do %> | |
47 | 49 | <%= link_to_edit_article(@article) %> |
48 | - | |
49 | 50 | <%= button('home', _('Use as homepage'), { :action => 'set_home_page', :id => @article }, { :method => :post }) %> |
50 | - </div> | |
51 | + <% end %> | |
51 | 52 | <%= @article.to_html %> |
52 | 53 | <% end %> |
53 | 54 | </div> | ... | ... |
public/designs/icons/default/abiword_48.png
public/stylesheets/button.css
public/stylesheets/common.css
... | ... | @@ -198,7 +198,6 @@ div.file-manager-button a:hover { |
198 | 198 | |
199 | 199 | #article-subitems-hide.hide-button { |
200 | 200 | float: right; |
201 | - margin-top: 2px; | |
202 | 201 | margin-right: 4px; |
203 | 202 | color: white; |
204 | 203 | } |
... | ... | @@ -219,6 +218,6 @@ div.file-manager-button a:hover { |
219 | 218 | #article-controls { |
220 | 219 | background: white; |
221 | 220 | border: 1px solid gray; |
222 | - padding-top: 8px; | |
223 | - padding-bottom: 8px; | |
221 | + padding-top: 4px; | |
222 | + padding-bottom: 4px; | |
224 | 223 | } | ... | ... |