ish_manager 0.1.8.143 → 0.1.8.144
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.
- checksums.yaml +4 -4
- data/app/controllers/ish_manager/co_tailors_controller.rb +33 -0
- data/app/models/ish_manager/ability.rb +1 -0
- data/app/views/ish_manager/application/_main_header_admin.haml +1 -0
- data/app/views/ish_manager/co_tailors/_product_form.haml +21 -0
- data/app/views/ish_manager/co_tailors/home.haml +12 -0
- data/config/routes.rb +3 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97434fae42ab480a1797349627723d04210e4f02
|
4
|
+
data.tar.gz: 8cecee985d2f0a01c609db9e83df2f6f8c88af67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 848311992bb31cb0ad87afe7566b7cb87dd12fc4fa8bcb3d096daad98c5d762cc5942d2e7c224782f3088bb1be67f0895cca4ab58681d7e880fbf63e64e136b2
|
7
|
+
data.tar.gz: 4c25516be8c0f22e3a02cc8e2f2c2a611ae80542686c337561bf59020dee5e1cfad3e6186c77b6cbdb9b23ad62d8b29eb3ee047178916c20f09743e3e0d2fc77
|
@@ -0,0 +1,33 @@
|
|
1
|
+
|
2
|
+
class IshManager::CoTailorsController < IshManager::ApplicationController
|
3
|
+
|
4
|
+
def home
|
5
|
+
authorize! :home, ::CoTailors
|
6
|
+
@products = ::CoTailors::Product.all
|
7
|
+
end
|
8
|
+
|
9
|
+
def create_product
|
10
|
+
authorize! :create, ::CoTailors::Product
|
11
|
+
@product = ::CoTailors::Product.new params[:co_tailors_product].permit!
|
12
|
+
if @product.save
|
13
|
+
flash[:notice] = 'Created product'
|
14
|
+
else
|
15
|
+
flash[:alert] = 'Cannot create product: ', @product.errors.messages.to_s
|
16
|
+
end
|
17
|
+
redirect_to :action => 'home'
|
18
|
+
end
|
19
|
+
|
20
|
+
def update_product
|
21
|
+
@product = ::CoTailors::Product.find params[:id]
|
22
|
+
authorize! :update, @product
|
23
|
+
if @product.update_attributes params[:co_tailors_product].permit!
|
24
|
+
flash[:notice] = 'updated product'
|
25
|
+
else
|
26
|
+
flash[:alert] = 'Cannot update product: ', @product.errors.messages.to_s
|
27
|
+
end
|
28
|
+
redirect_to :action => 'home'
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
end
|
33
|
+
|
@@ -30,5 +30,6 @@
|
|
30
30
|
%li{ :class => params[:controller] == 'ish_manager/campaigns' ? 'active' : '' }= link_to 'Campaigns', campaigns_path
|
31
31
|
%ul.nav.nav-pills
|
32
32
|
%li{ :class => params[:controller] == 'ish_manager/orders' ? 'active' : '' }= link_to 'Orders', orders_path
|
33
|
+
%li{ :class => params[:controller] == 'ish_manager/co_tailors' ? 'active' : '' }= link_to 'Co Tailors', co_tailors_path
|
33
34
|
%hr
|
34
35
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
.panel.dropShadow
|
3
|
+
.panel-content
|
4
|
+
= form_for product, :url => product.persisted? ? co_tailors_product_path(product) : co_tailors_products_path do |f|
|
5
|
+
.row
|
6
|
+
.col-xs-6
|
7
|
+
.input-field
|
8
|
+
= f.text_field :kind
|
9
|
+
= f.label "kind (shirt, pants, suit)"
|
10
|
+
.input-field
|
11
|
+
= f.text_field :title
|
12
|
+
= f.label "title"
|
13
|
+
.input-field
|
14
|
+
= f.number_field :cost
|
15
|
+
= f.label "cost (cents)"
|
16
|
+
= f.submit
|
17
|
+
.col-xs-6
|
18
|
+
.input-field
|
19
|
+
= f.text_area :description, :style => "height: 200px;"
|
20
|
+
= f.label "description"
|
21
|
+
|
data/config/routes.rb
CHANGED
@@ -36,6 +36,9 @@ IshManager::Engine.routes.draw do
|
|
36
36
|
resources :newsitems
|
37
37
|
|
38
38
|
resources :orders
|
39
|
+
get 'co_tailors', :to => 'co_tailors#home'
|
40
|
+
post 'co_tailors/products', :to => 'co_tailors#create_product'
|
41
|
+
patch 'co_tailors/products/:id', :to => 'co_tailors#update_product', :as => :co_tailors_product
|
39
42
|
|
40
43
|
resources :photos
|
41
44
|
resources :payments
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ish_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.8.
|
4
|
+
version: 0.1.8.144
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- app/controllers/ish_manager/application_controller.rb
|
158
158
|
- app/controllers/ish_manager/campaigns_controller.rb
|
159
159
|
- app/controllers/ish_manager/cities_controller.rb
|
160
|
+
- app/controllers/ish_manager/co_tailors_controller.rb
|
160
161
|
- app/controllers/ish_manager/events_controller.rb
|
161
162
|
- app/controllers/ish_manager/features_controller.rb
|
162
163
|
- app/controllers/ish_manager/friends_controller.rb
|
@@ -214,6 +215,8 @@ files:
|
|
214
215
|
- app/views/ish_manager/cities/new_feature.haml
|
215
216
|
- app/views/ish_manager/cities/new_newsitem.haml
|
216
217
|
- app/views/ish_manager/cities/show.haml
|
218
|
+
- app/views/ish_manager/co_tailors/_product_form.haml
|
219
|
+
- app/views/ish_manager/co_tailors/home.haml
|
217
220
|
- app/views/ish_manager/events/_form.haml
|
218
221
|
- app/views/ish_manager/events/_index.haml
|
219
222
|
- app/views/ish_manager/events/_index.haml~
|