vyapari 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +49 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/config/vyapari_manifest.js +2 -0
  6. data/app/assets/javascripts/vyapari/application.js +13 -0
  7. data/app/assets/stylesheets/vyapari/application.css +15 -0
  8. data/app/controllers/vyapari/admin/base_controller.rb +17 -0
  9. data/app/controllers/vyapari/admin/countries_controller.rb +64 -0
  10. data/app/controllers/vyapari/admin/dashboard_controller.rb +26 -0
  11. data/app/controllers/vyapari/admin/exchange_rates_controller.rb +70 -0
  12. data/app/controllers/vyapari/admin/regions_controller.rb +67 -0
  13. data/app/controllers/vyapari/admin/resource_controller.rb +15 -0
  14. data/app/controllers/vyapari/admin/users_controller.rb +130 -0
  15. data/app/controllers/vyapari/application_controller.rb +13 -0
  16. data/app/helpers/vyapari/application_helper.rb +4 -0
  17. data/app/jobs/vyapari/application_job.rb +4 -0
  18. data/app/mailers/vyapari/application_mailer.rb +6 -0
  19. data/app/models/brand.rb +114 -0
  20. data/app/models/category.rb +116 -0
  21. data/app/models/country.rb +45 -0
  22. data/app/models/exchange_rate.rb +38 -0
  23. data/app/models/product.rb +139 -0
  24. data/app/models/region.rb +58 -0
  25. data/app/models/vyapari/application_record.rb +6 -0
  26. data/app/views/layouts/kuppayam/_footer.html.erb +25 -0
  27. data/app/views/layouts/kuppayam/_header.html.erb +43 -0
  28. data/app/views/layouts/kuppayam/_navbar.html.erb +55 -0
  29. data/app/views/layouts/kuppayam/_sidebar.html.erb +136 -0
  30. data/app/views/vyapari/admin/countries/_form.html.erb +24 -0
  31. data/app/views/vyapari/admin/countries/_index.html.erb +51 -0
  32. data/app/views/vyapari/admin/countries/_row.html.erb +26 -0
  33. data/app/views/vyapari/admin/countries/_show.html.erb +73 -0
  34. data/app/views/vyapari/admin/countries/index.html.erb +32 -0
  35. data/app/views/vyapari/admin/dashboard/index.html.erb +52 -0
  36. data/app/views/vyapari/admin/exchange_rates/_form.html.erb +28 -0
  37. data/app/views/vyapari/admin/exchange_rates/_index.html.erb +57 -0
  38. data/app/views/vyapari/admin/exchange_rates/_row.html.erb +30 -0
  39. data/app/views/vyapari/admin/exchange_rates/_show.html.erb +72 -0
  40. data/app/views/vyapari/admin/exchange_rates/index.html.erb +32 -0
  41. data/app/views/vyapari/admin/regions/_form.html.erb +28 -0
  42. data/app/views/vyapari/admin/regions/_index.html.erb +54 -0
  43. data/app/views/vyapari/admin/regions/_row.html.erb +28 -0
  44. data/app/views/vyapari/admin/regions/_show.html.erb +74 -0
  45. data/app/views/vyapari/admin/regions/index.html.erb +32 -0
  46. data/app/views/vyapari/admin/users/_form.html.erb +39 -0
  47. data/app/views/vyapari/admin/users/_index.html.erb +101 -0
  48. data/app/views/vyapari/admin/users/_row.html.erb +72 -0
  49. data/app/views/vyapari/admin/users/_show.html.erb +199 -0
  50. data/app/views/vyapari/admin/users/index.html.erb +64 -0
  51. data/config/routes.rb +28 -0
  52. data/db/migrate/20170000000200_create_exchange_rates.rb +16 -0
  53. data/db/migrate/20170000000201_create_countries.rb +12 -0
  54. data/db/migrate/20170000000202_create_regions.rb +16 -0
  55. data/lib/tasks/vyapari_tasks.rake +4 -0
  56. data/lib/vyapari/engine.rb +20 -0
  57. data/lib/vyapari/version.rb +3 -0
  58. data/lib/vyapari.rb +5 -0
  59. metadata +401 -0
@@ -0,0 +1,24 @@
1
+ <%= form_for([:admin, @country], :html => {:id=>"form_country", :class=>"mb-0 form-horizontal", :country => "form", :method => (@country.new_record? ? :post : :put), :remote=>true}) do |f| %>
2
+
3
+ <div id="country_form_error">
4
+ <%= @country.errors[:base].to_sentence %>
5
+ </div>
6
+
7
+ <div class="form-inputs mb-30 mt-30">
8
+ <%= theme_form_field(@country, :name) %>
9
+ <%= theme_form_field(@country, :code) %>
10
+ </div>
11
+
12
+ <div>
13
+
14
+ <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
15
+
16
+ <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>
17
+
18
+ </div>
19
+ <%= clear_tag(10) %>
20
+
21
+ </div>
22
+
23
+ <% end %>
24
+
@@ -0,0 +1,51 @@
1
+ <div class="table-responsive">
2
+ <table class="table table-hover members-table middle-align">
3
+ <thead>
4
+ <tr>
5
+ <th style="text-align: center;width:20px">#</th>
6
+ <th>Name</th>
7
+ <th>Code</th>
8
+ <th style="text-align: center;">Actions</th>
9
+ </tr>
10
+ </thead>
11
+
12
+ <tbody>
13
+ <% @countries.each_with_index do |country, i| %>
14
+
15
+ <% edit_link = edit_admin_country_path(id: country.id) %>
16
+ <% delete_link = admin_country_path(id: country.id) %>
17
+
18
+ <tr id="tr_country_<%= country.id %>">
19
+
20
+ <th scope="row" style="text-align: center;">
21
+ <% if i < 0 %>
22
+ <i class="fa fa-check text-success"></i>
23
+ <% else %>
24
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
25
+ <% end %>
26
+ </th>
27
+
28
+ <td class="country-name"><%= link_to country.name, admin_country_path(country), remote: true %></td>
29
+
30
+ <td class="country-name"><%= link_to country.code, admin_country_path(country), remote: true %></td>
31
+
32
+ <td class="action-links" style="width:10%">
33
+
34
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Country"), edit_link, :remote=>true, class: "edit" %>
35
+
36
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, country: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
37
+
38
+ </td>
39
+
40
+ </tr>
41
+ <% end %>
42
+ </tbody>
43
+ </table>
44
+ </div>
45
+
46
+ <div class="row">
47
+ <div class="col-sm-12">
48
+ <%= paginate_kuppayam(@countries) %>
49
+ </div>
50
+ </div>
51
+
@@ -0,0 +1,26 @@
1
+ <% edit_link = edit_admin_country_path(id: country.id) %>
2
+ <% delete_link = admin_country_path(id: country.id) %>
3
+
4
+ <tr id="tr_country_<%= country.id %>">
5
+
6
+ <th scope="row" style="text-align: center;">
7
+ <% if i < 0 %>
8
+ <i class="fa fa-check text-success"></i>
9
+ <% else %>
10
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
11
+ <% end %>
12
+ </th>
13
+
14
+ <td class="country-name"><%= link_to country.name, admin_country_path(country), remote: true %></td>
15
+
16
+ <td class="country-name"><%= link_to country.code, admin_country_path(country), remote: true %></td>
17
+
18
+ <td class="action-links" style="width:10%">
19
+
20
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Country"), edit_link, :remote=>true, class: "edit" %>
21
+
22
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, country: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
23
+
24
+ </td>
25
+
26
+ </tr>
@@ -0,0 +1,73 @@
1
+ <div id="div_country_show">
2
+
3
+ <div class="row">
4
+
5
+ <div class="col-md-9 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
6
+
7
+ <div class="visible-sm visible-xs mt-50"></div>
8
+
9
+ <%= theme_panel_heading(@country.display_name) %>
10
+ <%= theme_panel_sub_heading(@country.code, "#") %>
11
+
12
+ <%= clear_tag(10) %>
13
+
14
+ <div class="visible-sm visible-xs mb-50"></div>
15
+
16
+ </div>
17
+
18
+ <div class="col-md-3 col-sm-12 col-xs-12">
19
+
20
+ <% edit_link = edit_admin_country_path(id: @country.id) %>
21
+ <% delete_link = admin_country_path(id: @country.id) %>
22
+
23
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit"), edit_link, :remote=>true, class: "btn btn-block btn-success" if @country.can_be_edited? %>
24
+
25
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, country: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "btn btn-block btn-danger btn-only-hover" if @country.can_be_deleted? %>
26
+
27
+ <div class="visible-sm visible-xs mb-50"></div>
28
+
29
+ </div>
30
+
31
+ </div>
32
+
33
+ <%= clear_tag(50) %>
34
+
35
+ <ul class="nav nav-pills">
36
+ <li class="active">
37
+ <a href="#technical_details" data-toggle="tab" aria-expanded="false">
38
+ <span class="visible-xs"><i class="fa-database"></i></span>
39
+ <span class="hidden-xs">Technical Details</span>
40
+ </a>
41
+ </li>
42
+ </ul>
43
+
44
+ <div class="tab-content">
45
+ <div class="tab-pane active" id="technical_details">
46
+
47
+ <%= clear_tag(20) %>
48
+
49
+ <div class="table-responsive">
50
+ <table class="table table-striped table-condensed table-bordered mb-30">
51
+ <tbody>
52
+
53
+ <tr>
54
+ <th>ID</th><td colspan="3"><%= @country.id %></td>
55
+ </tr>
56
+
57
+ <tr>
58
+ <th>Created At</th><td><%= @country.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @country.created_at %></td>
59
+ <th>Updated At</th><td><%= @country.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @country.updated_at %></td>
60
+ </tr>
61
+
62
+ </tbody>
63
+ </table>
64
+
65
+ </div>
66
+
67
+ </div>
68
+ </div>
69
+
70
+ <%= link_to "Close", "#", onclick: "closeGenericModal();", class: "btn btn-primary pull-right" %>
71
+
72
+ <%= clear_tag %>
73
+ </div>
@@ -0,0 +1,32 @@
1
+ <div class="row">
2
+
3
+ <div class="col-md-12">
4
+
5
+ <ul class="nav nav-tabs">
6
+ </ul>
7
+ <div class="tab-content">
8
+ <div class="tab-pane active">
9
+
10
+ <div id="div_country_action_buttons">
11
+ <div class="row">
12
+ <div class="col-md-4">
13
+ <%= link_to raw("<i class='fa fa-plus mr-10'></i><span class='btn-text'> New Country</span>"), new_admin_country_path, :class=>"btn btn-primary pull-left mb-5", :remote=>true %>
14
+ </div>
15
+ <div class="col-md-8">
16
+ <%= search_form_kuppayam(Country, admin_countries_path, text: @filters[:query]) %>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <%= clear_tag(10) %>
21
+
22
+ <div id="div_country_index">
23
+ <%= render :partial=>"vyapari/admin/countries/index" %>
24
+ </div>
25
+ <%= clear_tag(10) %>
26
+
27
+ </div>
28
+ </div>
29
+
30
+ </div>
31
+
32
+ </div>
@@ -0,0 +1,52 @@
1
+ <div class="row">
2
+
3
+ <div class="col-sm-3">
4
+ <div class="xe-widget xe-counter" data-count=".num" data-from="0" data-to="99.9" data-suffix="%" data-duration="2">
5
+ <div class="xe-icon">
6
+ <i class="linecons-cloud"></i>
7
+ </div>
8
+ <div class="xe-label">
9
+ <strong class="num">99.9%</strong>
10
+ <span>Server Uptime</span>
11
+ </div>
12
+ </div>
13
+ </div>
14
+
15
+ <div class="col-sm-3">
16
+ <div class="xe-widget xe-counter xe-counter-red" data-count=".num" data-from="0" data-to="57" data-prefix="-," data-suffix="%" data-duration="5" data-easing="true" data-delay="1">
17
+ <div class="xe-icon">
18
+ <i class="linecons-lightbulb"></i>
19
+ </div>
20
+ <div class="xe-label">
21
+ <strong class="num">2 Hours Ago</strong>
22
+ <span>Server Up Since</span>
23
+ </div>
24
+ </div>
25
+ </div>
26
+
27
+ <div class="col-sm-3">
28
+ <div class="xe-widget xe-counter xe-counter-blue" data-count=".num" data-from="1" data-to="117" data-suffix="k" data-duration="3" data-easing="false">
29
+ <div class="xe-icon">
30
+ <i class="linecons-user"></i>
31
+ </div>
32
+ <div class="xe-label">
33
+ <strong class="num"><%= User.approved.where("super_admin is FALSE").count %></strong>
34
+ <span>Total Users</span>
35
+ </div>
36
+ </div>
37
+ </div>
38
+
39
+ <div class="col-sm-3">
40
+ <div class="xe-widget xe-counter xe-counter-info" data-count=".num" data-from="1000" data-to="2470" data-duration="4" data-easing="true">
41
+ <div class="xe-icon">
42
+ <i class="linecons-diamond"></i>
43
+ </div>
44
+ <div class="xe-label">
45
+ <strong class="num"><%= Feature.published.count %></strong>
46
+ <span>Activated Features</span>
47
+ </div>
48
+ </div>
49
+ </div>
50
+
51
+
52
+ </div>
@@ -0,0 +1,28 @@
1
+ <%= form_for([:admin, @exchange_rate], :html => {:id=>"form_exchange_rate", :class=>"mb-0 form-horizontal", :exchange_rate => "form", :method => (@exchange_rate.new_record? ? :post : :put), :remote=>true}) do |f| %>
2
+
3
+ <div id="exchange_rate_form_error">
4
+ <%= @exchange_rate.errors[:base].to_sentence %>
5
+ </div>
6
+
7
+ <div class="form-inputs mb-30 mt-30">
8
+ <%= theme_form_field(@exchange_rate, :currency_name) %>
9
+ <%= theme_form_field(@exchange_rate, :value) %>
10
+ <%= theme_form_field(@exchange_rate, :effective_date, html_options: {type: :date}) %>
11
+
12
+ <% options = {assoc_collection: Country.select("id, name").order("name ASC").all, required: true, editable: true, assoc_display_method: :name} %>
13
+ <%= theme_form_assoc_group(@exchange_rate, :country_id, **options) %>
14
+ </div>
15
+
16
+ <div>
17
+
18
+ <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
19
+
20
+ <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>
21
+
22
+ </div>
23
+ <%= clear_tag(10) %>
24
+
25
+ </div>
26
+
27
+ <% end %>
28
+
@@ -0,0 +1,57 @@
1
+ <div class="table-responsive">
2
+ <table class="table table-hover members-table middle-align">
3
+ <thead>
4
+ <tr>
5
+ <th style="text-align: center;width:20px">#</th>
6
+ <th>Currency Name</th>
7
+ <th>Country</th>
8
+ <th style="width:10%">Value</th>
9
+ <th style="width:20%">Effective Date</th>
10
+ <th style="text-align: center;">Actions</th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @exchange_rates.each_with_index do |exchange_rate, i| %>
16
+
17
+ <% edit_link = edit_admin_exchange_rate_path(id: exchange_rate.id) %>
18
+ <% delete_link = admin_exchange_rate_path(id: exchange_rate.id) %>
19
+
20
+ <tr id="tr_exchange_rate_<%= exchange_rate.id %>">
21
+
22
+ <th scope="row" style="text-align: center;">
23
+ <% if i < 0 %>
24
+ <i class="fa fa-check text-success"></i>
25
+ <% else %>
26
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
27
+ <% end %>
28
+ </th>
29
+
30
+ <td class="exchange_rate-name"><%= link_to exchange_rate.currency_name, admin_exchange_rate_path(exchange_rate), remote: true %></td>
31
+
32
+ <td><%= exchange_rate.country.name if exchange_rate.country %></td>
33
+
34
+ <td><%= number_with_precision(exchange_rate.value, :precision => 2) %></td>
35
+
36
+ <td><%= exchange_rate.effective_date.strftime("%m/%d/%Y") %></td>
37
+
38
+ <td class="action-links" style="width:10%">
39
+
40
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit ExchangeRate"), edit_link, :remote=>true, class: "edit" %>
41
+
42
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, exchange_rate: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
43
+
44
+ </td>
45
+
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ </div>
51
+
52
+ <div class="row">
53
+ <div class="col-sm-12">
54
+ <%= paginate_kuppayam(@exchange_rates) %>
55
+ </div>
56
+ </div>
57
+
@@ -0,0 +1,30 @@
1
+ <% edit_link = edit_admin_exchange_rate_path(id: exchange_rate.id) %>
2
+ <% delete_link = admin_exchange_rate_path(id: exchange_rate.id) %>
3
+
4
+ <tr id="tr_exchange_rate_<%= exchange_rate.id %>">
5
+
6
+ <th scope="row" style="text-align: center;">
7
+ <% if i < 0 %>
8
+ <i class="fa fa-check text-success"></i>
9
+ <% else %>
10
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
11
+ <% end %>
12
+ </th>
13
+
14
+ <td class="exchange_rate-name"><%= link_to exchange_rate.currency_name, admin_exchange_rate_path(exchange_rate), remote: true %></td>
15
+
16
+ <td><%= exchange_rate.country.name if exchange_rate.country %></td>
17
+
18
+ <td><%= number_with_precision(exchange_rate.value, :precision => 2) %></td>
19
+
20
+ <td><%= exchange_rate.effective_date.strftime("%m/%d/%Y") %></td>
21
+
22
+ <td class="action-links" style="width:10%">
23
+
24
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit ExchangeRate"), edit_link, :remote=>true, class: "edit" %>
25
+
26
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, exchange_rate: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
27
+
28
+ </td>
29
+
30
+ </tr>
@@ -0,0 +1,72 @@
1
+ <div id="div_exchange_rate_show">
2
+
3
+ <div class="row">
4
+
5
+ <div class="col-md-9 col-sm-12 col-xs-12" style="border-right:1px solid #f1f1f1;">
6
+
7
+ <div class="visible-sm visible-xs mt-50"></div>
8
+
9
+ <%= theme_panel_heading(@exchange_rate.display_name) %>
10
+
11
+ <%= clear_tag(10) %>
12
+
13
+ <div class="visible-sm visible-xs mb-50"></div>
14
+
15
+ </div>
16
+
17
+ <div class="col-md-3 col-sm-12 col-xs-12">
18
+
19
+ <% edit_link = edit_admin_exchange_rate_path(id: @exchange_rate.id) %>
20
+ <% delete_link = admin_exchange_rate_path(id: @exchange_rate.id) %>
21
+
22
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit"), edit_link, :remote=>true, class: "btn btn-block btn-success" if @exchange_rate.can_be_edited? %>
23
+
24
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, exchange_rate: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "btn btn-block btn-danger btn-only-hover" if @exchange_rate.can_be_deleted? %>
25
+
26
+ <div class="visible-sm visible-xs mb-50"></div>
27
+
28
+ </div>
29
+
30
+ </div>
31
+
32
+ <%= clear_tag(50) %>
33
+
34
+ <ul class="nav nav-pills">
35
+ <li class="active">
36
+ <a href="#technical_details" data-toggle="tab" aria-expanded="false">
37
+ <span class="visible-xs"><i class="fa-database"></i></span>
38
+ <span class="hidden-xs">Technical Details</span>
39
+ </a>
40
+ </li>
41
+ </ul>
42
+
43
+ <div class="tab-content">
44
+ <div class="tab-pane active" id="technical_details">
45
+
46
+ <%= clear_tag(20) %>
47
+
48
+ <div class="table-responsive">
49
+ <table class="table table-striped table-condensed table-bordered mb-30">
50
+ <tbody>
51
+
52
+ <tr>
53
+ <th>ID</th><td colspan="3"><%= @exchange_rate.id %></td>
54
+ </tr>
55
+
56
+ <tr>
57
+ <th>Created At</th><td><%= @exchange_rate.created_at.strftime("%m/%d/%Y - %H:%M:%S") if @exchange_rate.created_at %></td>
58
+ <th>Updated At</th><td><%= @exchange_rate.updated_at.strftime("%m/%d/%Y - %H:%M:%S") if @exchange_rate.updated_at %></td>
59
+ </tr>
60
+
61
+ </tbody>
62
+ </table>
63
+
64
+ </div>
65
+
66
+ </div>
67
+ </div>
68
+
69
+ <%= link_to "Close", "#", onclick: "closeGenericModal();", class: "btn btn-primary pull-right" %>
70
+
71
+ <%= clear_tag %>
72
+ </div>
@@ -0,0 +1,32 @@
1
+ <div class="row">
2
+
3
+ <div class="col-md-12">
4
+
5
+ <ul class="nav nav-tabs">
6
+ </ul>
7
+ <div class="tab-content">
8
+ <div class="tab-pane active">
9
+
10
+ <div id="div_exchange_rate_action_buttons">
11
+ <div class="row">
12
+ <div class="col-md-4">
13
+ <%= link_to raw("<i class='fa fa-plus mr-10'></i><span class='btn-text'> New Exchange Rate</span>"), new_admin_exchange_rate_path, :class=>"btn btn-primary pull-left mb-5", :remote=>true %>
14
+ </div>
15
+ <div class="col-md-8">
16
+ <%= search_form_kuppayam(ExchangeRate, admin_exchange_rates_path, text: @filters[:query]) %>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <%= clear_tag(10) %>
21
+
22
+ <div id="div_exchange_rate_index">
23
+ <%= render :partial=>"vyapari/admin/exchange_rates/index" %>
24
+ </div>
25
+ <%= clear_tag(10) %>
26
+
27
+ </div>
28
+ </div>
29
+
30
+ </div>
31
+
32
+ </div>
@@ -0,0 +1,28 @@
1
+ <%= form_for([:admin, @region], :html => {:id=>"form_region", :class=>"mb-0 form-horizontal", :region => "form", :method => (@region.new_record? ? :post : :put), :remote=>true}) do |f| %>
2
+
3
+ <div id="region_form_error">
4
+ <%= @region.errors[:base].to_sentence %>
5
+ </div>
6
+
7
+ <div class="form-inputs mb-30 mt-30">
8
+ <%= theme_form_field(@region, :name) %>
9
+ <%= theme_form_field(@region, :code) %>
10
+
11
+ <% options = {assoc_collection: Country.select("id, name").order("name ASC").all, required: true, editable: true, assoc_display_method: :name} %>
12
+ <%= theme_form_assoc_group(@region, :country_id, **options) %>
13
+
14
+ </div>
15
+
16
+ <div>
17
+
18
+ <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
19
+
20
+ <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>
21
+
22
+ </div>
23
+ <%= clear_tag(10) %>
24
+
25
+ </div>
26
+
27
+ <% end %>
28
+
@@ -0,0 +1,54 @@
1
+ <div class="table-responsive">
2
+ <table class="table table-hover members-table middle-align">
3
+ <thead>
4
+ <tr>
5
+ <th style="text-align: center;width:20px">#</th>
6
+ <th>Name</th>
7
+ <th>Code</th>
8
+ <th>Country</th>
9
+ <th style="text-align: center;">Actions</th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <tbody>
14
+ <% @regions.each_with_index do |region, i| %>
15
+
16
+ <% edit_link = edit_admin_region_path(id: region.id) %>
17
+ <% delete_link = admin_region_path(id: region.id) %>
18
+
19
+ <tr id="tr_region_<%= region.id %>">
20
+
21
+ <th scope="row" style="text-align: center;">
22
+ <% if i < 0 %>
23
+ <i class="fa fa-check text-success"></i>
24
+ <% else %>
25
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
26
+ <% end %>
27
+ </th>
28
+
29
+ <td class="region-name"><%= link_to region.name, admin_region_path(region), remote: true %></td>
30
+
31
+ <td class="region-name"><%= link_to region.code, admin_region_path(region), remote: true %></td>
32
+
33
+ <td class="region-name"><%= link_to region.country.try(:name), admin_region_path(region), remote: true %></td>
34
+
35
+ <td class="action-links" style="width:10%">
36
+
37
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Region"), edit_link, :remote=>true, class: "edit" %>
38
+
39
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, region: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
40
+
41
+ </td>
42
+
43
+ </tr>
44
+ <% end %>
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+
49
+ <div class="row">
50
+ <div class="col-sm-12">
51
+ <%= paginate_kuppayam(@regions) %>
52
+ </div>
53
+ </div>
54
+
@@ -0,0 +1,28 @@
1
+ <% edit_link = edit_admin_region_path(id: region.id) %>
2
+ <% delete_link = admin_region_path(id: region.id) %>
3
+
4
+ <tr id="tr_region_<%= region.id %>">
5
+
6
+ <th scope="row" style="text-align: center;">
7
+ <% if i < 0 %>
8
+ <i class="fa fa-check text-success"></i>
9
+ <% else %>
10
+ <%= i + 1 + (@per_page.to_i * (@current_page.to_i - 1)) %>
11
+ <% end %>
12
+ </th>
13
+
14
+ <td class="region-name"><%= link_to region.name, admin_region_path(region), remote: true %></td>
15
+
16
+ <td class="region-name"><%= link_to region.code, admin_region_path(region), remote: true %></td>
17
+
18
+ <td class="region-name"><%= link_to region.country.try(:name), admin_region_path(region), remote: true %></td>
19
+
20
+ <td class="action-links" style="width:10%">
21
+
22
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Region"), edit_link, :remote=>true, class: "edit" %>
23
+
24
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, region: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" %>
25
+
26
+ </td>
27
+
28
+ </tr>