ish_manager 0.1.8.139 → 0.1.8.140

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: d677c9f50a1705856286f15af4e4dd837ebef30c
4
- data.tar.gz: fcec94bc81878c95bae62d775133f09a203add1c
3
+ metadata.gz: 1ca06aa4ea116212dfc733e9cbc090b361367e8a
4
+ data.tar.gz: 017f93a08cf89d5c8e878c0ef69339c2833fa194
5
5
  SHA512:
6
- metadata.gz: b603e846f99fb0571831dc9b4e219143c420b7f16bee26212066f117569d46f053f86a8967ba4a268b4ebdb4450a52c866c04938225419b089000fdcafa43e6a
7
- data.tar.gz: c9916bae0a5967242ce34c6ceca02ec9d947bc72d801127d6313309fe1b7362086d2a82973f814a74efc3fd1c899ab37666c004490a6dd181631d289079218de
6
+ metadata.gz: 3d9dd7b67b11634f3ce5939fcf88308d7a6ab687d941a7c5df3d317a328c9be3c27b07b92662369d695d86d713b6a663b28590808ec1cf8e427aa7699927cedc
7
+ data.tar.gz: 766a31ae9d19d6c90ad4d817a859adbb108deafba1e6f95640fe44a0185035e879c93b88bbfec577f018b90b6b15f65e2f588506580c625894d06d24251176dc
@@ -12,6 +12,7 @@
12
12
  *
13
13
  *= require ish_manager/bootstrap
14
14
  *= require_self
15
+ *= require ish_manager/tags
15
16
  */
16
17
 
17
18
 
@@ -128,13 +129,6 @@ nav.pagination
128
129
  font-size: 1.6em;
129
130
  }
130
131
 
131
- /**
132
- * tags
133
- */
134
- ul.tags ul.tags {
135
- margin-left: 2em;
136
- }
137
-
138
132
  /**
139
133
  * ally, stock watches
140
134
  */
@@ -0,0 +1,7 @@
1
+
2
+ /**
3
+ * tags
4
+ */
5
+ ul.tags ul.tags {
6
+ margin-left: 2em;
7
+ }
@@ -29,7 +29,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
29
29
  flash[:notice] = 'Success'
30
30
  redirect_to cities_path
31
31
  else
32
- flash[:error] = 'No Luck'
32
+ flash[:alert] = 'No Luck'
33
33
  render :action => :new
34
34
  end
35
35
  end
@@ -51,7 +51,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
51
51
  flash[:notice] = 'Success'
52
52
  redirect_to edit_city_path @city.id
53
53
  else
54
- flash[:error] = 'No Luck. ' + @city.errors.inspect
54
+ flash[:alert] = 'No Luck. ' + @city.errors.inspect
55
55
  @newsitems = @city.newsitems.all.page( params[:newsitems_page] )
56
56
  @features = @city.features.all.page( params[:features_page] )
57
57
  @photo = Photo.new
@@ -70,7 +70,7 @@ class IshManager::CitiesController < IshManager::ApplicationController
70
70
  if flag && flagg
71
71
  flash[:notice] = 'Success'
72
72
  else
73
- flash[:error] = "No Luck. #{@photo.errors.inspect} #{@city.errors.inspect}"
73
+ flash[:alert] = "No Luck. #{@photo.errors.messages} #{@city.errors.messages}"
74
74
  end
75
75
  redirect_to cities_path
76
76
  end
@@ -6,6 +6,10 @@ class IshManager::EventsController < IshManager::ApplicationController
6
6
  def index
7
7
  authorize! :index, ::Event
8
8
  @events = Event.all
9
+ if params[:city_id]
10
+ @resource = City.find( params[:city_id] )
11
+ @events = @resource.events
12
+ end
9
13
  end
10
14
 
11
15
  def new
@@ -34,6 +38,11 @@ class IshManager::EventsController < IshManager::ApplicationController
34
38
  @event = Event.find params[:id]
35
39
  authorize! :update, @event
36
40
 
41
+ if params[:photo]
42
+ photo = Photo.new :photo => params[:photo]
43
+ @event.profile_photo = photo
44
+ end
45
+
37
46
  flag = @event.update_attributes params[:event].permit!
38
47
  if flag
39
48
  @event.city.touch
@@ -109,7 +109,7 @@ class IshManager::FeaturesController < IshManager::ApplicationController
109
109
  flash[:notice] = 'updated feature'
110
110
  redirect_to redirect_path
111
111
  else
112
- flash[:error] = 'No Luck. ' + @feature.errors.messages
112
+ flash[:alert] = 'No Luck. ' + @feature.errors.messages
113
113
  render :action => :edit
114
114
  end
115
115
  end
@@ -139,9 +139,9 @@ class IshManager::FeaturesController < IshManager::ApplicationController
139
139
 
140
140
  if @feature.destroy
141
141
  @resource.touch
142
- flash[:notice] = :'Success.'
142
+ flash[:notice] = 'Success.'
143
143
  else
144
- flash[:error] = :'No luck.'
144
+ flash[:alert] = "No luck. " + @feature.errors.messages
145
145
  end
146
146
  redirect_to request.referrer
147
147
  end
@@ -48,7 +48,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
48
48
  redirect_to galleries_path
49
49
  else
50
50
  puts! @gallery.errors.messages
51
- flash[:error] = 'No Luck. ' + @gallery.errors.inspect
51
+ flash[:alert] = 'No Luck. ' + @gallery.errors.inspect
52
52
  @cities_list = City.list
53
53
  @tags_list = Tag.list
54
54
  render :action => 'new'
@@ -81,7 +81,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
81
81
  redirect_to galleries_path
82
82
  else
83
83
  puts! @gallery.errors.messages, 'cannot save gallery'
84
- flash[:error] = 'No Luck. ' + @gallery.errors.messages.to_s
84
+ flash[:alert] = 'No Luck. ' + @gallery.errors.messages.to_s
85
85
  render :action => :edit
86
86
  end
87
87
  end
@@ -108,7 +108,7 @@ class IshManager::NewsitemsController < IshManager::ApplicationController
108
108
  if flag
109
109
  flash[:notice] = 'Success'
110
110
  else
111
- flash[:error] = "No Luck: #{@newsitem.errors.messages}"
111
+ flash[:alert] = "No Luck: #{@newsitem.errors.messages}"
112
112
  end
113
113
 
114
114
  redirect_to url
@@ -130,7 +130,7 @@ class IshManager::ReportsController < IshManager::ApplicationController
130
130
  @site.touch
131
131
  if @site.save
132
132
  else
133
- flash[:error] = (flash[:error]||'') + 'City could not be saved (newsitem). '
133
+ flash[:alert] = (flash[:alert]||'') + 'City could not be saved (newsitem). '
134
134
  end
135
135
  end
136
136
 
@@ -140,7 +140,7 @@ class IshManager::ReportsController < IshManager::ApplicationController
140
140
  format.json { render :json => @report, :status => :created, :location => @report }
141
141
  else
142
142
  format.html do
143
- flash[:error] = @report.errors.inspect
143
+ flash[:alert] = @report.errors.inspect
144
144
  @tags_list = Tag.all.where( :is_public => true ).list
145
145
  @sites_list = Site.all.list
146
146
  @cities_list = City.all.list
@@ -38,7 +38,7 @@ class IshManager::SitesController < IshManager::ApplicationController
38
38
  if @site.save
39
39
  flash[:notice] = 'Success'
40
40
  else
41
- flash[:error] = 'No Luck. ' + @site.errors.inspect
41
+ flash[:alert] = 'No Luck. ' + @site.errors.inspect
42
42
  end
43
43
  redirect_to sites_path
44
44
  end
@@ -50,7 +50,7 @@ class IshManager::SitesController < IshManager::ApplicationController
50
50
  if @site.update_attributes params[:site].permit!
51
51
  flash[:notice] = 'Success'
52
52
  else
53
- flash[:error] = 'No Luck'
53
+ flash[:alert] = 'No Luck'
54
54
  end
55
55
  redirect_to sites_path
56
56
  end
@@ -4,7 +4,14 @@ class IshManager::TagsController < IshManager::ApplicationController
4
4
  before_action :set_lists
5
5
 
6
6
  def index
7
- @tags = Tag.unscoped.where( :parent_tag_id => nil ).order_by( :name => :asc )
7
+ @resource = City.find( params[:city_id] ) if params[:city_id]
8
+
9
+ if @resource
10
+ @tags = @resource.tags
11
+ else
12
+ @tags = Tag.unscoped.where( :parent_tag_id => nil ).order_by( :name => :asc )
13
+ end
14
+
8
15
  authorize! :index, Tag.new
9
16
 
10
17
  @site = Site.find( params[:site_id] ) if params[:site_id]
@@ -28,11 +35,12 @@ class IshManager::TagsController < IshManager::ApplicationController
28
35
  @tag = Tag.create params[:tag].permit!
29
36
  authorize! :create, @tag
30
37
  if @tag.save
38
+ do_touch
31
39
  flash[:notice] = 'Success.'
32
40
  redirect_to tags_path
33
41
  else
34
42
  puts! @tag.errors, "error creating tag."
35
- flash[:error] = "No luck. #{@tag.errors.messages}"
43
+ flash[:alert] = "No luck. #{@tag.errors.messages}"
36
44
  render :action => :new
37
45
  end
38
46
  end
@@ -47,12 +55,11 @@ class IshManager::TagsController < IshManager::ApplicationController
47
55
  authorize! :update, @tag
48
56
 
49
57
  if @tag.update_attributes params[:tag].permit!
50
- @tag.site.touch if @tag.site
51
-
58
+ do_touch
52
59
  flash[:notice] = 'Success.'
53
60
  redirect_to tags_path
54
61
  else
55
- flash[:error] = 'No luck.'
62
+ flash[:alert] = 'No luck.'
56
63
  render :action => :new
57
64
  end
58
65
  end
@@ -61,6 +68,7 @@ class IshManager::TagsController < IshManager::ApplicationController
61
68
  @tag = Tag.unscoped.find params[:id]
62
69
  authorize! :destroy, @tag
63
70
  if @tag.destroy
71
+ do_touch
64
72
  flash[:notice] = 'Success'
65
73
  else
66
74
  flash[:alert] = "Cannot destroy tag: #{@tag.errors.messages}"
@@ -68,6 +76,13 @@ class IshManager::TagsController < IshManager::ApplicationController
68
76
  redirect_to :action => 'index'
69
77
  end
70
78
 
79
+ private
80
+
81
+ def do_touch
82
+ @tag.city.touch if @tag.city
83
+ @tag.site.touch if @tag.site
84
+ end
85
+
71
86
  end
72
87
 
73
88
 
@@ -71,7 +71,7 @@ class IshManager::VideosController < IshManager::ApplicationController
71
71
  flash[:notice] = 'Success'
72
72
  redirect_to videos_path
73
73
  else
74
- flash[:error] = 'No luck'
74
+ flash[:alert] = 'No luck'
75
75
  @tags_list = Tag.list
76
76
  @cities_list = City.list
77
77
  render :action => 'new'
@@ -96,7 +96,7 @@ class IshManager::VideosController < IshManager::ApplicationController
96
96
  flash[:notice] = 'Success.'
97
97
  redirect_to videos_path
98
98
  else
99
- flash[:error] = "No luck: #{@video.errors}"
99
+ flash[:alert] = "No luck: #{@video.errors.messages}"
100
100
  render :edit
101
101
  end
102
102
  end
@@ -23,5 +23,12 @@ module IshManager
23
23
  date.to_s[0, 10]
24
24
  end
25
25
 
26
+ def resource_path resource
27
+ case resource.class.name
28
+ when 'City'
29
+ city_path( resource.id )
30
+ end
31
+ end
32
+
26
33
  end
27
34
  end
@@ -2,7 +2,7 @@
2
2
  .b
3
3
  %h2
4
4
  = @city.name
5
- = link_to '[~]', edit_city_path(@city)
5
+ = link_to image_edit, edit_city_path(@city)
6
6
  &lt;#{@city.x}, #{@city.y}&gt;
7
7
  <em>#{@city.cityname}</em>
8
8
  %br
@@ -11,24 +11,29 @@
11
11
 
12
12
  %ul.menu-secondary
13
13
  %li
14
- = link_to '[+]', new_city_feature_path( @city )
14
+ = link_to image_new, new_city_feature_path( @city )
15
15
  Features (#{@city.features.length})
16
16
  %li
17
- = link_to '[+]', new_city_newsitem_path( @city )
17
+ = link_to image_new, new_city_newsitem_path( @city )
18
18
  Newsitems (#{@city.newsitems.length})
19
19
  %li
20
- = link_to '[+]', new_city_report_path( @city )
20
+ = link_to image_new, new_city_report_path( @city )
21
21
  Reports (#{@city.reports.count})
22
22
  %li
23
- = link_to '[+]', new_city_gallery_path( @city )
23
+ = link_to image_new, new_city_gallery_path( @city )
24
24
  Galleries (#{@city.galleries.count})
25
25
  %li
26
- = link_to '[+]', new_city_video_path( @city )
26
+ = link_to image_new, new_city_video_path( @city )
27
27
  Videos (#{@city.videos.count})
28
28
  %li
29
- = link_to '[+]', new_city_venue_path( @city )
29
+ = link_to image_new, new_city_venue_path( @city )
30
30
  Venues (#{@city.venues.count})
31
31
  %li
32
- = link_to '[+]', new_city_event_path( @city )
33
- Events (#{@city.events.count})
32
+ = link_to image_new, new_city_event_path( @city )
33
+ = link_to 'Events', city_events_path( @city )
34
+ (#{@city.events.count})
35
+ %li
36
+ = link_to image_new, new_city_tag_path( @city )
37
+ = link_to 'Tags', city_tags_path( @city )
38
+ (#{@city.tags.count})
34
39
  %hr
@@ -12,7 +12,6 @@
12
12
  .panel-heading
13
13
  = link_to city.name, city_path(city)
14
14
  = link_to '[~]', edit_city_path(city)
15
- .small.gray= city.id
16
15
  .cities-meta= "R(#{city.reports.length}) G(#{city.galleries.length}) V(#{city.videos.length}) U(#{city.current_users.length})"
17
16
 
18
17
  - if city.profile_photo.blank?
@@ -6,6 +6,7 @@
6
6
  = render 'header', :city => @city
7
7
  = render 'ish_manager/features/index', :features => @city.features, :city => @city
8
8
  = render 'ish_manager/newsitems/index', :newsitems => @city.newsitems, :city => @city
9
+
9
10
  .row
10
11
  .col-sm-6= render 'ish_manager/reports/index', :reports => @city.reports
11
12
  .col-sm-6= render 'ish_manager/galleries/index', :galleries => @city.galleries # @TODO: why not render index?
@@ -1,24 +1,45 @@
1
1
 
2
- = form_for event do |f|
3
- .a
4
- = f.label :name
5
- = f.text_field :name
2
+ = form_for event, :html => { :multipart => true } do |f|
3
+ .row
4
+ .col-sm-4
5
+ .input-field
6
+ = f.label :name
7
+ = f.text_field :name
8
+ .col-sm-4
9
+ .input-field
10
+ = f.label :eventname
11
+ = f.text_field :eventname
12
+ .col-sm-4
13
+ .input-field
14
+ = f.label :date
15
+ = f.text_field :date
6
16
 
7
- .a
8
- = f.label :eventname
9
- = f.text_field :eventname
17
+ .row
18
+ .col-sm-6
19
+ .input-field
20
+ = f.select :city, options_for_select( @cities_list, :selected => event.city_id )
21
+ = f.label :city
22
+ .col-sm-3
23
+ .input-field
24
+ = f.text_field :x
25
+ = f.label :x
26
+ .col-sm-3
27
+ .input-field
28
+ = f.text_field :y
29
+ = f.label :y
10
30
 
11
- .a
12
- = f.label :city
13
- = f.select :city, options_for_select( @cities_list, :selected => event.city_id )
31
+ .row
32
+ .col-sm-12
33
+ .input-field
34
+ = f.text_area :description, :class => [ :tinymce ]
35
+ %br
36
+ %br
37
+ = file_field_tag :photo
38
+ - begin
39
+ = image_tag event.profile_photo.photo.url(:thumb)
40
+ - rescue
14
41
 
15
- .a
16
- = f.label :date
17
- = f.text_field :date
18
-
19
- .a
20
- = f.text_area :description, :class => [ :tinymce ]
21
-
22
- .a
23
- = f.submit
42
+ %br
43
+ %br
44
+ = f.submit
24
45
 
@@ -1,6 +1,9 @@
1
1
 
2
2
  .manager-events--index
3
- %h5 Events (#{events.length}) #{link_to new_img, new_event_path}
3
+ %h5
4
+ Events (#{events.length}) #{link_to new_img, new_event_path}
5
+ - if @resource
6
+ in #{@resource.class.name} #{link_to @resource.name, resource_path( @resource )}
4
7
  %table
5
8
  %tr
6
9
  %th actions
@@ -2,6 +2,5 @@
2
2
  .row
3
3
  .large-12.columns
4
4
  %h3 New Gallery
5
- = flash[:error]
6
5
 
7
6
  = render 'form', :gallery => @gallery
@@ -9,15 +9,21 @@
9
9
  .input-field
10
10
  = f.label :name
11
11
  = f.text_field :name
12
+
12
13
  .col-xs-12.col-md-6
13
14
  .input-field
14
- = f.label :name_seo
15
15
  = f.text_field :name_seo
16
+ = f.label :name_seo
16
17
  .row
17
18
  .col-xs-12.col-md-6
18
19
  .input-field
19
20
  = f.select :parent_tag_id, options_for_select( @tags_list, :selected => ( params[:for_tag] || @tag.parent_tag_id ) )
20
21
  = f.label "parent tag"
22
+ .row
23
+ .col-xs-12.col-md-6
24
+ .input-field
25
+ = f.select :city, options_for_select( @cities_list, :selected => @tag.city_id )
26
+ = f.label "city"
21
27
  .col-xs-12.col-md-6
22
28
  .input-field
23
29
  = f.select :site, options_for_select( @sites_list, :selected => @tag.site_id )
@@ -8,9 +8,10 @@
8
8
  .small-12.columns
9
9
  .center
10
10
  %h1
11
- Tags (#{Tag.count})
12
- = link_to '[+]', new_tag_path
13
-
11
+ Tags (#{@tags.count}) #{link_to image_new, new_tag_path}
12
+ - if @resource
13
+ in #{@resource.class.name} #{link_to @resource.name, resource_path(@resource)}
14
+
14
15
  %ul.tags
15
16
  - @tags.each do |tag|
16
17
  = render 'item', :tag => tag
data/config/routes.rb CHANGED
@@ -12,6 +12,7 @@ IshManager::Engine.routes.draw do
12
12
  resources :videos
13
13
  resources :events
14
14
  resources :venues
15
+ resources :tags
15
16
  end
16
17
 
17
18
  resources :email_templates
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.139
4
+ version: 0.1.8.140
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -150,6 +150,7 @@ files:
150
150
  - app/assets/stylesheets/ish_manager/application.css
151
151
  - app/assets/stylesheets/ish_manager/bootstrap.css
152
152
  - app/assets/stylesheets/ish_manager/materialize.css
153
+ - app/assets/stylesheets/ish_manager/tags.css
153
154
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css
154
155
  - app/assets/stylesheets/ish_manager/trash/bootstrap.min.css.map
155
156
  - app/controllers/ish_manager/ally_controller.rb