diff --git a/plugins/shopping_cart/lib/shopping_cart_plugin.rb b/plugins/shopping_cart/lib/shopping_cart_plugin.rb index 279cd77..473b98d 100644 --- a/plugins/shopping_cart/lib/shopping_cart_plugin.rb +++ b/plugins/shopping_cart/lib/shopping_cart_plugin.rb @@ -8,12 +8,12 @@ class ShoppingCartPlugin < Noosfero::Plugin _("A shopping cart feature for enterprises") end - def add_to_cart_button(item) - if context.profile.shopping_cart + def add_to_cart_button(item, enterprise = context.profile) + if enterprise.shopping_cart lambda { link_to(_('Add to cart'), "add:#{item.name}", :class => 'cart-add-item', - :onclick => "Cart.addItem('#{profile.identifier}', #{item.id}, this); return false" + :onclick => "Cart.addItem('#{enterprise.identifier}', #{item.id}, this); return false" ) } end @@ -21,6 +21,7 @@ class ShoppingCartPlugin < Noosfero::Plugin alias :product_info_extras :add_to_cart_button alias :catalog_item_extras :add_to_cart_button + alias :asset_product_extras :add_to_cart_button def stylesheet? true diff --git a/plugins/shopping_cart/public/style.css b/plugins/shopping_cart/public/style.css index b6e46de..feb4910 100644 --- a/plugins/shopping_cart/public/style.css +++ b/plugins/shopping_cart/public/style.css @@ -6,6 +6,10 @@ top: 5px; } +.product-item .cart-add-item { + top: 0px; +} + .cart { position: absolute; right: 20px; diff --git a/plugins/shopping_cart/views/shopping_cart_plugin/mailer/customer_notification.html.erb b/plugins/shopping_cart/views/shopping_cart_plugin/mailer/customer_notification.html.erb index 73d3419..48dbc8a 100644 --- a/plugins/shopping_cart/views/shopping_cart_plugin/mailer/customer_notification.html.erb +++ b/plugins/shopping_cart/views/shopping_cart_plugin/mailer/customer_notification.html.erb @@ -1,24 +1,34 @@ -<% environment = @environment %> -

<%= _('Hi %s!') % @customer[:name] %>

-

-<%= _('This is a notification e-mail about your buy request on %s.') % link_to(@supplier.name, @supplier.url) %> -<%= _('The supplier already received your buy request and may contact you for confirmation.') %> -<%= _('Please check if your information below is correct:') %> -

- -

<%=_('Here are the products you bought:')%>

-<%= items_table(@items, true) %> -

-<%=_('Thanks for buying with us!')%> -
-<%= link_to @supplier.name, @supplier.url %> -

-<%= _('A service of %s.') % environment.name %> + + + + + + + <% environment = @environment %> +

<%= _('Hi %s!') % @customer[:name] %>

+ +

+ <%= _('This is a notification e-mail about your buy request on %s.') % link_to(@supplier.name, @supplier.url) %> + <%= _('The supplier already received your buy request and may contact you for confirmation.') %> + <%= _('Please check if your information below is correct:') %> +

+ + + +

<%=_('Here are the products you bought:')%>

+ <%= items_table(@items, true) %> + +

+ --
+ <%=_('Thanks for buying with us!')%>
+ <%= link_to @supplier.name, @supplier.url %> +

+ <%= _('A service of %s.') % environment.name %> + + diff --git a/plugins/shopping_cart/views/shopping_cart_plugin/mailer/supplier_notification.html.erb b/plugins/shopping_cart/views/shopping_cart_plugin/mailer/supplier_notification.html.erb index e76b167..8e01145 100644 --- a/plugins/shopping_cart/views/shopping_cart_plugin/mailer/supplier_notification.html.erb +++ b/plugins/shopping_cart/views/shopping_cart_plugin/mailer/supplier_notification.html.erb @@ -1,22 +1,33 @@ -<% environment = @environment %> -

<%= _('Hi %s!') % @supplier.name %>

-

-<%= _('This is a buy request made by %s.') % @customer[:name] %> -<%= _('Below follows the customer informations:') %> -

- -

<%=_('And here are the items bought by this customer:')%>

-<%= items_table(@items, true) %> -

-<%=_('If there are any problems with this email contact the admin of %s.') % environment.name %> -

-<%= _('A service of %s.') % environment.name %> + + + + + + + <% environment = @environment %> +

<%= _('Hi %s!') % @supplier.name %>

+ +

+ <%= _('This is a buy request made by %s.') % @customer[:name] %> + <%= _('Below follows the customer informations:') %> +

+ + + +

<%=_('And here are the items bought by this customer:')%>

+ <%= items_table(@items, true) %> + +

+ --
+ <%=_('If there are any problems with this email contact the admin of %s.') % environment.name %> +

+ <%= _('A service of %s.') % environment.name %> + + -- libgit2 0.21.2