ish_manager 0.1.8.140 → 0.1.8.141

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: 1ca06aa4ea116212dfc733e9cbc090b361367e8a
4
- data.tar.gz: 017f93a08cf89d5c8e878c0ef69339c2833fa194
3
+ metadata.gz: e3090e1d4074c2b01099f187c22521cc4a2c147d
4
+ data.tar.gz: e52ec43b445ba034d373e1d2a1b90bbbc7914299
5
5
  SHA512:
6
- metadata.gz: 3d9dd7b67b11634f3ce5939fcf88308d7a6ab687d941a7c5df3d317a328c9be3c27b07b92662369d695d86d713b6a663b28590808ec1cf8e427aa7699927cedc
7
- data.tar.gz: 766a31ae9d19d6c90ad4d817a859adbb108deafba1e6f95640fe44a0185035e879c93b88bbfec577f018b90b6b15f65e2f588506580c625894d06d24251176dc
6
+ metadata.gz: 7a99d95e9c39f4fd4b9f5fe09e37ba29e13b69b5df9fe8e7a3335a1bb74b6682961402c28d1411f71805eb902e0388d6994bda70f96d06036d723f32bacad293
7
+ data.tar.gz: 9a4a36f56b37769ce4bfbcd037badc68fc26f43a42043d313c00dd771480977728b5efaef396fa44f59a06394e704f291774342a52f3c87d1cec7a3fad8ecddc
@@ -49,5 +49,31 @@ module IshManager
49
49
  puts a.inspect
50
50
  end
51
51
 
52
+ def update_profile_pic
53
+ return unless params[:photo]
54
+ @photo = Photo.new :photo => params[:photo]
55
+ @photo.user_profile = @current_user.profile
56
+ flag = @photo.save
57
+ @resource.profile_photo = @photo
58
+ flagg = @resource.save
59
+ if flag && flagg
60
+ flash[:notice] = 'Success'
61
+ else
62
+ flash[:alert] = "No Luck. #{@photo.errors.messages} #{@resource.errors.messages}"
63
+ end
64
+ # redirect_to resource_path( @resource )
65
+ end
66
+
67
+ def resource_path resource
68
+ case resource.class.name
69
+ when 'City'
70
+ city_path( resource.id )
71
+ when 'Event'
72
+ event_path( resource.id )
73
+ when 'Venue'
74
+ venue_path( resource.id )
75
+ end
76
+ end
77
+
52
78
  end
53
79
  end
@@ -30,9 +30,9 @@ class IshManager::VenuesController < IshManager::ApplicationController
30
30
  end
31
31
 
32
32
  def update
33
- @venue = Venue.find params[:id]
33
+ @resource = @venue = Venue.find params[:id]
34
34
  authorize! :update, @venue
35
-
35
+ update_profile_pic
36
36
  flag = @venue.update_attributes params[:venue].permit!
37
37
  if flag
38
38
  flash[:notice] = 'updated venue'
@@ -27,6 +27,10 @@ module IshManager
27
27
  case resource.class.name
28
28
  when 'City'
29
29
  city_path( resource.id )
30
+ when 'Event'
31
+ event_path( resource.id )
32
+ when 'Venue'
33
+ venue_path( resource.id )
30
34
  end
31
35
  end
32
36
 
@@ -0,0 +1,7 @@
1
+
2
+ .change-profile-pic
3
+ %label Change profile pic
4
+ = file_field_tag :photo
5
+ - begin
6
+ = image_tag resource.profile_photo.photo.url(:thumb)
7
+ - rescue
@@ -1,5 +1,5 @@
1
1
 
2
- %h1.center= @city.name
2
+ %h1.center= link_to @city.name, city_path( @city )
3
3
  = render 'form', :url => city_path
4
4
  %hr
5
5
 
@@ -1,25 +1,30 @@
1
1
 
2
- = form_for venue do |f|
3
- .a
4
- = f.label :name
5
- = f.text_field :name
6
-
7
- .a
8
- = f.label :name_seo
9
- = f.text_field :name_seo
2
+ = form_for venue, :html => { :multipart => true } do |f|
3
+ .row
4
+ .col-sm-6
5
+ = f.label :name
6
+ = f.text_field :name
7
+ .col-sm-6
8
+ = f.label :name_seo
9
+ = f.text_field :name_seo
10
10
 
11
11
  .a
12
12
  = f.label :descr
13
13
  = f.text_area :descr, :class => [ :tinymce ]
14
14
 
15
- .a
16
- coords
17
- = f.text_field :x
18
- = f.text_field :y
19
-
20
- .a
21
- = f.label :city
22
- = f.select :city, options_for_select( @cities_list, :selected => venue.city_id )
15
+ .row
16
+ .col-sm-6
17
+ = f.label :city
18
+ = f.select :city, options_for_select( @cities_list, :selected => venue.city_id )
19
+ .col-sm-6
20
+ coords
21
+ .row
22
+ .col-xs-6= f.text_field :x
23
+ .col-xs-6= f.text_field :y
24
+
25
+ .row
26
+ .col-sm-6
27
+ = render 'profile_pic', :resource => venue
23
28
 
24
29
  .b
25
30
  = f.submit
@@ -1,5 +1,5 @@
1
1
 
2
- edit venue #{@venue.name}
2
+ %h3.center= link_to @venue.name, venue_path( @venue )
3
3
 
4
4
  = render :partial => 'form', :locals => { :venue => @venue }
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ish_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.140
4
+ version: 0.1.8.141
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-05 00:00:00.000000000 Z
11
+ date: 2018-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -198,6 +198,7 @@ files:
198
198
  - app/views/ish_manager/application/_main_header_manager.html
199
199
  - app/views/ish_manager/application/_meta.haml
200
200
  - app/views/ish_manager/application/_meta.haml~
201
+ - app/views/ish_manager/application/_profile_pic.haml
201
202
  - app/views/ish_manager/application/home.haml
202
203
  - app/views/ish_manager/application_mailer/shared_galleries.html.erb
203
204
  - app/views/ish_manager/application_mailer/stock_alert.html.erb