ish_manager 0.1.8.143 → 0.1.8.144

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f84483484ee2e3391810866802b990cdc49acd2
4
- data.tar.gz: 926c03c102837d27f9cae3281b8ac8736d5b9b26
3
+ metadata.gz: 97434fae42ab480a1797349627723d04210e4f02
4
+ data.tar.gz: 8cecee985d2f0a01c609db9e83df2f6f8c88af67
5
5
  SHA512:
6
- metadata.gz: 7ec46c4b96a8032ee19548bb39469a2eab96ddc9feee5977e4293a04c6ae745d20f5390820f1b89d3d2eed7fdb4e1155e7d63e7df635447eb271c7c4ce4bae89
7
- data.tar.gz: 97b7b3f9042ad0d39dfd5acc27ce187880a683d3c6b1eed9622c6302be36183c6443c6c50e62c2435b4ebbc5141aba45b1539e6addb23a861fe95b3bd6403452
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
+
@@ -22,6 +22,7 @@ class IshManager::Ability
22
22
 
23
23
  can [ :new ], ::Feature
24
24
 
25
+ can [ :manage ], ::CoTailors
25
26
  can [ :cities_index, :home, :sites_index, :venues_index ], ::Manager
26
27
 
27
28
  can [ :new ], Newsitem
@@ -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
+
@@ -0,0 +1,12 @@
1
+
2
+ %h4 CoTailors Home
3
+ %h5 Products
4
+ = render 'ish_manager/co_tailors/product_form', :product => CoTailors::Product.new
5
+ %hr
6
+
7
+ %ul
8
+ - @products.each do |product|
9
+ %li
10
+ = render 'ish_manager/co_tailors/product_form', :product => product
11
+ %hr
12
+
@@ -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.143
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~