Commit 1d28968ea07fcd0616130e477e3844d124552bb0
1 parent
62af77c0
Exists in
master
and in
28 other branches
ActionItem93: cosmetic changes and a column added to describe needed products
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1044 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
17 additions
and
5 deletions
Show diff stats
app/views/consumed_products/index.rhtml
@@ -3,6 +3,9 @@ | @@ -3,6 +3,9 @@ | ||
3 | <p> <%= link_to _('Add product'), :action => 'new' %> </p> | 3 | <p> <%= link_to _('Add product'), :action => 'new' %> </p> |
4 | 4 | ||
5 | <% @consumptions.each do |consumption| %> | 5 | <% @consumptions.each do |consumption| %> |
6 | - <p> <b> <%= link_to_category(consumption.product_category) %> </b> | ||
7 | - <%= link_to _('destroy'), :action => 'destroy', :id => consumption %> <br/> | 6 | + <p> <b> <%= link_to_category(consumption.product_category) %> </b> </p> |
7 | + <%= link_to _('destroy'), :action => 'destroy', :id => consumption %> <br/> | ||
8 | + <p> <%= consumption.aditional_specifications %></p> | ||
8 | <% end %> | 9 | <% end %> |
10 | + | ||
11 | +<%= link_to_myprofile(_('Back'), {}, @profile.identifier)%> |
app/views/consumed_products/new.rhtml
@@ -3,7 +3,8 @@ | @@ -3,7 +3,8 @@ | ||
3 | <%= error_messages_for :consumption %> | 3 | <%= error_messages_for :consumption %> |
4 | 4 | ||
5 | <% form_for :consumption, @consumption do |f| %> | 5 | <% form_for :consumption, @consumption do |f| %> |
6 | - <p> <%= _('Product: ') %> <%= f.select "product_category_id", ProductCategory.find(:all).map{|pc| [pc.name, pc.id]} %></p> | 6 | + <p> <%= _('Product: ') %> <%= f.select "product_category_id", ProductCategory.find(:all).map{|pc| [pc.name, pc.id]} %></p> |
7 | + <p> <%= _('Aditional specifications: ') %><br> <%= f.text_area "aditional_specifications" %> </p> | ||
7 | <%= submit_tag _('Add product') %> | 8 | <%= submit_tag _('Add product') %> |
8 | <%= link_to _('Cancel'), :action => 'index' %> | 9 | <%= link_to _('Cancel'), :action => 'index' %> |
9 | <% end %> | 10 | <% end %> |
app/views/manage_products/index.rhtml
@@ -8,3 +8,5 @@ | @@ -8,3 +8,5 @@ | ||
8 | <%= link_to _('edit'), :action => 'edit', :id => product %> | 8 | <%= link_to _('edit'), :action => 'edit', :id => product %> |
9 | <%= link_to _('destroy'), :action => 'destroy', :id => product %> </p> | 9 | <%= link_to _('destroy'), :action => 'destroy', :id => product %> </p> |
10 | <% end %> | 10 | <% end %> |
11 | + | ||
12 | +<%= link_to_myprofile(_('Back'), {}, @profile.identifier) %> |
app/views/profile_editor/change_image.rhtml
1 | <% form_for :image, @image, :html => { :multipart => true }, :url => { :action => 'change_image'} do |f| %> | 1 | <% form_for :image, @image, :html => { :multipart => true }, :url => { :action => 'change_image'} do |f| %> |
2 | <%= display_form_field(_('Image'), f.file_field( :uploaded_data ) ) %> | 2 | <%= display_form_field(_('Image'), f.file_field( :uploaded_data ) ) %> |
3 | <%= display_submit_tag(_('Upload')) %> | 3 | <%= display_submit_tag(_('Upload')) %> |
4 | + <%= link_to _('Cancel'), :action => 'index' %> | ||
4 | <% end %> | 5 | <% end %> |
app/views/search/_product.rhtml
@@ -7,5 +7,8 @@ | @@ -7,5 +7,8 @@ | ||
7 | <strong> | 7 | <strong> |
8 | <%= link_to( hit.name, :profile => hit.enterprise.identifier, :controller => 'catalog', :action => 'show', :id => hit) %> | 8 | <%= link_to( hit.name, :profile => hit.enterprise.identifier, :controller => 'catalog', :action => 'show', :id => hit) %> |
9 | </strong> | 9 | </strong> |
10 | + <%= _('Price: %d') % hit.price %> <br> | ||
11 | + <%= _('Producer: %s') % link_to_homepage( hit.enterprise.identifier) if hit.enterprise %> <br> | ||
12 | + <%= _('Category: %s') % link_to_category(hit.product_category) %> | ||
10 | </div> | 13 | </div> |
11 | </div> | 14 | </div> |
db/migrate/018_create_consumptions.rb
1 | class CreateConsumptions < ActiveRecord::Migration | 1 | class CreateConsumptions < ActiveRecord::Migration |
2 | def self.up | 2 | def self.up |
3 | create_table :consumptions do |t| | 3 | create_table :consumptions do |t| |
4 | - t.column :product_category_id, :integer | ||
5 | - t.column :profile_id, :integer | 4 | + t.column :product_category_id, :integer |
5 | + t.column :profile_id, :integer | ||
6 | + | ||
7 | + t.column :aditional_specifications, :text | ||
6 | end | 8 | end |
7 | end | 9 | end |
8 | 10 |