Commit ea74d2b384525d682c680a3e58a0532505b32538
1 parent
e6ab61ce
Exists in
master
and in
21 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 | 1 | class ShoppingCartPlugin < Noosfero::Plugin |
| 2 | + include ModalHelper | |
| 3 | + include ActionView::Helpers::UrlHelper | |
| 2 | 4 | |
| 3 | 5 | class << self |
| 4 | 6 | def plugin_name |
| ... | ... | @@ -63,4 +65,8 @@ class ShoppingCartPlugin < Noosfero::Plugin |
| 63 | 65 | |
| 64 | 66 | buttons |
| 65 | 67 | end |
| 68 | + | |
| 69 | + def controller | |
| 70 | + context | |
| 71 | + end | |
| 66 | 72 | end | ... | ... |
plugins/shopping_cart/views/cart.html.erb
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <a href="cart:clean" onclick="Cart.clean(this); return false" class="cart-clean"><%=_('Clean basket')%></a> |
| 6 | 6 | <ul class="cart-items"></ul> |
| 7 | 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 | 9 | </div> |
| 10 | 10 | <a href="#" onclick="Cart.toggle(this); return false" class="cart-toggle"> |
| 11 | 11 | <span class="str-show"><%=_('Show basket')%></span> | ... | ... |