Commit 393fd2da0fb7b3185b936b99770155bc3402dab6

Authored by Antonio Terceiro
1 parent a60056bb

ActionItem1047: better default formatting for CMS

Took the opportunity to do a general UI review of all templates that
used tables (I had to check if they broke after my changes, after all).
app/helpers/application_helper.rb
... ... @@ -217,7 +217,7 @@ module ApplicationHelper
217 217 if html_options.has_key?(:class)
218 218 the_class << ' ' << html_options[:class]
219 219 end
220   - link_to(content_tag('span', label), url, html_options.merge(:class => the_class ))
  220 + link_to(content_tag('span', label), url, html_options.merge(:class => the_class, :title => label))
221 221 end
222 222  
223 223 def button_to_function(type, label, js_code, html_options = {}, &block)
... ...
app/views/box_organizer/_link_list_block.rhtml
1   -<p>
2 1 <strong><%= _('Links') %></strong>
3 2 <div id='edit-link-list-block'>
4 3 <table id='links' class='noborder'>
... ... @@ -11,7 +10,6 @@
11 10 <% end %>
12 11 </table>
13 12 </div>
14   -</p>
15 13  
16 14 <%= link_to_function(_('New link'), nil, :class => 'button icon-add with-text') do |page|
17 15 page.insert_html :bottom, 'links', content_tag('tr', content_tag('td',text_field_tag('block[links][][name]')) + content_tag('td',text_field_tag('block[links][][address]', nil, :class => 'cel-address'))) +
... ...
app/views/features/_features_table.rhtml
... ... @@ -1,21 +0,0 @@
1   -<% labelled_form_for(:environment, @environment, :url => {:action => 'update'}) do |f| %>
2   -
3   -<table>
4   - <%= hidden_field_tag('environment[enabled_features][]', '') %>
5   - <% @features.each do |feature, text| %>
6   - <tr>
7   - <td><%= text %></td>
8   - <td><%= check_box_tag "environment[enabled_features][]", feature, @environment.enabled?(feature) %></td>
9   - </tr>
10   - <% end %>
11   -</table>
12   -
13   -<%= labelled_form_field(_('Organization Approval Method'), select_organization_approval_method('environment', 'organization_approval_method')) %>
14   -
15   -<div>
16   - <% button_bar do %>
17   - <%= submit_button('save', _('Save changes')) %>
18   - <% end %>
19   -</div>
20   -
21   -<% end %>
app/views/features/_manage_community_fields.rhtml
... ... @@ -36,6 +36,7 @@
36 36 <div>
37 37 <% button_bar do %>
38 38 <%= submit_button('save', _('Save changes')) %>
  39 + <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %>
39 40 <% end %>
40 41 </div>
41 42  
... ...
app/views/features/_manage_enterprise_fields.rhtml
... ... @@ -36,6 +36,7 @@
36 36 <div>
37 37 <% button_bar do %>
38 38 <%= submit_button('save', _('Save changes')) %>
  39 + <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %>
39 40 <% end %>
40 41 </div>
41 42  
... ...
app/views/features/_manage_person_fields.rhtml
... ... @@ -42,6 +42,7 @@
42 42 <div>
43 43 <% button_bar do %>
44 44 <%= submit_button('save', _('Save changes')) %>
  45 + <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %>
45 46 <% end %>
46 47 </div>
47 48  
... ...
app/views/features/index.rhtml
  1 +<h1><%= _('System features') %></h1>
  2 +
1 3 <h2><%= _('Enable/Disable features') %></h2>
2 4  
3   -<%= render :partial => 'features_table' %>
  5 +<p>
  6 +<%= _('Here you can enable or disable several features of your environment. Each feature represents some funcionality that your environment can use if you enable it.
  7 +
  8 +Check all the features you want to enable for your environment, uncheck all the ones you don\'t want, and use the <em>"Save changes" button</em> to confirm your changes.') %>
  9 +</p>
  10 +
  11 +<% labelled_form_for(:environment, @environment, :url => {:action => 'update'}) do |f| %>
  12 +
  13 +<table>
  14 + <tr>
  15 + <th><%= _('Feature') %></th>
  16 + <th><%= _('Enabled?') %></th>
  17 + </tr>
  18 + <%= hidden_field_tag('environment[enabled_features][]', '') %>
  19 + <% @features.each do |feature, text| %>
  20 + <tr>
  21 + <td><%= text %></td>
  22 + <td><%= check_box_tag "environment[enabled_features][]", feature, @environment.enabled?(feature) %></td>
  23 + </tr>
  24 + <% end %>
  25 +</table>
  26 +
  27 +<h2><%= _('Configure features') %></h2>
  28 +
  29 +<table>
  30 + <tr>
  31 + <th><%= _('Option') %></th>
  32 + <th><%= _('Choice') %></th>
  33 + </tr>
  34 + <tr>
  35 + <td><%= _('Organization Approval Method') %></td>
  36 + <td><%= select_organization_approval_method('environment', 'organization_approval_method') %></td>
  37 + </tr>
  38 +</table>
  39 +
4 40  
5   -<%= help_textile _('Here you can enable or disable several features of your environment. Each feature represents some funcionality that your environment can use if you enable it.
  41 +<div>
  42 + <% button_bar do %>
  43 + <%= submit_button('save', _('Save changes')) %>
  44 + <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %>
  45 + <% end %>
  46 +</div>
6 47  
7   -Check all the features you want to enable for your environment, uncheck all the ones you don\'t want, and use the *"Save changes" button* to confirm your changes.'), _('Help'), :class => 'with-text' %>
  48 +<% end %>
... ...
app/views/manage_products/index.rhtml
... ... @@ -6,6 +6,11 @@
6 6 <th><%= _('Price') %></th>
7 7 <th><%= _('Actions') %></th>
8 8 </tr>
  9 + <% if @products.empty? %>
  10 + <tr>
  11 + <td colspan='3' style='text-align: center; padding: 10px'><em><%= _('(no product registered yet)') %></em></td>
  12 + </tr>
  13 + <% end %>
9 14 <% @products.each do |product| %>
10 15 <tr>
11 16 <td><strong><%= link_to product.name, :action => 'show', :id => product %></strong></td>
... ... @@ -18,7 +23,10 @@
18 23 <% end %>
19 24 </table>
20 25  
21   -<%= button :add, _('New product or service'), :action => 'new' %>
  26 +<% button_bar do %>
  27 + <%= button :add, _('New product or service'), :action => 'new' %>
  28 + <%= button :back, _('Back'), { :controller => 'profile_editor', :profile => @profile.identifier, :action => 'index' } %>
  29 +<% end %>
22 30  
23 31 <br /> &nbsp;
24 32  
... ... @@ -29,6 +37,11 @@
29 37 <th><%= _('Raw material') %></th>
30 38 <th><%= _('Actions') %></th>
31 39 </tr>
  40 + <% if @consumptions.empty? %>
  41 + <tr>
  42 + <td colspan='3' style='text-align: center; padding: 10px'><em><%= _('(no raw material registered yet)') %></em></td>
  43 + </tr>
  44 + <% end %>
32 45 <% @consumptions.each do |consumption| %>
33 46 <tr>
34 47 <td>
... ... @@ -44,9 +57,9 @@
44 57 <% end %>
45 58 </table>
46 59  
47   -<%= button :add, _('Add raw material'), :action => 'new_consumption' %>
  60 +<% button_bar do %>
  61 + <%= button :add, _('Add raw material'), :action => 'new_consumption' %>
  62 + <%= button :back, _('Back'), { :controller => 'profile_editor', :profile => @profile.identifier, :action => 'index' } %>
  63 +<% end %>
48 64  
49   -<p>
50   -<%= link_to( '<span>'+ _('Back') +'</span>', { :controller => 'profile_editor', :profile => @profile.identifier, :action => 'index' }, :class => 'button with-text icon-back' ) %>
51   -</p>
52 65  
... ...
app/views/profile_editor/edit.rhtml
... ... @@ -15,14 +15,13 @@
15 15  
16 16  
17 17 <h2><%= _('Privacy options') %></h2>
18   - <p>
19   - <%= _('This profile is:') %>
20   - </p>
21 18  
22 19 <% if profile.person? %>
23 20 <table>
24 21 <tr>
25   - <th></th>
  22 + <th style='text-align: right;'>
  23 + <%= _('This profile is:') %>
  24 + </th>
26 25 <th>
27 26 <%= radio_button 'profile_data', 'public_profile', 'true' %>
28 27 <label for="profile_data_public_profile_true"><u><%= _('Public') %></u></label>
... ... @@ -48,7 +47,9 @@
48 47 <% else %>
49 48 <table>
50 49 <tr>
51   - <th></th>
  50 + <th style='text-align: right;'>
  51 + <%= _('This profile is:') %>
  52 + </th>
52 53 <th>
53 54 <%= radio_button 'profile_data', 'public_profile', 'true' %>
54 55 <label for="profile_data_public_profile_true"><u><%= _('Public') %></u></label>
... ...
app/views/profile_members/index.rhtml
... ... @@ -11,11 +11,13 @@
11 11 <tr>
12 12 <td><%= m.name %> </td>
13 13 <td>
14   - <%= button :edit, _('Edit'), :action => 'change_role', :id => m %>
15   - <%= button :delete, _('Remove'), :action => 'unassociate', :id => m %>
  14 + <%= button_without_text :edit, _('Edit'), :action => 'change_role', :id => m %>
  15 + <%= button_without_text :delete, _('Remove'), :action => 'unassociate', :id => m %>
16 16 </td>
17 17 </tr>
18 18 <% end %>
19 19 </table>
20 20  
21   -<%= link_to _('Back'), :controller => 'profile_editor' %>
  21 +<% button_bar do %>
  22 + <%= button :back, _('Back'), :controller => 'profile_editor' %>
  23 +<% end %>
... ...
app/views/search/events.rhtml
... ... @@ -13,7 +13,7 @@
13 13 <%= link_to_next_month(params[:year], params[:month]) %>
14 14 </div>
15 15  
16   -<table align='center'>
  16 +<table align='center' class='noborder'>
17 17 <tr>
18 18 <% @calendar.first(7).each do |day,event| %>
19 19 <th style='width: 10%;'><%= show_day_of_week(day) %></th>
... ...
app/views/themes/index.rhtml
1 1 <h1><%= _('Editing Appearance') %></h1>
2 2  
3   -<table style='margin:auto'>
  3 +<table class='noborder' style='width: auto; margin:auto'>
4 4  
5 5 <tr>
6 6 <td colspan='6'>
... ...
po/pt_BR/noosfero.po
... ... @@ -13,7 +13,7 @@ msgid &quot;&quot;
13 13 msgstr ""
14 14 "Project-Id-Version: noosfero 0.17.0\n"
15 15 "POT-Creation-Date: 2009-05-18 19:12-0300\n"
16   -"PO-Revision-Date: 2009-05-18 19:49-0300\n"
  16 +"PO-Revision-Date: 2009-05-20 15:36-0300\n"
17 17 "Last-Translator: Joenio Costa <joenio@colivre.coop.br>\n"
18 18 "Language-Team: LANGUAGE <LL@li.org>\n"
19 19 "MIME-Version: 1.0\n"
... ... @@ -5467,7 +5467,7 @@ msgstr &quot;Gerenciar campos de comunidade&quot;
5467 5467  
5468 5468 #: app/views/features/_features_table.rhtml:13
5469 5469 msgid "Organization Approval Method"
5470   -msgstr "Métode de Aprovação da Organização"
  5470 +msgstr "Método de Aprovação de Organização"
5471 5471  
5472 5472 #: app/views/themes/new.rhtml:1
5473 5473 msgid "Create new theme"
... ...
public/stylesheets/common.css
... ... @@ -242,25 +242,35 @@ div#notice {
242 242  
243 243 table {
244 244 border-collapse: collapse;
  245 + width: 100%;
245 246 }
246 247 th, td {
247 248 font-size: 14px;
248 249 padding: 2px 10px;
  250 + height: 26px;
249 251 }
250 252 th {
251 253 font-weight: bold;
  254 + border-bottom: 2px solid black;
252 255 }
253   -
254   -table.cms-articles {
255   - width: 100%;
  256 +td {
  257 + border-bottom: 1px solid #e0e0e0;
256 258 }
257   -table.cms-articles th, table.cms-articles td {
258   - border: 1px solid #e0e0e0;
  259 +tr:hover td {
  260 + background-color: #f0f0f0;
259 261 }
260 262  
261 263 table.noborder th, table.noborder td{
262 264 border: none;
263 265 }
  266 +table.noborder:hover td {
  267 + background: none;
  268 +}
  269 +table.noborder:hover td.selected,
  270 +td.selected {
  271 + background: #ff9;
  272 + font-style: italic;
  273 +}
264 274  
265 275 /* for fields with auto-completion */
266 276 div.auto-complete {
... ...
public/stylesheets/controller_themes.css
... ... @@ -114,7 +114,3 @@
114 114 width: 500px;
115 115 }
116 116  
117   -td.selected {
118   - background: #ff9;
119   - font-style: italic;
120   -}
... ...