Commit ea74d2b384525d682c680a3e58a0532505b32538
1 parent
e6ab61ce
Exists in
master
and in
29 other branches
Fix modal buy view from shopping cart plugin
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
plugins/shopping_cart/lib/shopping_cart_plugin.rb
| 1 | class ShoppingCartPlugin < Noosfero::Plugin | 1 | class ShoppingCartPlugin < Noosfero::Plugin |
| 2 | + include ModalHelper | ||
| 3 | + include ActionView::Helpers::UrlHelper | ||
| 2 | 4 | ||
| 3 | class << self | 5 | class << self |
| 4 | def plugin_name | 6 | def plugin_name |
| @@ -63,4 +65,8 @@ class ShoppingCartPlugin < Noosfero::Plugin | @@ -63,4 +65,8 @@ class ShoppingCartPlugin < Noosfero::Plugin | ||
| 63 | 65 | ||
| 64 | buttons | 66 | buttons |
| 65 | end | 67 | end |
| 68 | + | ||
| 69 | + def controller | ||
| 70 | + context | ||
| 71 | + end | ||
| 66 | end | 72 | end |
plugins/shopping_cart/views/cart.html.erb
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | <a href="cart:clean" onclick="Cart.clean(this); return false" class="cart-clean"><%=_('Clean basket')%></a> | 5 | <a href="cart:clean" onclick="Cart.clean(this); return false" class="cart-clean"><%=_('Clean basket')%></a> |
| 6 | <ul class="cart-items"></ul> | 6 | <ul class="cart-items"></ul> |
| 7 | <div class="cart-total"><%=_('Total:')%> <b></b></div> | 7 | <div class="cart-total"><%=_('Total:')%> <b></b></div> |
| 8 | - <a href="/plugin/shopping_cart/buy" class="cart-buy modal"><%=_('Shopping checkout')%></a> | 8 | + <%= modal_link_to _('Shopping checkout'), { controller: 'shopping_cart_plugin', action: 'buy' }, { class: "cart-buy modal" } %> |
| 9 | </div> | 9 | </div> |
| 10 | <a href="#" onclick="Cart.toggle(this); return false" class="cart-toggle"> | 10 | <a href="#" onclick="Cart.toggle(this); return false" class="cart-toggle"> |
| 11 | <span class="str-show"><%=_('Show basket')%></span> | 11 | <span class="str-show"><%=_('Show basket')%></span> |