diff --git a/app/helpers/forms_helper.rb b/app/helpers/forms_helper.rb
index aa1c879..a986af4 100644
--- a/app/helpers/forms_helper.rb
+++ b/app/helpers/forms_helper.rb
@@ -10,4 +10,16 @@ module FormsHelper
end
+ def labelled_radio_button( human_name, name, value, checked = false, options = {} )
+ options[:id] ||= 'radio-' + rand.to_s
+ radio_button_tag( name, value, checked, options ) +
+ content_tag( 'label', human_name, :for => options[:id] )
+ end
+
+ def labelled_check_box( human_name, name, value = "1", checked = false, options = {} )
+ options[:id] ||= 'checkbox-' + rand.to_s
+ check_box_tag( name, value, checked, options ) +
+ content_tag( 'label', human_name, :for => options[:id] )
+ end
+
end
diff --git a/app/views/consumed_products/new.rhtml b/app/views/consumed_products/new.rhtml
index d3131d2..b2eb615 100644
--- a/app/views/consumed_products/new.rhtml
+++ b/app/views/consumed_products/new.rhtml
@@ -3,8 +3,14 @@
<%= error_messages_for :consumption %>
<% form_for :consumption, @consumption do |f| %>
-
<%= _('Product:') %> <%= f.select "product_category_id", ProductCategory.find(:all).map{|pc| [pc.name, pc.id]} %>
- <%= _('Aditional specifications:') %>
<%= f.text_area "aditional_specifications" %>
+
+ <%= _('Product:') %>
+ <%= f.select "product_category_id", ProductCategory.find(:all).map{|pc| [pc.name, pc.id]} %>
+
+
+ <%= _('Aditional specifications:') %>
+ <%= f.text_area "aditional_specifications", :rows => 5 %>
+
<% button_bar do %>
<%= submit_button('add', _('Add product'), :cancel => {:action => 'index'}) %>
<% end %>
diff --git a/app/views/layouts/application.rhtml b/app/views/layouts/application.rhtml
index edffd3c..8101af4 100644
--- a/app/views/layouts/application.rhtml
+++ b/app/views/layouts/application.rhtml
@@ -127,21 +127,23 @@
<% end %>
-
diff --git a/app/views/search/_category.rhtml b/app/views/search/_category.rhtml
index 187a1f8..0486f9e 100644
--- a/app/views/search/_category.rhtml
+++ b/app/views/search/_category.rhtml
@@ -15,27 +15,7 @@
diff --git a/app/views/search/_comment.rhtml b/app/views/search/_comment.rhtml
index a9e5be7..1cacab1 100644
--- a/app/views/search/_comment.rhtml
+++ b/app/views/search/_comment.rhtml
@@ -1,7 +1,22 @@
- <%= link_to(comment.title, comment.url)%>
+ <%- if comment.author -%>
+ <%= link_to content_tag( 'span', comment.author.name() ), comment.author.url,
+ :class => 'comment-picture',
+ :style => 'background-image:url(%s)' % profile_icon(comment.author, :icon)
+ %>
+ <%- else -%>
+ <%# unauthenticated user: display gravatar icon %>
+ <%= content_tag 'span', ' ',
+ :class => 'comment-picture',
+ :style => 'background-image:url(%s)' % str_gravatar_url_for( comment.email, :size => 20 )
+ %>
+ <%- end %>
+ <%= link_to(comment.title, comment.url) %>
- <%= _('by %s, on "%s"') % [comment.author_name, link_to(comment.article.name, comment.article.url)] %>
+ <%= _('by %{author} on "%{article}"') % {
+ :comment => link_to(comment.title, comment.url),
+ :article => link_to(comment.article.title, comment.article.url),
+ :author => comment.author_name } %>
diff --git a/app/views/search/_display_results.rhtml b/app/views/search/_display_results.rhtml
index 8bc0b71..52ee4d9 100644
--- a/app/views/search/_display_results.rhtml
+++ b/app/views/search/_display_results.rhtml
@@ -1,15 +1,15 @@
-<%= render :partial => 'search_form' %>
-
-
-<%= link_to _('Search for "%s" in the whole site') % @query, :controller => 'search', :action => 'index', :category_path => [], :query => @query if @category %>
-
-
-
-<% pos = :odd %>
-<% @results.each do |name,results| %>
+<%
+ pos2 = :odd # allow to format in a two colons layout
+ pos3 = 3 # allow to format in a thre colons layout
+%>
+<% @results.sort_by { |name,results| @names[name] }.each do |name,results| %>
+ <%
+ pos3 += 1; pos3 = 1 if pos3 > 3
+ pos2==:odd ? pos2=:even : pos2=:odd
+ %>
<% if !results.nil? and !results.empty? %>
-
+
<% if @controller.action_name != 'assets' %>
<%= @names[name] %>
<% end %>
@@ -23,7 +23,7 @@
<% else %>
-
+
<% if @controller.action_name != 'assets' %>
<%= @names[name] %>
<% end %>
@@ -35,3 +35,4 @@
<% end %>
+
diff --git a/app/views/search/_search_form.rhtml b/app/views/search/_search_form.rhtml
index f679676..a3cbac7 100644
--- a/app/views/search/_search_form.rhtml
+++ b/app/views/search/_search_form.rhtml
@@ -1,4 +1,6 @@
-<% form_tag({:action => 'index', :category_path => (@category ? @category.explode_path : [])}, :method => 'get') do%>
+<% form_tag( { :action => 'index', :category_path => ( @category ? @category.explode_path : [] ) },
+ :method => 'get', :class => 'search_form' ) do %>
+ <%= '
%s
' % form_title if defined? form_title %>
@@ -9,36 +11,30 @@
<% if @category %>
-
<%= _('Search in:') %>
+
+
<%= _('Search in:') %>
- -
- <%= radio_button_tag :search_whole_site, 'no', true %>
- <%= _('Only in %{category}') % { :category => @category.full_name } %>
-
- -
- <%= radio_button_tag :search_whole_site, 'yes' %>
- <%= _('Whole site') %>
-
+ - <%= labelled_radio_button _('Only in %s') % @category.full_name(' → '), :search_whole_site, 'no', true %>
+ - <%= labelled_radio_button _('Whole site'), :search_whole_site, 'yes' %>
+
<% end %>
-
-
<%= _('Search for:') %>
+
+
<%= _('Search for:') %>
<% @search_in.map { |t,n| [t,gettext(n)] } .
sort_by(&:last).each do |thing, name| %>
-
- <%= check_box_tag 'find_in[]', thing.to_s, true %>
- <%= name %>
+ <%= labelled_check_box name, 'find_in[]', thing.to_s, true %>
<% end %>
- <% button_bar do %>
- <%= submit_button(:search, _('Search')) %>
- <%= lightbox_close_button(_('Close')) if lightbox? %>
- <% end %>
+ <% if lightbox?; button_bar do %>
+ <%= lightbox_close_button _('Close') %>
+ <% end; end %>
<% end %>
diff --git a/app/views/search/index.rhtml b/app/views/search/index.rhtml
index 438d875..174c953 100644
--- a/app/views/search/index.rhtml
+++ b/app/views/search/index.rhtml
@@ -1,4 +1,7 @@
-
<%=h @category ? (_('Search results for "%{query}" in "%{category}"') % { :query => @query, :category => @category.name}) : (_('Search results for "%s"') % @query) %>
+
<%=h @category ? (_('Search results for "%{query}" in "%{category}"') % { :query => @query, :category => @category.name}) : (_('Search results for "%s"') % @query) %>
<%= render :partial => 'display_results' %>
+<%= render :partial => 'search_form', :locals => { :form_title => _("Filter your search") } %>
+
+
diff --git a/app/views/search/popup.rhtml b/app/views/search/popup.rhtml
index 3386919..a221dca 100644
--- a/app/views/search/popup.rhtml
+++ b/app/views/search/popup.rhtml
@@ -1,8 +1,6 @@