From dd6b5db71bb4b056982ebd1ab4e3e171504e291b Mon Sep 17 00:00:00 2001 From: AurelioAHeckert Date: Mon, 28 Apr 2008 03:15:52 +0000 Subject: [PATCH] ActionItem260: Search formatation apear ok now. May be better, but this is ok. --- app/helpers/forms_helper.rb | 12 ++++++++++++ app/views/consumed_products/new.rhtml | 10 ++++++++-- app/views/layouts/application.rhtml | 16 +++++++++------- app/views/search/_category.rhtml | 22 +--------------------- app/views/search/_comment.rhtml | 19 +++++++++++++++++-- app/views/search/_display_results.rhtml | 23 ++++++++++++----------- app/views/search/_search_form.rhtml | 32 ++++++++++++++------------------ app/views/search/index.rhtml | 5 ++++- app/views/search/popup.rhtml | 4 +--- app/views/shared/categories_menu.rhtml | 2 +- doc/README_FOR_APP | 2 ++ public/designs/themes/default/stylesheets/controller_search.css | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------- public/stylesheets/common.css | 65 ++++++++++++++++++++++++++++++++++------------------------------- public/stylesheets/controller_search.css | 21 +++++++++++++++++++++ public/stylesheets/search.css | 20 +++++++++++++++----- 15 files changed, 240 insertions(+), 133 deletions(-) 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 %> -