vyapari 0.1.4 → 0.1.5dev

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/vyapari/sample_stock_bundle.csv +1 -0
  3. data/app/controllers/vyapari/admin/base_controller.rb +10 -0
  4. data/app/controllers/vyapari/admin/brands_controller.rb +99 -0
  5. data/app/controllers/vyapari/admin/categories_controller.rb +115 -0
  6. data/app/controllers/vyapari/admin/countries_controller.rb +2 -2
  7. data/app/controllers/vyapari/admin/dashboard_controller.rb +3 -1
  8. data/app/controllers/vyapari/admin/exchange_rates_controller.rb +2 -2
  9. data/app/controllers/vyapari/admin/products_controller.rb +79 -0
  10. data/app/controllers/vyapari/admin/regions_controller.rb +1 -1
  11. data/app/controllers/vyapari/admin/resource_controller.rb +1 -0
  12. data/app/controllers/vyapari/admin/stores_controller.rb +67 -0
  13. data/app/controllers/vyapari/admin/suppliers_controller.rb +67 -0
  14. data/app/controllers/vyapari/admin/terminals_controller.rb +150 -0
  15. data/app/controllers/vyapari/application_controller.rb +12 -0
  16. data/app/controllers/vyapari/store_manager/base_controller.rb +28 -0
  17. data/app/controllers/vyapari/store_manager/dashboard_controller.rb +30 -0
  18. data/app/controllers/vyapari/store_manager/resource_controller.rb +17 -0
  19. data/app/controllers/vyapari/store_manager/stock_bundles_controller.rb +206 -0
  20. data/app/controllers/vyapari/store_manager/stock_entries_controller.rb +161 -0
  21. data/app/controllers/vyapari/terminal_staff/base_controller.rb +29 -0
  22. data/app/controllers/vyapari/terminal_staff/dashboard_controller.rb +29 -0
  23. data/app/controllers/vyapari/terminal_staff/invoices_controller.rb +138 -0
  24. data/app/controllers/vyapari/terminal_staff/line_items_controller.rb +123 -0
  25. data/app/controllers/vyapari/terminal_staff/resource_controller.rb +17 -0
  26. data/app/controllers/vyapari/user_dashboard_controller.rb +31 -0
  27. data/app/models/brand.rb +63 -10
  28. data/app/models/category.rb +60 -16
  29. data/app/models/country.rb +27 -5
  30. data/app/models/exchange_rate.rb +31 -6
  31. data/app/models/image/brand_image.rb +3 -0
  32. data/app/models/image/category_image.rb +3 -0
  33. data/app/models/image/product_image.rb +3 -0
  34. data/app/models/invoice.rb +223 -0
  35. data/app/models/line_item.rb +206 -0
  36. data/app/models/product.rb +67 -13
  37. data/app/models/region.rb +26 -3
  38. data/app/models/stock_bundle.rb +249 -0
  39. data/app/models/stock_entry.rb +271 -0
  40. data/app/models/store.rb +216 -0
  41. data/app/models/supplier.rb +85 -0
  42. data/app/models/terminal.rb +158 -0
  43. data/app/models/vyapari/application_record.rb +4 -0
  44. data/app/uploaders/brand_image_uploader.rb +14 -0
  45. data/app/uploaders/category_image_uploader.rb +14 -0
  46. data/app/uploaders/product_image_uploader.rb +14 -0
  47. data/app/uploaders/stock_bundle_uploader.rb +10 -0
  48. data/app/views/layouts/kuppayam/_footer.html.erb +1 -1
  49. data/app/views/layouts/kuppayam/_sidebar.html.erb +45 -44
  50. data/app/views/layouts/vyapari/_store_manager_menu.html.erb +107 -0
  51. data/app/views/layouts/vyapari/_terminal_staff_menu.html.erb +103 -0
  52. data/app/views/layouts/vyapari/store_manager.html.erb +112 -0
  53. data/app/views/layouts/vyapari/terminal_staff.html.erb +116 -0
  54. data/app/views/vyapari/admin/brands/_form.html.erb +23 -0
  55. data/app/views/vyapari/admin/brands/_index.html.erb +89 -0
  56. data/app/views/vyapari/admin/brands/_row.html.erb +63 -0
  57. data/app/views/vyapari/admin/brands/_show.html.erb +104 -0
  58. data/app/views/vyapari/admin/brands/index.html.erb +48 -0
  59. data/app/views/vyapari/admin/categories/_form.html.erb +28 -0
  60. data/app/views/vyapari/admin/categories/_index.html.erb +101 -0
  61. data/app/views/vyapari/admin/categories/_row.html.erb +69 -0
  62. data/app/views/vyapari/admin/categories/_show.html.erb +115 -0
  63. data/app/views/vyapari/admin/{users → categories}/index.html.erb +8 -24
  64. data/app/views/vyapari/admin/countries/_index.html.erb +1 -1
  65. data/app/views/vyapari/admin/countries/index.html.erb +19 -3
  66. data/app/views/vyapari/admin/exchange_rates/_form.html.erb +3 -4
  67. data/app/views/vyapari/admin/exchange_rates/_index.html.erb +7 -7
  68. data/app/views/vyapari/admin/exchange_rates/_row.html.erb +3 -3
  69. data/app/views/vyapari/admin/exchange_rates/_show.html.erb +1 -0
  70. data/app/views/vyapari/admin/exchange_rates/index.html.erb +19 -3
  71. data/app/views/vyapari/admin/products/_form.html.erb +32 -0
  72. data/app/views/vyapari/admin/products/_index.html.erb +58 -0
  73. data/app/views/vyapari/admin/products/_row.html.erb +30 -0
  74. data/app/views/vyapari/admin/products/_show.html.erb +81 -0
  75. data/app/views/vyapari/admin/products/index.html.erb +48 -0
  76. data/app/views/vyapari/admin/regions/_index.html.erb +1 -1
  77. data/app/views/vyapari/admin/regions/index.html.erb +19 -3
  78. data/app/views/vyapari/admin/stores/_form.html.erb +37 -0
  79. data/app/views/vyapari/admin/stores/_index.html.erb +84 -0
  80. data/app/views/vyapari/admin/stores/_row.html.erb +55 -0
  81. data/app/views/vyapari/admin/stores/_show.html.erb +110 -0
  82. data/app/views/vyapari/admin/stores/index.html.erb +48 -0
  83. data/app/views/vyapari/admin/suppliers/_form.html.erb +32 -0
  84. data/app/views/vyapari/admin/suppliers/_index.html.erb +58 -0
  85. data/app/views/vyapari/admin/suppliers/_row.html.erb +30 -0
  86. data/app/views/vyapari/admin/suppliers/_show.html.erb +81 -0
  87. data/app/views/vyapari/admin/suppliers/index.html.erb +48 -0
  88. data/app/views/vyapari/admin/terminals/_form.html.erb +24 -0
  89. data/app/views/vyapari/admin/terminals/_index.html.erb +75 -0
  90. data/app/views/vyapari/admin/terminals/_row.html.erb +49 -0
  91. data/app/views/vyapari/admin/terminals/_show.html.erb +74 -0
  92. data/app/views/vyapari/store_manager/dashboard/index.html.erb +93 -0
  93. data/app/views/vyapari/store_manager/stock_bundles/_form.html.erb +99 -0
  94. data/app/views/vyapari/store_manager/stock_bundles/_index.html.erb +74 -0
  95. data/app/views/vyapari/store_manager/stock_bundles/_row.html.erb +44 -0
  96. data/app/views/vyapari/store_manager/stock_bundles/_show.html.erb +110 -0
  97. data/app/views/vyapari/store_manager/stock_bundles/create.html.erb +57 -0
  98. data/app/views/vyapari/store_manager/stock_bundles/index.html.erb +36 -0
  99. data/app/views/vyapari/store_manager/stock_bundles/update.html.erb +57 -0
  100. data/app/views/vyapari/store_manager/stock_entries/_form.html.erb +50 -0
  101. data/app/views/vyapari/store_manager/stock_entries/_index.html.erb +80 -0
  102. data/app/views/vyapari/store_manager/stock_entries/_row.html.erb +33 -0
  103. data/app/views/vyapari/store_manager/stock_entries/_show.html.erb +110 -0
  104. data/app/views/vyapari/store_manager/stock_entries/_stock_bundle.html.erb +61 -0
  105. data/app/views/vyapari/store_manager/stock_entries/index.html.erb +45 -0
  106. data/app/views/vyapari/terminal_staff/dashboard/_counts.html.erb +88 -0
  107. data/app/views/vyapari/terminal_staff/dashboard/_invoices.html.erb +37 -0
  108. data/app/views/vyapari/terminal_staff/dashboard/index.html.erb +36 -0
  109. data/app/views/vyapari/terminal_staff/invoices/_draft.html.erb +62 -0
  110. data/app/views/vyapari/terminal_staff/invoices/_form.html.erb +120 -0
  111. data/app/views/vyapari/terminal_staff/invoices/_index.html.erb +64 -0
  112. data/app/views/vyapari/terminal_staff/invoices/_row.html.erb +33 -0
  113. data/app/views/vyapari/terminal_staff/invoices/_show.html.erb +171 -0
  114. data/app/views/vyapari/terminal_staff/invoices/index.html.erb +37 -0
  115. data/app/views/vyapari/terminal_staff/invoices/new.js.erb +13 -0
  116. data/app/views/vyapari/terminal_staff/invoices/show.html.erb +1 -0
  117. data/app/views/vyapari/terminal_staff/line_items/_form.html.erb +40 -0
  118. data/app/views/vyapari/terminal_staff/line_items/_index.html.erb +94 -0
  119. data/app/views/vyapari/terminal_staff/line_items/create.js.erb +34 -0
  120. data/app/views/vyapari/terminal_staff/line_items/destroy.js.erb +25 -0
  121. data/app/views/vyapari/terminal_staff/stores/index.html.erb +24 -0
  122. data/app/views/vyapari/user_dashboard/index.html.erb +51 -0
  123. data/config/routes.rb +62 -5
  124. data/db/import_data/brands.csv +7 -0
  125. data/db/import_data/categories.csv +12 -0
  126. data/db/import_data/countries.csv +1 -0
  127. data/db/import_data/dummy/brands.csv +7 -0
  128. data/db/import_data/dummy/categories.csv +12 -0
  129. data/db/import_data/dummy/countries.csv +1 -0
  130. data/db/import_data/dummy/exchange_rates.csv +5 -0
  131. data/db/import_data/dummy/products-copy.csv +1 -0
  132. data/db/import_data/dummy/products.csv +1 -0
  133. data/db/import_data/dummy/products.xlsx +0 -0
  134. data/db/import_data/dummy/regions.csv +13 -0
  135. data/db/import_data/dummy/stores.csv +10 -0
  136. data/db/import_data/dummy/suppliers.csv +14 -0
  137. data/db/import_data/dummy/terminals.csv +11 -0
  138. data/db/import_data/exchange_rates.csv +5 -0
  139. data/db/import_data/regions.csv +13 -0
  140. data/db/import_data/stores.csv +3 -0
  141. data/db/import_data/suppliers.csv +14 -0
  142. data/db/import_data/terminals.csv +3 -0
  143. data/db/migrate/20170000000200_create_exchange_rates.rb +3 -2
  144. data/db/migrate/20170000000203_create_contacts.rb +22 -0
  145. data/db/migrate/20170000000204_create_bank_accounts.rb +21 -0
  146. data/db/migrate/20170000000205_create_suppliers.rb +18 -0
  147. data/db/migrate/20170000000206_create_stores.rb +21 -0
  148. data/db/migrate/20170000000207_create_terminals.rb +18 -0
  149. data/db/migrate/20170000000210_create_brands.rb +14 -0
  150. data/db/migrate/20170000000211_create_categories.rb +22 -0
  151. data/db/migrate/20170000000212_create_products.rb +29 -0
  152. data/db/migrate/20170000000213_create_invoices.rb +58 -0
  153. data/db/migrate/20170000000215_create_stock_bundles.rb +17 -0
  154. data/db/migrate/20170000000216_create_stock_entries.rb +20 -0
  155. data/db/sample_reports/products.xlsx +0 -0
  156. data/lib/tasks/vyapari/all.rake +73 -0
  157. data/lib/vyapari/version.rb +1 -1
  158. metadata +150 -15
  159. data/app/controllers/vyapari/admin/users_controller.rb +0 -130
  160. data/app/views/vyapari/admin/users/_form.html.erb +0 -39
  161. data/app/views/vyapari/admin/users/_index.html.erb +0 -101
  162. data/app/views/vyapari/admin/users/_row.html.erb +0 -72
  163. data/app/views/vyapari/admin/users/_show.html.erb +0 -199
  164. data/lib/tasks/vyapari_tasks.rake +0 -4
@@ -0,0 +1,107 @@
1
+ <nav class="navbar horizontal-menu navbar-fixed-top"><!-- set fixed position by adding class "navbar-fixed-top" -->
2
+
3
+ <div class="navbar-inner">
4
+
5
+ <!-- Navbar Brand -->
6
+ <div class="navbar-brand">
7
+ <a href="dashboard-1.html" class="logo">
8
+ <img src="/assets/kuppayam/logo.png" width="80" alt="" class="hidden-xs" />
9
+ <img src="/assets/kuppayam/logo.png" width="80" alt="" class="visible-xs" />
10
+ </a>
11
+ <a href="#" data-toggle="settings-pane" data-animate="true">
12
+ <i class="linecons-cog"></i>
13
+ </a>
14
+ </div>
15
+
16
+ <!-- Mobile Toggles Links -->
17
+ <div class="nav navbar-mobile">
18
+
19
+ <!-- This will toggle the mobile menu and will be visible only on mobile devices -->
20
+ <div class="mobile-menu-toggle">
21
+ <!-- This will open the popup with user profile settings, you can use for any purpose, just be creative -->
22
+
23
+ <%= link_to raw("<i class=\"fa-dashboard\"></i> <span class='title'>Home</span>"), vyapari.user_dashboard_path %>
24
+
25
+ <!-- data-toggle="mobile-menu-horizontal" will show horizontal menu links only -->
26
+ <!-- data-toggle="mobile-menu" will show sidebar menu links only -->
27
+ <!-- data-toggle="mobile-menu-both" will show sidebar and horizontal menu links -->
28
+ <a href="#" data-toggle="mobile-menu-horizontal">
29
+ <i class="fa-bars"></i>
30
+ </a>
31
+ </div>
32
+
33
+ </div>
34
+
35
+ <div class="navbar-mobile-clear"></div>
36
+
37
+ <!-- Main Menu -->
38
+ <ul class="navbar-nav">
39
+
40
+ <!-- Dashboard -->
41
+ <li class="<%= nav_class("store_manager/dashboard") %>">
42
+ <%= link_to raw("<i class=\"fa-home\"></i> <span class='title'>Dashboard</span>"), vyapari.store_manager_dashboard_path %>
43
+ </li>
44
+
45
+ <li class="<%= nav_active?('store_manager/stock') ? 'active' : '' %>">
46
+ <%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Manage Stock</span>"), vyapari.store_manager_stock_entries_path(@store) %>
47
+ </li>
48
+
49
+ <!-- Admin -->
50
+ <% if @current_user.has_role?("Site Admin") %>
51
+ <li class="<%= nav_active?('admin/dashboard') ? 'active' : '' %>">
52
+ <%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Admin Dashboard</span>"), vyapari.admin_dashboard_url %>
53
+ </li>
54
+ <% end %>
55
+
56
+ <!-- Log out -->
57
+ <li class="<%= nav_class("user/dashboard") %>">
58
+ <%= link_to raw("<i class=\"fa-desktop\"></i> <span class='title'>Change Store/Terminal</span>"), vyapari.user_dashboard_path %>
59
+ </li>
60
+
61
+
62
+
63
+ </ul>
64
+
65
+ <!-- Notifications and other links -->
66
+ <ul class="nav nav-userinfo navbar-right">
67
+
68
+ <li class="dropdown user-profile">
69
+
70
+ <a href="#" data-toggle="dropdown">
71
+ <%= display_image(@current_user, "profile_picture.image.small.url", width: "28", height: "auto", class: "img-circle img-inline userpic-32", alt: @current_user.display_name) %>
72
+ <span>
73
+ <%= @current_user.display_name %>
74
+ <i class="fa-angle-down"></i>
75
+ </span>
76
+ </a>
77
+
78
+ <ul class="dropdown-menu user-profile-menu list-unstyled">
79
+ <!-- <li>
80
+ <a href="#settings">
81
+ <i class="fa-wrench"></i>
82
+ Settings
83
+ </a>
84
+ </li>
85
+ <li>
86
+ <a href="#profile">
87
+ <i class="fa-user"></i>
88
+ Profile
89
+ </a>
90
+ </li> -->
91
+ <li>
92
+ <a href="#help">
93
+ <i class="fa-info"></i>
94
+ Help
95
+ </a>
96
+ </li>
97
+ <li class="last">
98
+ <%= link_to raw("<i class='fa-lock'></i>Sign Out"), usman.sign_out_path, method: :delete %>
99
+ </li>
100
+ </ul>
101
+ </li>
102
+
103
+ </ul>
104
+
105
+ </div>
106
+
107
+ </nav>
@@ -0,0 +1,103 @@
1
+ <nav class="navbar horizontal-menu navbar-fixed-top"><!-- set fixed position by adding class "navbar-fixed-top" -->
2
+
3
+ <div class="navbar-inner">
4
+
5
+ <!-- Navbar Brand -->
6
+ <div class="navbar-brand">
7
+ <a href="dashboard-1.html" class="logo">
8
+ <img src="/assets/kuppayam/logo.png" width="80" alt="" class="hidden-xs" />
9
+ <img src="/assets/kuppayam/logo.png" width="80" alt="" class="visible-xs" />
10
+ </a>
11
+ <a href="#" data-toggle="settings-pane" data-animate="true">
12
+ <i class="linecons-cog"></i>
13
+ </a>
14
+ </div>
15
+
16
+ <!-- Mobile Toggles Links -->
17
+ <div class="nav navbar-mobile">
18
+
19
+ <!-- This will toggle the mobile menu and will be visible only on mobile devices -->
20
+ <div class="mobile-menu-toggle">
21
+ <!-- This will open the popup with user profile settings, you can use for any purpose, just be creative -->
22
+ <%= link_to raw("<i class=\"fa-dashboard\"></i> <span class='title'>Terminal Dashboard</span>"), vyapari.user_dashboard_path %>
23
+
24
+ <!-- data-toggle="mobile-menu-horizontal" will show horizontal menu links only -->
25
+ <!-- data-toggle="mobile-menu" will show sidebar menu links only -->
26
+ <!-- data-toggle="mobile-menu-both" will show sidebar and horizontal menu links -->
27
+ <a href="#" data-toggle="mobile-menu-horizontal">
28
+ <i class="fa-bars"></i>
29
+ </a>
30
+ </div>
31
+
32
+ </div>
33
+
34
+ <div class="navbar-mobile-clear"></div>
35
+
36
+ <!-- Main Menu -->
37
+ <ul class="navbar-nav">
38
+
39
+ <li class="<%= nav_class("terminal_staff/dashboard") %>">
40
+ <%= link_to raw("<i class=\"fa-dashboard\"></i> <span class='title'>Dashboard</span>"), vyapari.terminal_staff_dashboard_path(@terminal) %>
41
+ </li>
42
+
43
+ <%= nav_class("terminal_staff/invoices") %>
44
+
45
+ <li class="<%= nav_class("terminal_staff/invoices") %>">
46
+ <%= link_to raw("<i class=\"fa-book\"></i> <span class='title'>Invoices</span>"), vyapari.terminal_staff_invoices_path(@terminal) %>
47
+ </li>
48
+
49
+ <% if @current_user.has_role?("Site Admin") %>
50
+ <li class="<%= nav_active?('admin/dashboard') ? 'active' : '' %>">
51
+ <%= link_to raw("<i class=\"linecons-desktop\"></i> <span class='title'>Admin Dashboard</span>"), vyapari.admin_dashboard_url %>
52
+ </li>
53
+ <% end %>
54
+
55
+ <li class="<%= nav_class("user/dashboard") %>">
56
+ <%= link_to raw("<i class=\"fa-desktop\"></i> <span class='title'>Change Store/Terminal</span>"), vyapari.user_dashboard_path %>
57
+ </li>
58
+
59
+ </ul>
60
+
61
+ <!-- Notifications and other links -->
62
+ <ul class="nav nav-userinfo navbar-right">
63
+
64
+ <li class="dropdown user-profile">
65
+
66
+ <a href="#" data-toggle="dropdown">
67
+ <%= display_image(@current_user, "profile_picture.image.small.url", width: "28", height: "auto", class: "img-circle img-inline userpic-32", alt: @current_user.display_name) %>
68
+ <span>
69
+ <%= @current_user.display_name %>
70
+ <i class="fa-angle-down"></i>
71
+ </span>
72
+ </a>
73
+
74
+ <ul class="dropdown-menu user-profile-menu list-unstyled">
75
+ <!-- <li>
76
+ <a href="#settings">
77
+ <i class="fa-wrench"></i>
78
+ Settings
79
+ </a>
80
+ </li>
81
+ <li>
82
+ <a href="#profile">
83
+ <i class="fa-user"></i>
84
+ Profile
85
+ </a>
86
+ </li> -->
87
+ <li>
88
+ <a href="#help">
89
+ <i class="fa-info"></i>
90
+ Help
91
+ </a>
92
+ </li>
93
+ <li class="last">
94
+ <%= link_to raw("<i class='fa-lock'></i>Sign Out"), usman.sign_out_path, method: :delete %>
95
+ </li>
96
+ </ul>
97
+ </li>
98
+
99
+ </ul>
100
+
101
+ </div>
102
+
103
+ </nav>
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- Head -->
5
+ <%= render :partial=>"/layouts/kuppayam/head" -%>
6
+ </head>
7
+
8
+ <body class="page-body">
9
+
10
+ <%= render :partial=>"/layouts/vyapari/store_manager_menu" -%>
11
+
12
+ <div class="page-container">
13
+
14
+ <div class="main-content">
15
+
16
+ <!-- Heading & Breadcrumbs -->
17
+ <%= render :partial=>"/layouts/kuppayam/heading" -%>
18
+
19
+ <%#* Show flash messages if controller has set any. -%>
20
+ <div id="div_flash_message" class="mt-10">
21
+ <%= flash_message(false) if defined?(flash) -%>
22
+ </div>
23
+
24
+ <%#* Page Content Starts here -%>
25
+ <div id="div_page_content_main">
26
+ <%= yield %>
27
+ </div>
28
+
29
+ <!-- Footer -->
30
+ <%= render :partial=>"/layouts/kuppayam/footer" -%>
31
+
32
+ </div>
33
+
34
+ </div>
35
+
36
+ <div id="div_modal_generic" class="modal" style="z-index: 1056;">
37
+ <div class="modal-dialog">
38
+ <div class="modal-content">
39
+ <div class="modal-header">
40
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
41
+ <h3 class="modal-title">Modal title</h3>
42
+ </div>
43
+ <div class="modal-body-main"></div>
44
+ </div><!-- /.modal-content -->
45
+ </div><!-- /.modal-dialog -->
46
+ </div><!-- /.modal -->
47
+
48
+ <div id="div_modal_large" class="modal">
49
+ <div class="modal-dialog modal-lg" style="width: 96%">
50
+ <div class="modal-content">
51
+ <div class="modal-header">
52
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
53
+ <h3 class="modal-title">Modal title</h3>
54
+ </div>
55
+ <div class="modal-body-main"></div>
56
+ </div><!-- /.modal-content -->
57
+ </div><!-- /.modal-dialog -->
58
+ </div><!-- /.modal -->
59
+
60
+ <div id="div_modal_message" class="modal fade">
61
+ <div class="modal-dialog">
62
+ <div class="modal-content">
63
+ <div class="modal-header">
64
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
65
+ <h3 class="modal-title">Modal title</h3>
66
+ </div>
67
+ <div class="modal-body">
68
+ <p>One fine body&hellip;</p>
69
+ </div>
70
+ <div class="modal-footer">
71
+ <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
72
+ </div>
73
+ </div><!-- /.modal-content -->
74
+ </div><!-- /.modal-dialog -->
75
+ </div><!-- /.modal -->
76
+
77
+ <div id="div_modal_image_upload" class="modal" style="z-index: 1057;">
78
+ <div class="modal-dialog">
79
+ <div class="modal-content">
80
+ <div class="modal-header">
81
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
82
+ <h3 class="modal-title">Modal title</h3>
83
+ </div>
84
+ <div class="modal-body-main"></div>
85
+ </div><!-- /.modal-content -->
86
+ </div><!-- /.modal-dialog -->
87
+ </div><!-- /.modal -->
88
+
89
+ <script type="text/javascript">
90
+ $('.modal').on('shown.bs.modal', function(e){
91
+ $(this).modal('handleUpdate'); //Update backdrop on modal show
92
+ $(this).scrollTop(0); //reset modal to top position
93
+ });
94
+ </script>
95
+
96
+ <!-- Page Loading Overlay -->
97
+ <!-- <div class="page-loading-overlay">
98
+ <div class="loader-3"></div>
99
+ </div> -->
100
+
101
+ <%#* Loading Javascripts -%>
102
+ <%= javascript_include_tag @javascript_filename -%>
103
+
104
+ <%= yield :javascript_footer -%>
105
+
106
+ <iframe id="iframe_document" name="iframe_document" width="100%" style="display:none"></iframe>
107
+
108
+ <iframe id="iframe_image" name="iframe_image" width="100%" style="display:none"></iframe>
109
+
110
+ </body>
111
+
112
+ </html>
@@ -0,0 +1,116 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <!-- Head -->
5
+ <%= render :partial=>"/layouts/kuppayam/head" -%>
6
+ </head>
7
+
8
+ <body class="page-body">
9
+
10
+ <!-- <div class="settings-pane" id="settings_pane">
11
+ <%#= render :partial=>"/layouts/kuppayam/settings_pane" -%>
12
+ </div> -->
13
+
14
+ <%= render :partial=>"/layouts/vyapari/terminal_staff_menu" -%>
15
+
16
+ <div class="page-container">
17
+
18
+ <div class="main-content">
19
+
20
+ <!-- Heading & Breadcrumbs -->
21
+ <%= render :partial=>"/layouts/kuppayam/heading" -%>
22
+
23
+ <%#* Show flash messages if controller has set any. -%>
24
+ <div id="div_flash_message" class="mt-10">
25
+ <%= flash_message(false) if defined?(flash) -%>
26
+ </div>
27
+
28
+ <%#* Page Content Starts here -%>
29
+ <div id="div_page_content_main">
30
+ <%= yield %>
31
+ </div>
32
+
33
+ <!-- Footer -->
34
+ <%= render :partial=>"/layouts/kuppayam/footer" -%>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ <div id="div_modal_generic" class="modal" style="z-index: 1056;">
41
+ <div class="modal-dialog">
42
+ <div class="modal-content">
43
+ <div class="modal-header">
44
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
45
+ <h3 class="modal-title">Modal title</h3>
46
+ </div>
47
+ <div class="modal-body-main"></div>
48
+ </div><!-- /.modal-content -->
49
+ </div><!-- /.modal-dialog -->
50
+ </div><!-- /.modal -->
51
+
52
+ <div id="div_modal_large" class="modal">
53
+ <div class="modal-dialog modal-lg" style="width: 96%">
54
+ <div class="modal-content">
55
+ <div class="modal-header">
56
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
57
+ <h3 class="modal-title">Modal title</h3>
58
+ </div>
59
+ <div class="modal-body-main"></div>
60
+ </div><!-- /.modal-content -->
61
+ </div><!-- /.modal-dialog -->
62
+ </div><!-- /.modal -->
63
+
64
+ <div id="div_modal_message" class="modal fade">
65
+ <div class="modal-dialog">
66
+ <div class="modal-content">
67
+ <div class="modal-header">
68
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
69
+ <h3 class="modal-title">Modal title</h3>
70
+ </div>
71
+ <div class="modal-body">
72
+ <p>One fine body&hellip;</p>
73
+ </div>
74
+ <div class="modal-footer">
75
+ <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
76
+ </div>
77
+ </div><!-- /.modal-content -->
78
+ </div><!-- /.modal-dialog -->
79
+ </div><!-- /.modal -->
80
+
81
+ <div id="div_modal_image_upload" class="modal" style="z-index: 1057;">
82
+ <div class="modal-dialog">
83
+ <div class="modal-content">
84
+ <div class="modal-header">
85
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
86
+ <h3 class="modal-title">Modal title</h3>
87
+ </div>
88
+ <div class="modal-body-main"></div>
89
+ </div><!-- /.modal-content -->
90
+ </div><!-- /.modal-dialog -->
91
+ </div><!-- /.modal -->
92
+
93
+ <script type="text/javascript">
94
+ $('.modal').on('shown.bs.modal', function(e){
95
+ $(this).modal('handleUpdate'); //Update backdrop on modal show
96
+ $(this).scrollTop(0); //reset modal to top position
97
+ });
98
+ </script>
99
+
100
+ <!-- Page Loading Overlay -->
101
+ <!-- <div class="page-loading-overlay">
102
+ <div class="loader-3"></div>
103
+ </div> -->
104
+
105
+ <%#* Loading Javascripts -%>
106
+ <%= javascript_include_tag @javascript_filename -%>
107
+
108
+ <%= yield :javascript_footer -%>
109
+
110
+ <iframe id="iframe_document" name="iframe_document" width="100%" style="display:none"></iframe>
111
+
112
+ <iframe id="iframe_image" name="iframe_image" width="100%" style="display:none"></iframe>
113
+
114
+ </body>
115
+
116
+ </html>
@@ -0,0 +1,23 @@
1
+ <%= form_for([:admin, @brand], :html => {:id=>"form_brand", :class=>"mb-0 form-horizontal", :brand => "form", :method => (@brand.new_record? ? :post : :put), :remote=>true}) do |f| %>
2
+
3
+ <div id="brand_form_error">
4
+ <%= @brand.errors[:base].to_sentence %>
5
+ </div>
6
+
7
+ <div class="form-inputs mb-30 mt-30">
8
+ <%= theme_form_field(@brand, :name) %>
9
+ </div>
10
+
11
+ <div>
12
+
13
+ <%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %>
14
+
15
+ <%= link_to raw("<i class='fa fa-close mr-5'></i><span>Cancel</span>"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>
16
+
17
+ </div>
18
+ <%= clear_tag(10) %>
19
+
20
+ </div>
21
+
22
+ <% end %>
23
+
@@ -0,0 +1,89 @@
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:60px">#</th>
6
+ <th style="width:50%">Name</th>
7
+ <th>Featured</th>
8
+ <th>Status</th>
9
+ <th style="text-align: center;" colspan="3">Actions</th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <tbody>
14
+ <% @brands.each_with_index do |brand, i| %>
15
+
16
+ <% edit_link = edit_admin_brand_path(id: brand.id) %>
17
+ <% delete_link = admin_brand_path(id: brand.id) %>
18
+
19
+ <tr id="tr_brand_<%= brand.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="brand-name"><%= link_to brand.name, admin_brand_path(brand), remote: true %></td>
30
+
31
+ <td class="hidden-xs hidden-sm">
32
+ <% if brand.featured? %>
33
+ <span class="mr-10 mt-5 label label-warning">Featured</span>
34
+ <% end %>
35
+ </td>
36
+
37
+ <td>
38
+ <% if brand.unpublished? %>
39
+ <span class="ml-5 mt-5 label label-default">Un-Published</span>
40
+ <% elsif brand.published? %>
41
+ <span class="ml-5 mt-5 label label-success">Published</span>
42
+ <% elsif brand.removed? %>
43
+ <span class="ml-5 mt-5 label label-danger">Removed</span>
44
+ <% end %>
45
+ </td>
46
+
47
+ <td class="action-links" style="width:10%">
48
+
49
+ <!-- Mark as Featured -->
50
+ <%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Mark as Featured"), mark_as_featured_admin_brand_path(:id =>brand.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"edit" unless brand.featured? %>
51
+
52
+ <!-- Remove from Featured -->
53
+ <%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Remove from Featured"), remove_from_featured_admin_brand_path(:id =>brand.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" if brand.featured? %>
54
+
55
+ </td>
56
+
57
+ <td class="action-links" style="width:10%">
58
+
59
+ <!-- Publish -->
60
+ <%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"), update_status_admin_brand_path(:id =>brand.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"edit" if brand.can_be_published? %>
61
+
62
+ <!-- Un-Publish -->
63
+ <%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"), update_status_admin_brand_path(:id =>brand.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" if brand.can_be_unpublished? %>
64
+
65
+ <!-- Remove -->
66
+ <%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Remove"), update_status_admin_brand_path(:id =>brand.id, :status =>'removed'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"delete" if brand.can_be_removed? %>
67
+
68
+ </td>
69
+
70
+ <td class="action-links" style="width:10%">
71
+
72
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Brand"), edit_link, :remote=>true, class: "edit" if brand.can_be_edited? %>
73
+
74
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, brand: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" if brand.can_be_deleted? %>
75
+
76
+ </td>
77
+
78
+ </tr>
79
+ <% end %>
80
+ </tbody>
81
+ </table>
82
+ </div>
83
+
84
+ <div class="row">
85
+ <div class="col-sm-12">
86
+ <%= paginate_kuppayam(@brands) %>
87
+ </div>
88
+ </div>
89
+
@@ -0,0 +1,63 @@
1
+ <% edit_link = edit_admin_brand_path(id: brand.id) %>
2
+ <% delete_link = admin_brand_path(id: brand.id) %>
3
+
4
+ <tr id="tr_brand_<%= brand.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="brand-name"><%= link_to brand.name, admin_brand_path(brand), remote: true %></td>
15
+
16
+ <td class="hidden-xs hidden-sm">
17
+ <% if brand.featured? %>
18
+ <span class="mr-10 mt-5 label label-warning">Featured</span>
19
+ <% end %>
20
+ </td>
21
+
22
+ <td>
23
+ <% if brand.unpublished? %>
24
+ <span class="ml-5 mt-5 label label-default">Un-Published</span>
25
+ <% elsif brand.published? %>
26
+ <span class="ml-5 mt-5 label label-success">Published</span>
27
+ <% elsif brand.removed? %>
28
+ <span class="ml-5 mt-5 label label-danger">Removed</span>
29
+ <% end %>
30
+ </td>
31
+
32
+ <td class="action-links" style="width:10%">
33
+
34
+ <!-- Mark as Featured -->
35
+ <%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Mark as Featured"), mark_as_featured_admin_brand_path(:id =>brand.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"edit" unless brand.featured? %>
36
+
37
+ <!-- Remove from Featured -->
38
+ <%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Remove from Featured"), remove_from_featured_admin_brand_path(:id =>brand.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" if brand.featured? %>
39
+
40
+ </td>
41
+
42
+ <td class="action-links" style="width:10%">
43
+
44
+ <!-- Publish -->
45
+ <%= link_to raw("<i class=\"fa fa-circle-o mr-5\"></i> Publish"), update_status_admin_brand_path(:id =>brand.id, :status =>'published'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"edit" if brand.can_be_published? %>
46
+
47
+ <!-- Un-Publish -->
48
+ <%= link_to raw("<i class=\"fa fa-circle mr-5\"></i> Un-Publish"), update_status_admin_brand_path(:id =>brand.id, :status =>'unpublished'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"" if brand.can_be_unpublished? %>
49
+
50
+ <!-- Remove -->
51
+ <%= link_to raw("<i class=\"fa fa-edit mr-5\"></i> Remove"), update_status_admin_brand_path(:id =>brand.id, :status =>'removed'), :method =>'PUT', :remote=>true, role: "menuitem", tabindex: "-1", :class=>"delete" if brand.can_be_removed? %>
52
+
53
+ </td>
54
+
55
+ <td class="action-links" style="width:10%">
56
+
57
+ <%= link_to raw("<i class=\"linecons-pencil\"></i> Edit Brand"), edit_link, :remote=>true, class: "edit" if brand.can_be_edited? %>
58
+
59
+ <%= link_to raw("<i class=\"linecons-trash\"></i> Delete"), delete_link, method: :delete, brand: "menuitem", tabindex: "-1", data: { confirm: 'Are you sure?' }, :remote=>true, class: "delete" if brand.can_be_deleted? %>
60
+
61
+ </td>
62
+
63
+ </tr>