diff --git a/app/controllers/my_profile/consumed_products_controller.rb b/app/controllers/my_profile/consumed_products_controller.rb new file mode 100644 index 0000000..0504e40 --- /dev/null +++ b/app/controllers/my_profile/consumed_products_controller.rb @@ -0,0 +1,33 @@ +class ConsumedProductsController < ApplicationController + needs_profile + +# protect 'manage_products', :profile + + def index + @consumptions = @profile.consumptions + @product_categories = @profile.consumed_product_categories + end + + def new + @consumption = @profile.consumptions.build(params[:consumption]) + if request.post? + if @consumption.save + flash[:notice] = _('Product succesfully created') + redirect_to :action => 'index' + else + flash[:notice] = _('Could not create the product') + end + end + end + + def destroy + @consumption = @profile.consumptions.find(params[:id]) + if @consumption.destroy + flash[:notice] = _('Product succesfully removed') + else + flash[:notice] = _('Could not remove the product') + end + redirect_back_or_default :action => 'index' + end + +end diff --git a/app/design_blocks/list_block/views/edit.rhtml b/app/design_blocks/list_block/views/edit.rhtml new file mode 100644 index 0000000..2dda4db --- /dev/null +++ b/app/design_blocks/list_block/views/edit.rhtml @@ -0,0 +1,15 @@ +
+ + <%= text_field 'design_block', 'title'%> +
+ ++ + <%= text_field 'design_block', 'limit_number'%> +
+ + <%= submit_tag _('Save') %> +<% end %> diff --git a/app/design_blocks/list_block/views/show.rhtml b/app/design_blocks/list_block/views/show.rhtml new file mode 100644 index 0000000..8265d66 --- /dev/null +++ b/app/design_blocks/list_block/views/show.rhtml @@ -0,0 +1 @@ +<%= _('Limit number of people: ') %> <%= @design_block.limit_number %>
diff --git a/app/helpers/consumed_products_helper.rb b/app/helpers/consumed_products_helper.rb new file mode 100644 index 0000000..ce17972 --- /dev/null +++ b/app/helpers/consumed_products_helper.rb @@ -0,0 +1,2 @@ +module ConsumedProductsHelper +end diff --git a/app/views/category/_category.rhtml b/app/views/category/_category.rhtml new file mode 100644 index 0000000..76f9d00 --- /dev/null +++ b/app/views/category/_category.rhtml @@ -0,0 +1,10 @@ +<%# FIXME %> ++This page will list everything (articles, documents, photos, etc) that is +related to <%= @category.full_name %>. Actually generating this content is not +implement yet, though. +
+ ++And yes, this placeholder text is not translated. +
diff --git a/app/views/category/_product_category.rhtml b/app/views/category/_product_category.rhtml new file mode 100644 index 0000000..f75e59e --- /dev/null +++ b/app/views/category/_product_category.rhtml @@ -0,0 +1,11 @@ +<%= @products.size.to_s + " products in this category" %> +<%= @enterprises.size.to_s + " enterprises sells products in this category" %> + +