camaleon_ecommerce 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/plugins/ecommerce/admin.js +33 -0
- data/app/assets/javascripts/plugins/ecommerce/cart.js +207 -0
- data/app/assets/javascripts/plugins/ecommerce/fix_form.js +10 -0
- data/app/assets/javascripts/plugins/ecommerce/jquery.creditCardValidator.js +208 -0
- data/app/assets/stylesheets/plugins/ecommerce/admin.scss +122 -0
- data/app/assets/stylesheets/plugins/ecommerce/front.scss +36 -0
- data/app/controllers/plugins/ecommerce/admin/coupons_controller.rb +61 -0
- data/app/controllers/plugins/ecommerce/admin/orders_controller.rb +96 -0
- data/app/controllers/plugins/ecommerce/admin/payment_methods_controller.rb +90 -0
- data/app/controllers/plugins/ecommerce/admin/prices_controller.rb +70 -0
- data/app/controllers/plugins/ecommerce/admin/settings_controller.rb +22 -0
- data/app/controllers/plugins/ecommerce/admin/shipping_methods_controller.rb +62 -0
- data/app/controllers/plugins/ecommerce/admin/tax_rates_controller.rb +61 -0
- data/app/controllers/plugins/ecommerce/admin_controller.rb +20 -0
- data/app/controllers/plugins/ecommerce/front/checkout_controller.rb +166 -0
- data/app/controllers/plugins/ecommerce/front/orders_controller.rb +255 -0
- data/app/controllers/plugins/ecommerce/front_controller.rb +18 -0
- data/app/helpers/plugins/ecommerce/ecommerce_email_helper.rb +46 -0
- data/app/helpers/plugins/ecommerce/ecommerce_functions_helper.rb +49 -0
- data/app/helpers/plugins/ecommerce/ecommerce_helper.rb +240 -0
- data/app/helpers/plugins/ecommerce/ecommerce_payment_helper.rb +67 -0
- data/app/models/plugins/ecommerce/cart.rb +40 -0
- data/app/models/plugins/ecommerce/coupon.rb +25 -0
- data/app/models/plugins/ecommerce/coupon_decorator.rb +60 -0
- data/app/models/plugins/ecommerce/order.rb +65 -0
- data/app/models/plugins/ecommerce/order_decorator.rb +54 -0
- data/app/models/plugins/ecommerce/order_detail.rb +13 -0
- data/app/models/plugins/ecommerce/payment_method.rb +29 -0
- data/app/models/plugins/ecommerce/product.rb +14 -0
- data/app/models/plugins/ecommerce/shipping_method.rb +26 -0
- data/app/models/plugins/ecommerce/tax_rate.rb +18 -0
- data/app/views/camaleon_cms/html_mailer/order_received.html.erb +3 -0
- data/app/views/camaleon_cms/html_mailer/order_received_admin.html.erb +3 -0
- data/app/views/camaleon_cms/html_mailer/recovery_cart.html.erb +4 -0
- data/app/views/layouts/plugins/ecommerce/mailer.html.erb +22 -0
- data/app/views/plugins/ecommerce/admin/coupons/form.html.erb +73 -0
- data/app/views/plugins/ecommerce/admin/coupons/index.html.erb +50 -0
- data/app/views/plugins/ecommerce/admin/index.html.erb +2 -0
- data/app/views/plugins/ecommerce/admin/orders/form.html.erb +64 -0
- data/app/views/plugins/ecommerce/admin/orders/index.html.erb +90 -0
- data/app/views/plugins/ecommerce/admin/orders/show.html.erb +173 -0
- data/app/views/plugins/ecommerce/admin/payment_methods/form.html.erb +115 -0
- data/app/views/plugins/ecommerce/admin/payment_methods/index.html.erb +43 -0
- data/app/views/plugins/ecommerce/admin/payment_methods/show.html.erb +70 -0
- data/app/views/plugins/ecommerce/admin/prices/form.html.erb +49 -0
- data/app/views/plugins/ecommerce/admin/prices/index.html.erb +39 -0
- data/app/views/plugins/ecommerce/admin/prices/show.html.erb +19 -0
- data/app/views/plugins/ecommerce/admin/products/index.html.erb +114 -0
- data/app/views/plugins/ecommerce/admin/settings/index.html.erb +25 -0
- data/app/views/plugins/ecommerce/admin/shipping_methods/form.html.erb +39 -0
- data/app/views/plugins/ecommerce/admin/shipping_methods/index.html.erb +41 -0
- data/app/views/plugins/ecommerce/admin/shipping_methods/show.html.erb +22 -0
- data/app/views/plugins/ecommerce/admin/tax_rates/form.html.erb +36 -0
- data/app/views/plugins/ecommerce/admin/tax_rates/index.html.erb +41 -0
- data/app/views/plugins/ecommerce/front/_post_list_item.html.erb +18 -0
- data/app/views/plugins/ecommerce/front/checkout/cart_index.html.erb +59 -0
- data/app/views/plugins/ecommerce/front/checkout/index.html.erb +166 -0
- data/app/views/plugins/ecommerce/front/index.html.erb +2 -0
- data/app/views/plugins/ecommerce/front/list_products.html.erb +34 -0
- data/app/views/plugins/ecommerce/front/orders/index.html.erb +46 -0
- data/app/views/plugins/ecommerce/front/orders/pay_by_bank_transfer.html.erb +67 -0
- data/app/views/plugins/ecommerce/front/orders/pay_by_credit_card.html.erb +131 -0
- data/app/views/plugins/ecommerce/front/orders/pay_by_credit_card_authorize_net.erb +150 -0
- data/app/views/plugins/ecommerce/front/orders/select_payment.html.erb +70 -0
- data/app/views/plugins/ecommerce/front/orders/show.html.erb +76 -0
- data/app/views/plugins/ecommerce/front/product.html.erb +105 -0
- data/app/views/plugins/ecommerce/layouts/_ecommerce.html.erb +41 -0
- data/app/views/plugins/ecommerce/partials/_form_address.html.erb +84 -0
- data/app/views/plugins/ecommerce/partials/_table_order_products.html.erb +85 -0
- data/config/camaleon_plugin.json +48 -0
- data/config/currency.json +154 -0
- data/config/currency_en.json +154 -0
- data/config/currency_es.json +154 -0
- data/config/custom_models.rb +64 -0
- data/config/locales/readme.txt +1 -0
- data/config/locales/translation.yml +371 -0
- data/config/routes.rb +57 -0
- data/lib/camaleon_ecommerce.rb +4 -0
- data/lib/ecommerce.rb +4 -0
- data/lib/ecommerce/engine.rb +6 -0
- data/lib/ecommerce/version.rb +3 -0
- data/lib/tasks/ecommerce_tasks.rake +4 -0
- metadata +185 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h4><span class="fa fa-credit-card"></span> <%= t('plugin.ecommerce.payment_methods') %></h4>
|
4
|
+
<%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_payment_method')}"), {action: :new}, class: "btn btn-primary pull-right" %>
|
5
|
+
</div>
|
6
|
+
<div class="panel-body">
|
7
|
+
|
8
|
+
<table class="table">
|
9
|
+
<thead>
|
10
|
+
<tr>
|
11
|
+
<th id=""><%= t('plugin.ecommerce.table.id') %></th>
|
12
|
+
<th id=""><%= t('plugin.ecommerce.table.name') %></th>
|
13
|
+
<th id=""><%= t('plugin.ecommerce.table.method_type') %></th>
|
14
|
+
<th id=""><%= t('plugin.ecommerce.table.status') %></th>
|
15
|
+
<th id=""><%= t('plugin.ecommerce.table.description') %></th>
|
16
|
+
<th><%= t('plugin.ecommerce.table.actions') %></th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
<%
|
21
|
+
@payment_methods.each do |row|
|
22
|
+
row = row.decorate
|
23
|
+
%>
|
24
|
+
<tr>
|
25
|
+
<td><%= row.slug %></td>
|
26
|
+
<td><%= row.name %></td>
|
27
|
+
<td><%= row.method_text %></td>
|
28
|
+
<td><%= raw row.the_status %></td>
|
29
|
+
<td><%= row.description %></td>
|
30
|
+
<td>
|
31
|
+
<%= link_to raw('<i class="fa fa-eye"></i>'), {action: :show, id: row.id}, class: "btn btn-info btn-xs", title: "#{t('camaleon_cms.admin.button.preview')}" %>
|
32
|
+
<%= link_to raw('<i class="fa fa-edit"></i>'), {action: :edit, id: row.id}, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" %>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
|
+
<%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @payment_methods.empty? %>
|
41
|
+
<%= will_paginate @payment_methods, renderer: BootstrapPagination::Rails %>
|
42
|
+
</div>
|
43
|
+
</div>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h4><span class="fa fa-credit-card"></span> <%= @payment_method.name %></h4>
|
4
|
+
<%= link_to raw("<i class='fa fa-edit'></i> #{t('plugin.ecommerce.edit_payment_methods')}"), {action: :edit, id: @payment_method.id}, class: "btn btn-primary pull-right" %>
|
5
|
+
</div>
|
6
|
+
<div class="panel-body">
|
7
|
+
<div class="row">
|
8
|
+
<div class="col-md-6">
|
9
|
+
<h3><%= t('plugin.ecommerce.info') %></h3>
|
10
|
+
<ul class="ec-list-orders-address">
|
11
|
+
<li><strong><%= t('plugin.ecommerce.table.name') %>:</strong> <span> <%= @payment_method.name %></span></li>
|
12
|
+
<li><strong><%= t('plugin.ecommerce.table.description') %>:</strong> <span> <%= @payment_method.description %></span></li>
|
13
|
+
<li><strong><%= t('plugin.ecommerce.status') %>:</strong> <span> <%= raw @payment_method.the_status %></span></li>
|
14
|
+
</ul>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="col-md-6">
|
18
|
+
<% if @payment_method.options[:type] == 'paypal' %>
|
19
|
+
<h3><%= t('plugin.ecommerce.method_paypal') %></h3>
|
20
|
+
<ul class="ec-list-orders-address">
|
21
|
+
<li><strong><%= t('plugin.ecommerce.table.login') %>:</strong> <span> <%= @payment_method.options[:paypal_login] %></span></li>
|
22
|
+
<li><strong><%= t('plugin.ecommerce.table.password') %>:</strong> <span> <%= @payment_method.options[:paypal_password] %></span></li>
|
23
|
+
<li><strong><%= t('plugin.ecommerce.table.signature') %>:</strong> <span> <%= @payment_method.options[:paypal_signature] %></span></li>
|
24
|
+
<li><strong><%= t('plugin.ecommerce.table.sandbox') %>:</strong> <span> <%= @payment_method.options[:paypal_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span></li>
|
25
|
+
</ul>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<% if @payment_method.options[:type] == 'credit_card' %>
|
29
|
+
<h3><%= t('plugin.ecommerce.method_credit_card') %></h3>
|
30
|
+
<ul class="ec-list-orders-address">
|
31
|
+
<li><strong><%= t('plugin.ecommerce.table.login') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_login] %></span></li>
|
32
|
+
<li><strong><%= t('plugin.ecommerce.table.password') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_password] %></span></li>
|
33
|
+
<li><strong><%= t('plugin.ecommerce.table.signature') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_signature] %></span></li>
|
34
|
+
<li><strong><%= t('plugin.ecommerce.table.sandbox') %>:</strong> <span> <%= @payment_method.options[:cc_paypal_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span></li>
|
35
|
+
</ul>
|
36
|
+
<% end %>
|
37
|
+
|
38
|
+
<% if @payment_method.options[:type] == 'bank_transfer' %>
|
39
|
+
<h3><%= t('plugin.ecommerce.method_bank_transfer') %></h3>
|
40
|
+
<ul class="ec-list-orders-address">
|
41
|
+
<li><strong><%= t('plugin.ecommerce.table.number_account_bank') %>:</strong> <span> <%= @payment_method.options[:bank_transfer_number_account] %></span></li>
|
42
|
+
<li><strong><%= t('plugin.ecommerce.table.details') %>:</strong> <span> <%= @payment_method.options[:bank_transfer_detail] %></span></li>
|
43
|
+
</ul>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% if @payment_method.options[:type] == 'authorize_net' %>
|
47
|
+
<h3><%= t('plugin.ecommerce.method_authorize_net') %></h3>
|
48
|
+
<ul class="ec-list-orders-address">
|
49
|
+
<li>
|
50
|
+
<strong><%= t('plugin.ecommerce.table.login_id') %>:</strong>
|
51
|
+
<span> <%= @payment_method.options[:authorize_net_login_id] %></span>
|
52
|
+
</li>
|
53
|
+
<li>
|
54
|
+
<strong><%= t('plugin.ecommerce.table.transaction_key') %>:</strong>
|
55
|
+
<span> <%= @payment_method.options[:authorize_net_transaction_key] %></span>
|
56
|
+
</li>
|
57
|
+
<li>
|
58
|
+
<strong><%= t('plugin.ecommerce.table.sandbox') %>:</strong>
|
59
|
+
<span> <%= @payment_method.options[:authorize_net_sandbox].to_s.to_bool ? 'Yes' : 'No' %></span>
|
60
|
+
</li>
|
61
|
+
</ul>
|
62
|
+
<% end %>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
</div>
|
67
|
+
<div class="panel-footer">
|
68
|
+
<a class="btn btn-default" role="back" href="<%= url_for action: :index %>"><%= t('camaleon_cms.admin.button.back')%></a>
|
69
|
+
</div>
|
70
|
+
</div>
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<div class="page-title">
|
2
|
+
<h2><span class="fa fa-usd"></span> <%= !@price[:id].present? ? t('plugin.ecommerce.add_price') : "#{t('plugin.ecommerce.edit_price')}: #{@price[:code]}" %></h2>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<!-- PAGE CONTENT WRAPPER -->
|
6
|
+
<div class="page-content-wrap">
|
7
|
+
|
8
|
+
<div class="row">
|
9
|
+
<div class="col-md-8 col-md-offset-2">
|
10
|
+
<div class="panel panel-default">
|
11
|
+
<div class="panel-heading ui-draggable-handle">
|
12
|
+
<h3 class="panel-title"><%= t('plugin.ecommerce.form_price') %></h3>
|
13
|
+
</div>
|
14
|
+
<%#= form_tag ({url:{action: @price.blank? ? :create : :update}}, :method => "post", :class => "form" ) do %>
|
15
|
+
<%= form_tag(@price[:id].present? ? {action: :update, id: @price[:id]} : {action: :create}, :method => @price[:id].present? ? "patch" :"post", :class => "validate-price") do %>
|
16
|
+
<div class="panel-body">
|
17
|
+
<div class="row">
|
18
|
+
|
19
|
+
<div class="form-group col-md-6">
|
20
|
+
<label><%= t('plugin.ecommerce.table.code') %></label><br>
|
21
|
+
<%= text_field_tag( "price[code]", @price[:code], class: "form-control required") %>
|
22
|
+
</div>
|
23
|
+
<div class="form-group col-md-6">
|
24
|
+
<label><%= t('plugin.ecommerce.product.price') %> </label> (<%= current_site.current_unit %>)<br>
|
25
|
+
<%= number_field_tag( "price[price]", @price[:price], class: "form-control required") %>
|
26
|
+
</div>
|
27
|
+
<div class="form-group col-md-6">
|
28
|
+
<label><%= t('plugin.ecommerce.table.min_weight') %> </label> (<%= current_site.current_weight %>)<br>
|
29
|
+
<%= number_field_tag( "price[min_weight]", @price[:min_weight], class: "form-control required") %>
|
30
|
+
</div>
|
31
|
+
<div class="form-group col-md-6">
|
32
|
+
<label><%= t('plugin.ecommerce.table.max_weight') %> </label> (<%= current_site.current_weight %>)<br>
|
33
|
+
<%= number_field_tag( "price[max_weight]", @price[:max_weight], class: "form-control required") %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
<div class="panel-footer">
|
39
|
+
<a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a>
|
40
|
+
<button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit')%></button>
|
41
|
+
</div>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h4><span class="fa fa-usd"></span> <%= t('plugin.ecommerce.product.price') %></h4>
|
4
|
+
<%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_price')}"), {action: :new}, class: "btn btn-primary pull-right" %>
|
5
|
+
</div>
|
6
|
+
<div class="panel-body">
|
7
|
+
|
8
|
+
<table class="table">
|
9
|
+
<thead>
|
10
|
+
<tr>
|
11
|
+
<th><%= t('plugin.ecommerce.table.code')%></th>
|
12
|
+
<th><%= t('plugin.ecommerce.product.price')%></th>
|
13
|
+
<th><%= t('plugin.ecommerce.table.min_weight') %></th>
|
14
|
+
<th><%= t('plugin.ecommerce.table.max_weight') %></th>
|
15
|
+
<th><%= t('plugin.ecommerce.table.actions') %></th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<%
|
20
|
+
@prices.each do |id, row|
|
21
|
+
%>
|
22
|
+
<tr>
|
23
|
+
<td><%= row[:code] %></td>
|
24
|
+
<td><%= current_site.current_unit %> <%= row[:price] %></td>
|
25
|
+
<td><%= row[:min_weight] %> <%= current_site.current_weight %></td>
|
26
|
+
<td><%= row[:max_weight] %> <%= current_site.current_weight %></td>
|
27
|
+
<td>
|
28
|
+
<%= link_to raw('<i class="fa fa-edit"></i>'), {action: :edit, id: row[:id] }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" %>
|
29
|
+
<%= link_to raw('<i class="fa fa-times"></i>'), {action: :destroy, id: row[:id] }, method: :delete, data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" %>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
|
35
|
+
</tbody>
|
36
|
+
</table>
|
37
|
+
<%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @prices.empty? %>
|
38
|
+
</div>
|
39
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h4> Shipping details</h4>
|
4
|
+
<%= link_to raw("<i class='fa fa-edit'></i> Edit Shipping Method"), {action: :edit, id: @shipping_method.id}, class: "btn btn-primary pull-right" %>
|
5
|
+
</div>
|
6
|
+
<div class="panel-body">
|
7
|
+
<div class="row">
|
8
|
+
<div class="col-md-6">
|
9
|
+
<h3>Info</h3>
|
10
|
+
<ul class="ec-list-orders-address">
|
11
|
+
<li><strong>Name:</strong> <span> <%= @shipping_method.name %></span></li>
|
12
|
+
<li><strong>Description:</strong> <span> <%= @shipping_method.description %></span></li>
|
13
|
+
</ul>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
</div>
|
17
|
+
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -0,0 +1,114 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h4 class=""><%= t('camaleon_cms.admin.page_title.list_of') %> <%= @post_type.decorate.the_title.pluralize %> </h4>
|
4
|
+
<%= link_to raw("<i class='fa fa-plus'></i> #{t('camaleon_cms.admin.post_type.add')} #{@post_type.decorate.the_title}"), {action: :new}, class: "btn btn-primary pull-right" if can? :create_post, @post_type %>
|
5
|
+
</div>
|
6
|
+
<div class="panel-body">
|
7
|
+
|
8
|
+
<div class="row" style="margin-bottom: 16px">
|
9
|
+
<div class="col-md-9">
|
10
|
+
<%= render partial: "camaleon_cms/admin/posts/filter_posts" %>
|
11
|
+
</div>
|
12
|
+
<div class="col-md-3">
|
13
|
+
<form action="<%= url_for(action: :index) %>" method="get">
|
14
|
+
<div class="input-group">
|
15
|
+
<input type="text" class="form-control" name="q" value="<%= params[:q] %>">
|
16
|
+
<span class="input-group-btn"><button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button></span>
|
17
|
+
</div>
|
18
|
+
</form>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
|
22
|
+
</div>
|
23
|
+
<table class="table table-hover ecomerce" id="posts-table-list">
|
24
|
+
<thead>
|
25
|
+
<tr>
|
26
|
+
<th><%= t('plugin.ecommerce.product.sku') %></th>
|
27
|
+
<th><%= t('camaleon_cms.admin.table.title') %></th>
|
28
|
+
<th><%= t('camaleon_cms.admin.table.status') %></th>
|
29
|
+
<th><%= t('plugin.ecommerce.product.price') %></th>
|
30
|
+
<th><%= t('plugin.ecommerce.product.weight') %></th>
|
31
|
+
<th><%= t('plugin.ecommerce.product.stock') %></th>
|
32
|
+
<th><%= t('plugin.ecommerce.product.qty') %></th>
|
33
|
+
<th><%= t('camaleon_cms.admin.table.author')%></th>
|
34
|
+
<% if @post_type.manage_categories? %>
|
35
|
+
<th><%= t('camaleon_cms.admin.table.categories')%></th>
|
36
|
+
<% end %>
|
37
|
+
<% if @post_type.manage_tags? %>
|
38
|
+
<th><%= t('camaleon_cms.admin.table.tags')%></th>
|
39
|
+
<% end %>
|
40
|
+
<% extra_column = {post_type: @post_type, content: "", from_body: false}; hooks_run("list_post_extra_columns", extra_column) %>
|
41
|
+
<%= raw extra_column[:content] %>
|
42
|
+
<th style="width: 98px; text-align: right"><%= t('camaleon_cms.admin.table.actions')%></th>
|
43
|
+
</tr>
|
44
|
+
</thead>
|
45
|
+
<tbody>
|
46
|
+
<% @posts.eager_load(:categories, :post_tags).each do |f| f = f.decorate %>
|
47
|
+
<tr data-id="<%= f.id %>" class="<%= "sortable" if can? :update, f %>">
|
48
|
+
<td><%= f.the_sku %></td>
|
49
|
+
<td>
|
50
|
+
<% if !f.trash? && (can? :update, f) %>
|
51
|
+
<%= link_to f.the_title, {action: :edit, id: f.id }, class: "" %>
|
52
|
+
<% else %>
|
53
|
+
<%= f.the_title %>
|
54
|
+
<% end %>
|
55
|
+
<%= "*" + " (is #{@post_type.the_title} #{f.parent.decorate.the_title})" if f.draft? && f.parent.present? %>
|
56
|
+
</td>
|
57
|
+
<td><%= link_to raw(f.the_status), {action: :index, s: f.status } %> </td>
|
58
|
+
|
59
|
+
<td><%= f.the_price %></td>
|
60
|
+
<td><%= f.the_weight %></td>
|
61
|
+
<td><%= raw f.the_stock_status %></td>
|
62
|
+
<td><%= f.the_qty %></td>
|
63
|
+
|
64
|
+
<td><%= f.author.fullname %></td>
|
65
|
+
<% if @post_type.manage_categories? %>
|
66
|
+
<td><%= raw post_type_list_taxonomy(f.categories, "success") %></td>
|
67
|
+
<% end %>
|
68
|
+
<% if @post_type.manage_tags? %>
|
69
|
+
<td><%= raw post_type_list_taxonomy(f.post_tags, "default") %></td>
|
70
|
+
<% end %>
|
71
|
+
<% extra_column = {post: f, post_type: @post_type, content: "", from_body: true}; hooks_run("list_post_extra_columns", extra_column) %>
|
72
|
+
<%= raw extra_column[:content] %>
|
73
|
+
<td style="text-align: right">
|
74
|
+
<% if f.published? %>
|
75
|
+
<% if f.slug.to_s.translations.present? %>
|
76
|
+
<div class="btn-group">
|
77
|
+
<button class="btn btn-info btn-xs dropdown-toggle e-co" data-toggle="dropdown" aria-expanded="false" title="<%= t('camaleon_cms.admin.button.preview') %>"><i class="fa fa-eye"></i> </button>
|
78
|
+
<ul class="dropdown-menu" style="min-width: 50px;">
|
79
|
+
<% f.slug.to_s.translations.each do |locale, slug| %>
|
80
|
+
<li><a href="<%= url_to_fixed("post_path", slug: slug, locale: locale) %>" target="_blank"><%= locale.to_s.upcase %></a></li>
|
81
|
+
<% end %>
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
<% else %>
|
85
|
+
<a href="<%= f.the_url %>" class="btn btn-info btn-xs e-co" target="_blank" title="<%= t('camaleon_cms.admin.button.preview') %>"><i class="fa fa-eye"></i></a>
|
86
|
+
<% end %>
|
87
|
+
<% end %>
|
88
|
+
|
89
|
+
<% if f.trash? %>
|
90
|
+
<%= link_to raw('<i class="fa fa-check"></i>'), {action: :restore, post_id: f.id, s: params[:s] }, class: "btn btn-success btn-xs", title: "#{t('camaleon_cms.admin.button.restore')}" if can? :update, f %>
|
91
|
+
<%= link_to raw('<i class="fa fa-times"></i>'), { action: :destroy, id: f.id, s: params[:s] },
|
92
|
+
method: :delete, data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" if can? :destroy, f %>
|
93
|
+
<% elsif f.draft? %>
|
94
|
+
<%= link_to raw('<i class="fa fa-check"></i>'), {action: :edit, id: f.id, recover_draft: 'true' }, class: "btn btn-success btn-xs", title: "#{t('camaleon_cms.admin.button.recover')}" if can? :update, f %>
|
95
|
+
<%= link_to raw('<i class="fa fa-pencil"></i>'), {action: :edit, id: f.id }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" if can? :update, f %>
|
96
|
+
<%= link_to raw('<i class="fa fa-trash"></i>'), { action: :trash, post_id: f.id, s: params[:s] },
|
97
|
+
data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" if can? :destroy, f %>
|
98
|
+
|
99
|
+
<% else %>
|
100
|
+
<%= link_to raw('<i class="fa fa-pencil"></i>'), {action: :edit, id: f.id }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" if can? :update, f %>
|
101
|
+
<%= link_to raw('<i class="fa fa-trash"></i>'), { action: :trash, post_id: f.id, s: params[:s] },
|
102
|
+
data: { confirm: t('camaleon_cms.admin.message.delete') }, class: "btn btn-danger btn-xs", title: "#{t('camaleon_cms.admin.button.delete')}" if can? :destroy, f %>
|
103
|
+
<% end %>
|
104
|
+
|
105
|
+
</td>
|
106
|
+
</tr>
|
107
|
+
<% end %>
|
108
|
+
|
109
|
+
</tbody>
|
110
|
+
</table>
|
111
|
+
<%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @posts.empty? %>
|
112
|
+
<%= will_paginate @posts, renderer: BootstrapPagination::Rails if @posts.present? %>
|
113
|
+
</div>
|
114
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading ui-draggable-handle">
|
3
|
+
<h4><span class="fa fa-cogs"></span> <%= t('plugin.ecommerce.e_commerce_settings') %></h4>
|
4
|
+
</div>
|
5
|
+
<%#= form_tag ({url:{action: @price.blank? ? :create : :update}}, :method => "post", :class => "form" ) do %>
|
6
|
+
<%= form_tag(action: :saved, :method => "post", :class => "validate-settings") do %>
|
7
|
+
<div class="panel-body">
|
8
|
+
|
9
|
+
<div class="form-group col-md-6">
|
10
|
+
<label><%= t('plugin.ecommerce.table.currency_unit') %></label><br>
|
11
|
+
<%= select_tag( "setting[current_unit]", options_for_select(e_get_currency_units.collect{|k, x| ["#{x['name']} (#{x['symbol']})", x['code']]}, @setting[:current_unit] || 'USD'), class: "form-control required") %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="form-group col-md-6">
|
15
|
+
<label><%= t('plugin.ecommerce.table.currency_weight') %></label><br>
|
16
|
+
<%= select_tag( "setting[current_weight]", options_for_select(e_get_currency_weight.collect{|k,x| ["#{x['name']} (#{x['code']})", x['code']]}, @setting[:current_weight] || 'kg'), class: "form-control required") %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
</div>
|
20
|
+
<div class="panel-footer">
|
21
|
+
<a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a>
|
22
|
+
<button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit')%></button>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading ui-draggable-handle">
|
3
|
+
<h4><span class="fa fa-credit-card"></span> <%= @shipping_method.new_record? ? t('plugin.ecommerce.new_shipping_methods') : "#{t('plugin.ecommerce.edit_shipping_methods')}: #{@shipping_method.name}" %></h4>
|
4
|
+
</div>
|
5
|
+
<%= form_for @shipping_method, url:{action: @shipping_method.new_record? ? :create : :update}, html: {class: 'validate-shipping_method', id: 'form-shipping_method'} do |f| %>
|
6
|
+
<div class="panel-body">
|
7
|
+
<%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @shipping_method} %>
|
8
|
+
<div class="form-group">
|
9
|
+
<%= f.label t('plugin.ecommerce.table.name') %><br>
|
10
|
+
<%= f.text_field :name, :class => "form-control required" %>
|
11
|
+
</div>
|
12
|
+
<div class="form-group">
|
13
|
+
<%= f.label t('camaleon_cms.admin.table.slug') %><br>
|
14
|
+
<%= f.text_field :slug, :class => "form-control slug", "data-parent" => 'plugins_ecommerce_shipping_method_name' %>
|
15
|
+
</div>
|
16
|
+
<div class="form-group">
|
17
|
+
<%= f.label t('camaleon_cms.admin.table.description') %><br>
|
18
|
+
<%= f.text_area :description, :class => "form-control", :rows => 4 %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<% options = @shipping_method.options rescue {url_tracking: 'http://trackingurl.com/track/{{consignment_number}}'}
|
22
|
+
options = params[:options] if params[:options].present?
|
23
|
+
%>
|
24
|
+
<div class="form-group">
|
25
|
+
<label><%= t('plugin.ecommerce.table.url_tracking') %></label><br>
|
26
|
+
<%= text_field_tag( "options[url_tracking]", options[:url_tracking], class: "form-control required") %>
|
27
|
+
<small><%= t('plugin.ecommerce.message.consignment_number') %></small>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div class="form-group">
|
31
|
+
<label><%= f.check_box :status %> <%= t('plugin.ecommerce.active') %></label>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
<div class="panel-footer">
|
35
|
+
<a class="btn btn-default" href="<%= url_for action: :index %>" role="back"><%= t('camaleon_cms.admin.button.back')%></a>
|
36
|
+
<button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit')%></button>
|
37
|
+
</div>
|
38
|
+
<% end %>
|
39
|
+
</div>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<div class="panel panel-default">
|
2
|
+
<div class="panel-heading">
|
3
|
+
<h4><span class="fa fa-credit-card"></span> <%= t('plugin.ecommerce.shipping_methods') %> </h4>
|
4
|
+
<%= link_to raw("<i class='fa fa-plus'></i> #{t('plugin.ecommerce.add_shipping_methods')}"), {action: :new}, class: "btn btn-primary pull-right" %>
|
5
|
+
</div>
|
6
|
+
<div class="panel-body">
|
7
|
+
|
8
|
+
<table class="table">
|
9
|
+
<thead>
|
10
|
+
<tr>
|
11
|
+
<th id=""><%= t('plugin.ecommerce.table.id') %></th>
|
12
|
+
<th id=""><%= t('plugin.ecommerce.table.name') %></th>
|
13
|
+
<th id=""><%= t('plugin.ecommerce.table.status') %></th>
|
14
|
+
<th id=""><%= t('plugin.ecommerce.table.description') %></th>
|
15
|
+
<th><%= t('plugin.ecommerce.table.actions') %></th>
|
16
|
+
</tr>
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<%
|
20
|
+
@shipping_methods.each do |row|
|
21
|
+
%>
|
22
|
+
<tr>
|
23
|
+
<td><%= row.slug %></td>
|
24
|
+
<td><%= row.name %></td>
|
25
|
+
<td><%= row.status %></td>
|
26
|
+
<td><%= row.description %></td>
|
27
|
+
<td>
|
28
|
+
<%= link_to raw('<i class="fa fa-eye"></i>'), {action: :show, id: row.id }, class: "btn btn-info btn-xs", title: "#{t('camaleon_cms.admin.button.preview')}" %>
|
29
|
+
<%= link_to raw('<i class="fa fa-usd"></i> ' + "#{t('plugin.ecommerce.product.price')}"), admin_plugins_ecommerce_shipping_method_prices_path(row.id), class: "btn btn-primary btn-xs" %>
|
30
|
+
<%= link_to raw('<i class="fa fa-edit"></i>'), {action: :edit, id: row.id }, class: "btn btn-default btn-xs", title: "#{t('camaleon_cms.admin.button.edit')}" %>
|
31
|
+
</td>
|
32
|
+
</tr>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
|
36
|
+
</tbody>
|
37
|
+
</table>
|
38
|
+
<%= content_tag("div", raw(t('camaleon_cms.admin.message.data_found_list')), class: "alert alert-warning") if @shipping_methods.empty? %>
|
39
|
+
<%= will_paginate @shipping_methods, renderer: BootstrapPagination::Rails %>
|
40
|
+
</div>
|
41
|
+
</div>
|