mechanize-store 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +58 -0
  4. data/Rakefile +32 -0
  5. data/app/assets/javascripts/mechanize_store/application.js +22 -0
  6. data/app/assets/javascripts/mechanize_store/sb-admin/bootstrap.js +1951 -0
  7. data/app/assets/javascripts/mechanize_store/sb-admin/custom.js +58 -0
  8. data/app/assets/javascripts/mechanize_store/sb-admin/flot/excanvas.min.js +1 -0
  9. data/app/assets/javascripts/mechanize_store/sb-admin/flot/jquery.flot.js +3137 -0
  10. data/app/assets/javascripts/mechanize_store/sb-admin/flot/jquery.flot.pie.js +817 -0
  11. data/app/assets/javascripts/mechanize_store/sb-admin/flot/main.js +20 -0
  12. data/app/assets/javascripts/mechanize_store/sb-admin/jquery-ui.js +2256 -0
  13. data/app/assets/javascripts/mechanize_store/sb-admin/jquery.activity-indicator-1.0.0.min.js +223 -0
  14. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/dataTables/dataTables.bootstrap.js +245 -0
  15. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/dataTables/jquery.dataTables.js +14013 -0
  16. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/flot/excanvas.min.js +1 -0
  17. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/flot/jquery.flot.js +2599 -0
  18. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/flot/jquery.flot.pie.js +750 -0
  19. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/flot/jquery.flot.resize.js +60 -0
  20. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/flot/jquery.flot.tooltip.min.js +12 -0
  21. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/metisMenu/jquery.metisMenu.js +45 -0
  22. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/morris/morris.js +1888 -0
  23. data/app/assets/javascripts/mechanize_store/sb-admin/plugins/morris/raphael-2.1.0.min.js +10 -0
  24. data/app/assets/javascripts/mechanize_store/sb-admin/sb-admin.js +18 -0
  25. data/app/assets/stylesheets/mechanize_store/application.css +199 -0
  26. data/app/assets/stylesheets/mechanize_store/sb-admin/bootstrap.css +5831 -0
  27. data/app/assets/stylesheets/mechanize_store/sb-admin/plugins/dataTables/dataTables.bootstrap.css +233 -0
  28. data/app/assets/stylesheets/mechanize_store/sb-admin/plugins/morris/morris-0.4.3.min.css +2 -0
  29. data/app/assets/stylesheets/mechanize_store/sb-admin/plugins/social-buttons/social-buttons.css +68 -0
  30. data/app/assets/stylesheets/mechanize_store/sb-admin/plugins/timeline/timeline.css +144 -0
  31. data/app/assets/stylesheets/mechanize_store/sb-admin/sb-admin.css +307 -0
  32. data/app/controllers/mechanize_store/application_controller.rb +4 -0
  33. data/app/controllers/mechanize_store/flags_controller.rb +77 -0
  34. data/app/controllers/mechanize_store/order_statuses_controller.rb +77 -0
  35. data/app/controllers/mechanize_store/orders_controller.rb +28 -0
  36. data/app/controllers/mechanize_store/payment_statuses_controller.rb +77 -0
  37. data/app/controllers/mechanize_store/payment_types_controller.rb +77 -0
  38. data/app/controllers/mechanize_store/product_categories_controller.rb +77 -0
  39. data/app/controllers/mechanize_store/products_controller.rb +77 -0
  40. data/app/helpers/mechanize_store/application_helper.rb +7 -0
  41. data/app/models/mechanize_store/flag.rb +4 -0
  42. data/app/models/mechanize_store/freight.rb +5 -0
  43. data/app/models/mechanize_store/order.rb +8 -0
  44. data/app/models/mechanize_store/order_status.rb +5 -0
  45. data/app/models/mechanize_store/payment.rb +6 -0
  46. data/app/models/mechanize_store/payment_status.rb +4 -0
  47. data/app/models/mechanize_store/payment_type.rb +4 -0
  48. data/app/models/mechanize_store/product.rb +5 -0
  49. data/app/models/mechanize_store/product_category.rb +5 -0
  50. data/app/models/mechanize_store/product_photo.rb +5 -0
  51. data/app/models/mechanize_store/store.rb +5 -0
  52. data/app/views/layouts/store/application.html.erb +93 -0
  53. data/app/views/mechanize_store/flags/_form.html.erb +11 -0
  54. data/app/views/mechanize_store/flags/edit.html.erb +12 -0
  55. data/app/views/mechanize_store/flags/index.html.erb +46 -0
  56. data/app/views/mechanize_store/flags/new.html.erb +9 -0
  57. data/app/views/mechanize_store/flags/show.html.erb +15 -0
  58. data/app/views/mechanize_store/order_statuses/_form.html.erb +11 -0
  59. data/app/views/mechanize_store/order_statuses/edit.html.erb +12 -0
  60. data/app/views/mechanize_store/order_statuses/index.html.erb +46 -0
  61. data/app/views/mechanize_store/order_statuses/new.html.erb +9 -0
  62. data/app/views/mechanize_store/order_statuses/show.html.erb +15 -0
  63. data/app/views/mechanize_store/orders/index.html.erb +84 -0
  64. data/app/views/mechanize_store/orders/show.html.erb +0 -0
  65. data/app/views/mechanize_store/payment_statuses/_form.html.erb +11 -0
  66. data/app/views/mechanize_store/payment_statuses/edit.html.erb +12 -0
  67. data/app/views/mechanize_store/payment_statuses/index.html.erb +46 -0
  68. data/app/views/mechanize_store/payment_statuses/new.html.erb +9 -0
  69. data/app/views/mechanize_store/payment_statuses/show.html.erb +15 -0
  70. data/app/views/mechanize_store/payment_types/_form.html.erb +11 -0
  71. data/app/views/mechanize_store/payment_types/edit.html.erb +12 -0
  72. data/app/views/mechanize_store/payment_types/index.html.erb +46 -0
  73. data/app/views/mechanize_store/payment_types/new.html.erb +9 -0
  74. data/app/views/mechanize_store/payment_types/show.html.erb +15 -0
  75. data/app/views/mechanize_store/product_categories/_form.html.erb +12 -0
  76. data/app/views/mechanize_store/product_categories/edit.html.erb +12 -0
  77. data/app/views/mechanize_store/product_categories/index.html.erb +48 -0
  78. data/app/views/mechanize_store/product_categories/new.html.erb +9 -0
  79. data/app/views/mechanize_store/product_categories/show.html.erb +19 -0
  80. data/app/views/mechanize_store/products/_form.html.erb +18 -0
  81. data/app/views/mechanize_store/products/edit.html.erb +12 -0
  82. data/app/views/mechanize_store/products/index.html.erb +50 -0
  83. data/app/views/mechanize_store/products/new.html.erb +9 -0
  84. data/app/views/mechanize_store/products/show.html.erb +43 -0
  85. data/app/views/shared/_flashes.html.erb +8 -0
  86. data/config/locales/store.pt-BR.yml +22 -0
  87. data/config/routes.rb +10 -0
  88. data/db/migrate/20140401203200_create_mechanize_store_freights.rb +12 -0
  89. data/db/migrate/20140401203246_create_mechanize_store_order_statuses.rb +9 -0
  90. data/db/migrate/20140402140318_create_mechanize_store_payment_statuses.rb +9 -0
  91. data/db/migrate/20140402140325_create_mechanize_store_payment_types.rb +9 -0
  92. data/db/migrate/20140402140539_create_mechanize_store_payments.rb +16 -0
  93. data/db/migrate/20140402140549_create_mechanize_store_flags.rb +9 -0
  94. data/db/migrate/20140402140832_create_mechanize_store_products.rb +16 -0
  95. data/db/migrate/20140402140942_create_mechanize_store_product_photos.rb +10 -0
  96. data/db/migrate/20140402141340_create_mechanize_store_stores.rb +12 -0
  97. data/db/migrate/20140402153139_create_mechanize_store_orders.rb +11 -0
  98. data/db/migrate/20140402192058_create_mechanize_store_product_categories.rb +10 -0
  99. data/lib/mechanize_store.rb +4 -0
  100. data/lib/mechanize_store/engine.rb +16 -0
  101. data/lib/mechanize_store/version.rb +3 -0
  102. data/lib/tasks/store_tasks.rake +4 -0
  103. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  104. data/lib/templates/erb/scaffold/edit.html.erb +12 -0
  105. data/lib/templates/erb/scaffold/index.html.erb +50 -0
  106. data/lib/templates/erb/scaffold/new.html.erb +9 -0
  107. data/lib/templates/erb/scaffold/show.html.erb +17 -0
  108. data/lib/templates/rails/scaffold_controller/controller.rb +79 -0
  109. metadata +265 -0
@@ -0,0 +1,307 @@
1
+ /* Global Styles */
2
+
3
+ /* ------------------------------- */
4
+
5
+ body {
6
+ background-color: #f8f8f8;
7
+ }
8
+
9
+ /* Wrappers */
10
+
11
+ /* ------------------------------- */
12
+
13
+ #wrapper {
14
+ width: 100%;
15
+ }
16
+
17
+ #page-wrapper {
18
+ padding: 0 15px;
19
+ min-height: 568px;
20
+ background-color: #fff;
21
+ }
22
+
23
+ @media(min-width:768px) {
24
+ #page-wrapper {
25
+ position: inherit;
26
+ margin: 0 0 0 150px;
27
+ padding: 0 30px;
28
+ min-height: 1300px;
29
+ border-left: 1px solid #e7e7e7;
30
+ }
31
+ }
32
+
33
+ .navbar-static-side ul li {
34
+ border-bottom: 1px solid #e7e7e7;
35
+ }
36
+
37
+ /* Navigation */
38
+
39
+ /* ------------------------------- */
40
+
41
+ /* Top Right Navigation Dropdown Styles */
42
+
43
+ .navbar-top-links li {
44
+ display: inline-block;
45
+ }
46
+
47
+ .navbar-top-links li:last-child {
48
+ margin-right: 15px;
49
+ }
50
+
51
+ .navbar-top-links li a {
52
+ padding: 15px;
53
+ min-height: 50px;
54
+ }
55
+
56
+ .navbar-top-links .dropdown-menu li {
57
+ display: block;
58
+ }
59
+
60
+ .navbar-top-links .dropdown-menu li:last-child {
61
+ margin-right: 0;
62
+ }
63
+
64
+ .navbar-top-links .dropdown-menu li a {
65
+ padding: 3px 20px;
66
+ min-height: 0;
67
+ }
68
+
69
+ .navbar-top-links .dropdown-menu li a div {
70
+ white-space: normal;
71
+ }
72
+
73
+ .navbar-top-links .dropdown-messages,
74
+ .navbar-top-links .dropdown-tasks,
75
+ .navbar-top-links .dropdown-alerts {
76
+ width: 310px;
77
+ min-width: 0;
78
+ }
79
+
80
+ .navbar-top-links .dropdown-messages {
81
+ margin-left: 5px;
82
+ }
83
+
84
+ .navbar-top-links .dropdown-tasks {
85
+ margin-left: -59px;
86
+ }
87
+
88
+ .navbar-top-links .dropdown-alerts {
89
+ margin-left: -123px;
90
+ }
91
+
92
+ .navbar-top-links .dropdown-user {
93
+ right: 0;
94
+ left: auto;
95
+ }
96
+
97
+ /* Sidebar Menu Styles */
98
+
99
+ .sidebar-search {
100
+ padding: 15px;
101
+ }
102
+
103
+ .arrow {
104
+ float: right;
105
+ }
106
+
107
+ .fa.arrow:before {
108
+ content: "\f104";
109
+ }
110
+
111
+ .active > a > .fa.arrow:before {
112
+ content: "\f107";
113
+ }
114
+
115
+ .nav-second-level li,
116
+ .nav-third-level li {
117
+ border-bottom: none !important;
118
+ }
119
+
120
+ .nav-second-level li a {
121
+ padding-left: 37px;
122
+ }
123
+
124
+ .nav-third-level li a {
125
+ padding-left: 52px;
126
+ }
127
+
128
+ @media(min-width:768px) {
129
+ .navbar-static-side {
130
+ z-index: 1;
131
+ position: absolute;
132
+ width: 150px;
133
+ }
134
+
135
+ .navbar-top-links .dropdown-messages,
136
+ .navbar-top-links .dropdown-tasks,
137
+ .navbar-top-links .dropdown-alerts {
138
+ margin-left: auto;
139
+ }
140
+ }
141
+
142
+ /* Buttons */
143
+
144
+ /* ------------------------------- */
145
+
146
+ .btn-outline {
147
+ color: inherit;
148
+ background-color: transparent;
149
+ transition: all .5s;
150
+ }
151
+
152
+ .btn-primary.btn-outline {
153
+ color: #428bca;
154
+ }
155
+
156
+ .btn-success.btn-outline {
157
+ color: #5cb85c;
158
+ }
159
+
160
+ .btn-info.btn-outline {
161
+ color: #5bc0de;
162
+ }
163
+
164
+ .btn-warning.btn-outline {
165
+ color: #f0ad4e;
166
+ }
167
+
168
+ .btn-danger.btn-outline {
169
+ color: #d9534f;
170
+ }
171
+
172
+ .btn-primary.btn-outline:hover,
173
+ .btn-success.btn-outline:hover,
174
+ .btn-info.btn-outline:hover,
175
+ .btn-warning.btn-outline:hover,
176
+ .btn-danger.btn-outline:hover {
177
+ color: #fff;
178
+ }
179
+
180
+ /* Pages */
181
+
182
+ /* ------------------------------- */
183
+
184
+ /* Dashboard Chat */
185
+
186
+ .chat {
187
+ margin: 0;
188
+ padding: 0;
189
+ list-style: none;
190
+ }
191
+
192
+ .chat li {
193
+ margin-bottom: 10px;
194
+ padding-bottom: 5px;
195
+ border-bottom: 1px dotted #B3A9A9;
196
+ }
197
+
198
+ .chat li.left .chat-body {
199
+ margin-left: 60px;
200
+ }
201
+
202
+ .chat li.right .chat-body {
203
+ margin-right: 60px;
204
+ }
205
+
206
+ .chat li .chat-body p {
207
+ margin: 0;
208
+ color: #777777;
209
+ }
210
+
211
+ .panel .slidedown .glyphicon,
212
+ .chat .glyphicon {
213
+ margin-right: 5px;
214
+ }
215
+
216
+ .chat-panel .panel-body {
217
+ height: 350px;
218
+ overflow-y: scroll;
219
+ }
220
+
221
+ /* Login Page */
222
+
223
+ .login-panel {
224
+ margin-top: 25%;
225
+ }
226
+
227
+ /* Flot Chart Containers */
228
+
229
+ .flot-chart {
230
+ display: block;
231
+ height: 400px;
232
+ }
233
+
234
+ .flot-chart-content {
235
+ width: 100%;
236
+ height: 100%;
237
+ }
238
+
239
+ /* DataTables Overrides */
240
+
241
+ table.dataTable thead .sorting,
242
+ table.dataTable thead .sorting_asc:after,
243
+ table.dataTable thead .sorting_desc,
244
+ table.dataTable thead .sorting_asc_disabled,
245
+ table.dataTable thead .sorting_desc_disabled {
246
+ background: transparent;
247
+ }
248
+
249
+ table.dataTable thead .sorting_asc:after {
250
+ content: "\f0de";
251
+ float: right;
252
+ font-family: fontawesome;
253
+ }
254
+
255
+ table.dataTable thead .sorting_desc:after {
256
+ content: "\f0dd";
257
+ float: right;
258
+ font-family: fontawesome;
259
+ }
260
+
261
+ table.dataTable thead .sorting:after {
262
+ content: "\f0dc";
263
+ float: right;
264
+ font-family: fontawesome;
265
+ color: rgba(50,50,50,.5);
266
+ }
267
+
268
+ /* Circle Buttons */
269
+
270
+ .btn-circle {
271
+ width: 30px;
272
+ height: 30px;
273
+ padding: 6px 0;
274
+ border-radius: 15px;
275
+ text-align: center;
276
+ font-size: 12px;
277
+ line-height: 1.428571429;
278
+ }
279
+
280
+ .btn-circle.btn-lg {
281
+ width: 50px;
282
+ height: 50px;
283
+ padding: 10px 16px;
284
+ border-radius: 25px;
285
+ font-size: 18px;
286
+ line-height: 1.33;
287
+ }
288
+
289
+ .btn-circle.btn-xl {
290
+ width: 70px;
291
+ height: 70px;
292
+ padding: 10px 16px;
293
+ border-radius: 35px;
294
+ font-size: 24px;
295
+ line-height: 1.33;
296
+ }
297
+
298
+ .show-grid [class^="col-"] {
299
+ padding-top: 10px;
300
+ padding-bottom: 10px;
301
+ border: 1px solid #ddd;
302
+ background-color: #eee !important;
303
+ }
304
+
305
+ .show-grid {
306
+ margin: 15px 0;
307
+ }
@@ -0,0 +1,4 @@
1
+ module MechanizeStore
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,77 @@
1
+ module MechanizeStore
2
+ class FlagsController < ApplicationController
3
+ before_action :set_flag, only: [:show, :edit, :update, :destroy]
4
+
5
+ respond_to :html, :json, :xml
6
+
7
+ def index
8
+ @search = Flag.search(params[:q])
9
+
10
+ @flags = @search.result.paginate(page: params[:page])
11
+
12
+ respond_with @flags
13
+ end
14
+
15
+ def show
16
+ respond_with @flag
17
+ end
18
+
19
+ def new
20
+ @flag = Flag.new
21
+ respond_with @flag
22
+ end
23
+
24
+ def edit
25
+ respond_with @flag
26
+ end
27
+
28
+ def create
29
+ @flag = Flag.new(flag_params)
30
+
31
+ respond_with @flag do |format|
32
+ if @flag.save
33
+ format.html do
34
+ flash[:notice] = I18n.t(:created, model: I18n.t(:flag, scope: "activerecord.models"))
35
+ redirect_to @flag
36
+ end
37
+ else
38
+ format.html { render action: "new" }
39
+ end
40
+ end
41
+ end
42
+
43
+ def update
44
+ @flag = Flag.find(params[:id])
45
+
46
+ respond_with @flag do |format|
47
+ if @flag.update(flag_params)
48
+ format.html do
49
+ flash[:notice] = I18n.t(:updated, model: I18n.t(:flag, scope: "activerecord.models"))
50
+ redirect_to @flag
51
+ end
52
+ else
53
+ format.html { render action: "edit" }
54
+ end
55
+ end
56
+ end
57
+
58
+ def destroy
59
+ @flag = Flag.find(params[:id])
60
+
61
+ flash[:alert] = I18n.t(:deleted, model: I18n.t(:flag, scope: "activerecord.models")) if @flag.destroy
62
+
63
+ respond_with @flag, :location => flags_url
64
+ end
65
+
66
+ private
67
+ # Use callbacks to share common setup or constraints between actions.
68
+ def set_flag
69
+ @flag = Flag.find(params[:id])
70
+ end
71
+
72
+ # Only allow a trusted parameter "white list" through.
73
+ def flag_params
74
+ params.require(:flag).permit(:name)
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,77 @@
1
+ module MechanizeStore
2
+ class OrderStatusesController < ApplicationController
3
+ before_action :set_order_status, only: [:show, :edit, :update, :destroy]
4
+
5
+ respond_to :html, :json, :xml
6
+
7
+ def index
8
+ @search = OrderStatus.search(params[:q])
9
+
10
+ @order_statuses = @search.result.paginate(page: params[:page])
11
+
12
+ respond_with @order_statuses
13
+ end
14
+
15
+ def show
16
+ respond_with @order_status
17
+ end
18
+
19
+ def new
20
+ @order_status = OrderStatus.new
21
+ respond_with @order_status
22
+ end
23
+
24
+ def edit
25
+ respond_with @order_status
26
+ end
27
+
28
+ def create
29
+ @order_status = OrderStatus.new(order_status_params)
30
+
31
+ respond_with @order_status do |format|
32
+ if @order_status.save
33
+ format.html do
34
+ flash[:notice] = I18n.t(:created, model: I18n.t(:order_status, scope: "activerecord.models"))
35
+ redirect_to @order_status
36
+ end
37
+ else
38
+ format.html { render action: "new" }
39
+ end
40
+ end
41
+ end
42
+
43
+ def update
44
+ @order_status = OrderStatus.find(params[:id])
45
+
46
+ respond_with @order_status do |format|
47
+ if @order_status.update(order_status_params)
48
+ format.html do
49
+ flash[:notice] = I18n.t(:updated, model: I18n.t(:order_status, scope: "activerecord.models"))
50
+ redirect_to @order_status
51
+ end
52
+ else
53
+ format.html { render action: "edit" }
54
+ end
55
+ end
56
+ end
57
+
58
+ def destroy
59
+ @order_status = OrderStatus.find(params[:id])
60
+
61
+ flash[:alert] = I18n.t(:deleted, model: I18n.t(:order_status, scope: "activerecord.models")) if @order_status.destroy
62
+
63
+ respond_with @order_status, :location => order_statuses_url
64
+ end
65
+
66
+ private
67
+ # Use callbacks to share common setup or constraints between actions.
68
+ def set_order_status
69
+ @order_status = OrderStatus.find(params[:id])
70
+ end
71
+
72
+ # Only allow a trusted parameter "white list" through.
73
+ def order_status_params
74
+ params.require(:order_status).permit(:name)
75
+ end
76
+ end
77
+ end