ish_manager 0.1.8.254 → 0.1.8.258

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
  SHA256:
3
- metadata.gz: 5903ed4090a57c3971bbb165c95c8f38f35dc33b3416c5847a04686b849b4a4b
4
- data.tar.gz: 01f8182c18dc23f279e888420e818484daf009098f08f8ea5e52cd0a0a21d168
3
+ metadata.gz: e880865158238e4e853e2ff014bcdf33d2f7a34c090d340e1444215c1445b204
4
+ data.tar.gz: c52428e4febc8b285e8eecdeed98734f1dc40da6fb28eb8c98f43a7f507fada0
5
5
  SHA512:
6
- metadata.gz: aff55865c4f44389c4ef0c48511627bf94845cb8564b292dbbe717b59c724141db3908bc7cb9384a16636f47ece62689920f28d80c3f7f95c4b8228a9cf6ba37
7
- data.tar.gz: 3252c924e5ad197ff837efb41d3ba58a261c39376e5a51c7076843966fac7c8ee2ba78ff698f2201e32a145a14a9107c2ebb33608ee3ba5cb60e762e30174ed9
6
+ metadata.gz: 10819c852f56a077077691f454b7894ceff83a6bfc0e0e7b6838fe9c86480b4a19e901f9513249f543c353ea87828591a4739b276eebdb80e3766f68d89b141d
7
+ data.tar.gz: e13e3aeedddfee4f4c798ef1350aa11a8f25d61c035bd923e1aa72f5c9a9cd332db63150f4b624ea3e786b891c75207eb72644d718d3d2af7615b3d02ef3b9d8
@@ -61,6 +61,14 @@ pre {
61
61
  padding: 1em;
62
62
  }
63
63
 
64
+ .bordered {
65
+ border: 1px solid grey;
66
+ padding: .5em;
67
+ border-radius: 8px;
68
+ margin-bottom: .5em;
69
+ }
70
+
71
+
64
72
  /* C */
65
73
 
66
74
  .center {
@@ -3,4 +3,9 @@
3
3
  .item {
4
4
  margin-bottom: 3em;
5
5
  }
6
+
7
+ /* clear nth! */
8
+ .row div:nth-child(2n+1) {
9
+ clear:left
10
+ }
6
11
  }
@@ -25,6 +25,7 @@ module IshManager
25
25
  end
26
26
 
27
27
  def set_lists
28
+ # alphabetized! : )
28
29
  @cities_list = City.list
29
30
  @galleries_list = Gallery.all.list
30
31
  @locations_list = ::Gameui::Map.list
@@ -2,33 +2,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
2
2
 
3
3
  before_action :set_lists
4
4
 
5
- def index
6
- authorize! :index, Gallery
7
- @galleries = Gallery.unscoped.where( :is_done.in => [false, nil], :is_trash.in => [false, nil],
8
- :user_profile => current_user.profile ).order_by( :created_at => :desc )
9
- if params[:q]
10
- @galleries = @galleries.where({ :name => /#{params[:q]}/i })
11
- @galleries.selector.delete('is_done')
12
- end
13
- @galleries = @galleries.page( params[:galleries_page] ).per( 10 )
14
-
15
- render params[:render_type]
16
- end
17
-
18
- def shared_with_me
19
- authorize! :index, Gallery
20
- @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
21
- ).order_by( :created_at => :desc
22
- ).page( params[:shared_galleries_page] ).per( 10 )
23
- render params[:render_type]
24
- end
25
-
26
- def new
27
- @gallery = Gallery.new
28
- authorize! :new, @gallery
29
- @cities_list = City.list
30
- @tags_list = Tag.list
31
- end
5
+ # alphabetized! : )
32
6
 
33
7
  def create
34
8
  params[:gallery][:shared_profiles] ||= []
@@ -45,18 +19,78 @@ class IshManager::GalleriesController < IshManager::ApplicationController
45
19
  redirect_to edit_gallery_path(@gallery)
46
20
  else
47
21
  puts! @gallery.errors.messages
48
- flash[:alert] = 'No Luck. ' + @gallery.errors.inspect
49
- @cities_list = City.list
50
- @tags_list = Tag.list
22
+ flash[:alert] = "Cannot create the gallery: #{@gallery.errors.full_messages}"
51
23
  render :action => 'new'
52
24
  end
53
25
  end
54
26
 
27
+ def destroy
28
+ @gallery = Gallery.unscoped.find params[:id]
29
+ authorize! :destroy, @gallery
30
+ @gallery.is_trash = true
31
+ @gallery.save
32
+ flash[:notice] = 'Logically deleted gallery.'
33
+ redirect_to galleries_path
34
+ end
35
+
55
36
  def edit
56
37
  @gallery = Gallery.unscoped.find params[:id]
57
38
  authorize! :edit, @gallery
58
39
  end
59
40
 
41
+ def index
42
+ authorize! :index, Gallery
43
+ @galleries = Gallery.unscoped.where( :is_done.in => [false, nil], :is_trash.in => [false, nil],
44
+ :user_profile => current_user.profile ).order_by( :created_at => :desc )
45
+ if params[:q]
46
+ @galleries = @galleries.where({ :name => /#{params[:q]}/i })
47
+ @galleries.selector.delete('is_done')
48
+ end
49
+ @galleries = @galleries.page( params[:galleries_page] ).per( 10 )
50
+
51
+ render params[:render_type]
52
+ end
53
+
54
+ def j_show
55
+ @gallery = Gallery.unscoped.find( params[:id] )
56
+ authorize! :show, @gallery
57
+ respond_to do |format|
58
+ format.json do
59
+ jjj = {}
60
+ jjj[:photos] = @gallery.photos.map do |ph|
61
+ { :thumbnail_url => ph.photo.url( :thumb ),
62
+ :delete_type => 'DELETE',
63
+ :delete_url => photo_path(ph) }
64
+ end
65
+ render :json => jjj
66
+ end
67
+ end
68
+ end
69
+
70
+ def new
71
+ @gallery = Gallery.new
72
+ authorize! :new, @gallery
73
+ end
74
+
75
+ def shared_with_me
76
+ authorize! :index, Gallery
77
+ @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
78
+ ).order_by( :created_at => :desc
79
+ ).page( params[:shared_galleries_page] ).per( 10 )
80
+ render params[:render_type]
81
+ end
82
+
83
+ def show
84
+ begin
85
+ @gallery = Gallery.unscoped.find_by :slug => params[:id]
86
+ rescue
87
+ @gallery = Gallery.unscoped.find params[:id]
88
+ end
89
+ authorize! :show, @gallery
90
+ @photos = @gallery.photos.unscoped.where({ :is_trash => false })
91
+ @deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true })
92
+ end
93
+
60
94
  def update
61
95
  @gallery = Gallery.unscoped.find params[:id]
62
96
  old_shared_profile_ids = @gallery.shared_profiles.map(&:id)
@@ -81,41 +115,5 @@ class IshManager::GalleriesController < IshManager::ApplicationController
81
115
  end
82
116
  end
83
117
 
84
- def show
85
- begin
86
- @gallery = Gallery.unscoped.find_by :slug => params[:id]
87
- rescue
88
- @gallery = Gallery.unscoped.find params[:id]
89
- end
90
- authorize! :show, @gallery
91
- @photos = @gallery.photos.unscoped.where({ :is_trash => false })
92
- @deleted_photos = @gallery.photos.unscoped.where({ :is_trash => true })
93
- end
94
-
95
- def destroy
96
- @gallery = Gallery.unscoped.find params[:id]
97
- authorize! :destroy, @gallery
98
- @gallery.is_trash = true
99
- @gallery.save
100
- flash[:notice] = 'Logically deleted gallery.'
101
- redirect_to galleries_path
102
- end
103
-
104
- def j_show
105
- @gallery = Gallery.unscoped.find( params[:id] )
106
- authorize! :show, @gallery
107
- respond_to do |format|
108
- format.json do
109
- jjj = {}
110
- jjj[:photos] = @gallery.photos.map do |ph|
111
- { :thumbnail_url => ph.photo.url( :thumb ),
112
- :delete_type => 'DELETE',
113
- :delete_url => photo_path(ph) }
114
- end
115
- render :json => jjj
116
- end
117
- end
118
- end
119
-
120
118
  end
121
119
 
@@ -66,6 +66,11 @@ class IshManager::Ability
66
66
  if user.profile && :manager == user.profile.role_name
67
67
  can [ :create_newsitem, :show, :new_feature, :create_feature,
68
68
  :index, :new, :create, :edit, :update ], City
69
+
70
+ can [ :edit, :index, :show, :update,
71
+ :new_marker, :edit_marker, :create_marker, :update_marker,
72
+ ], Gameui::Map
73
+
69
74
  end
70
75
 
71
76
 
@@ -10,8 +10,9 @@
10
10
  %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
11
11
  %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
12
12
  %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
13
- %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
13
+ %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
14
14
  %ul.nav.nav-pills
15
+ %li{ :class => params[:controller] == 'ish_manager/maps' ? 'active' : '' }= link_to 'GameUi::Maps', maps_path
15
16
  %li{ :class => params[:controller] == 'ish_manager/cities' ? 'active' : '' }= link_to 'Cities', cities_path
16
17
  %li{ :class => params[:controller] == 'ish_manager/events' ? 'active' : '' }= link_to 'Events', events_path
17
18
  %li{ :class => params[:controller] == 'ish_manager/venues' ? 'active' : '' }= link_to 'Venues', venues_path
@@ -21,13 +21,15 @@
21
21
  %p.addToggle Markers (#{@map.markers.count}) [<>]
22
22
  .markers-list
23
23
  - @map.markers.each do |marker|
24
- .item
24
+ .flex-row.bordered
25
+ = image_tag marker.image.image.url(:original)
25
26
  .flat-row
26
27
  .a= marker.slug
27
28
  .a= button_to '~', edit_marker_path(marker), method: :get
28
29
  .a= button_to 'x', marker_path(marker), method: :delete, data: { confirm: 'Are you sure?' }
29
30
  .a= link_to '[api]', api_marker_path(marker)
30
31
  .a= link_to '[this map]', edit_map_path(marker.slug)
32
+ .hide
31
33
  %ul.bullets
32
34
  %li <b>item_type:</b> #{marker.item_type}
33
35
 
@@ -35,7 +35,7 @@
35
35
  = f.label :image
36
36
  = file_field_tag :image
37
37
  .image-thumb
38
- = image_tag(@marker.image.image.url(:thumb)) rescue nil
38
+ = image_tag(@marker.image.image.url(:original)) rescue nil
39
39
  = image_tag('icons/10x10_red-cross.png', class: 'red-cross', style: "top: #{@marker.centerOffsetY-10}px; left: #{@marker.centerOffsetX-10}px;" )
40
40
  .col.s3
41
41
  .field
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.254
4
+ version: 0.1.8.258
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-27 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -213,9 +213,6 @@ files:
213
213
  - app/controllers/ish_manager/sites_controller.rb
214
214
  - app/controllers/ish_manager/stock_watches_controller.rb
215
215
  - app/controllers/ish_manager/tags_controller.rb
216
- - app/controllers/ish_manager/trash/ally_controller.rb
217
- - app/controllers/ish_manager/trash/stock_actions_controller.rb
218
- - app/controllers/ish_manager/trash/stock_options_controller.rb
219
216
  - app/controllers/ish_manager/user_profiles_controller.rb
220
217
  - app/controllers/ish_manager/users_controller.rb
221
218
  - app/controllers/ish_manager/venues_controller.rb
@@ -1,8 +0,0 @@
1
-
2
- class IshManager::AllyController < IshManager::ApplicationController
3
-
4
- def home
5
- authorize! :ally_home, IshManager::Ability
6
- end
7
-
8
- end
@@ -1,60 +0,0 @@
1
-
2
- class IshManager::StockActionsController < IshManager::ApplicationController
3
-
4
- PERMITTED_PARAMS = [ :stock_watch, :is_active ]
5
-
6
- def index
7
- authorize! :index, Ish::StockAction
8
- @profiles = IshModels::UserProfile.all
9
- @stock_watches_list = Ish::StockWatch.all.map { |w| [w.to_s, w.id] }
10
- @stock_options_list = Ish::StockOption.all.map { |o| [ o.to_s, o.id] }
11
- @stock_actions = Ish::StockAction.all.includes( :profile )
12
- @stock_action = Ish::StockAction.new
13
- render 'index', :layout => 'ish_manager/application_no_materialize'
14
- end
15
-
16
- def create
17
- @stock_action = Ish::StockAction.new params.require(:ish_stock_action).permit( PERMITTED_PARAMS )
18
- @stock_action.profile = current_user.profile
19
- authorize! :create, @stock_action
20
-
21
- flag = true
22
- if params[:ish_stock_action][:stock_options]
23
- stock_options = Ish::StockOption.where( :id.in => params[:ish_stock_action][:stock_options] )
24
- flag = stock_options.update_all( :stock_action_id => @stock_action.id )
25
- end
26
- if flag
27
- flag = @stock_action.save
28
- end
29
- if flag
30
- flash[:notice] = 'Created stock action.'
31
- else
32
- flash[:alert] = "Cannot create stock action: #{@stock_action.errors.messages}"
33
- end
34
- redirect_to :action => 'index'
35
- end
36
-
37
- def update
38
- @stock_action = Ish::StockAction.find params[:id]
39
- authorize! :update, @stock_action
40
-
41
- flag = true
42
- if params[:ish_stock_action][:stock_options]
43
- stock_options = Ish::StockOption.where( :id.in => params[:ish_stock_action][:stock_options] )
44
- flag = stock_options.update_all( :stock_action_id => @stock_action.id )
45
- end
46
- if flag
47
- flag = @stock_action.update_attributes params.require(:ish_stock_action).permit( PERMITTED_PARAMS )
48
- end
49
- if flag
50
- flash[:notice] = 'Updated stock action.'
51
- else
52
- flash[:alert] = "Cannot update stock action: #{@stock_action.errors.messages}"
53
- end
54
- redirect_to :action => 'index'
55
- end
56
-
57
- end
58
-
59
-
60
-
@@ -1,41 +0,0 @@
1
-
2
- class IshManager::StockOptionsController < IshManager::ApplicationController
3
-
4
- def index
5
- authorize! :index, Ish::StockOption
6
- @profiles = IshModels::UserProfile.all
7
- @stock_options = Ish::StockOption.all.includes( :profile )
8
- @stock_option = Ish::StockOption.new
9
- render 'index', :layout => 'ish_manager/application_no_materialize'
10
- end
11
-
12
- def create
13
- @stock_option = Ish::StockOption.new params[:ish_stock_option].permit!
14
- @stock_option.profile = current_user.profile
15
- authorize! :create, @stock_option
16
- flag = @stock_option.save
17
-
18
- if flag
19
- flash[:notice] = 'Created stock option.'
20
- else
21
- flash[:alert] = "Cannot create stock option: #{@stock_option.errors.messages}"
22
- end
23
- redirect_to :action => 'index'
24
- end
25
-
26
- def update
27
- @stock_option = Ish::StockOption.find params[:id]
28
- authorize! :update, @stock_option
29
- flag = @stock_option.update_attributes params[:ish_stock_option].permit!
30
- if flag
31
- flash[:notice] = 'Updated stock option.'
32
- else
33
- flash[:alert] = "Cannot update stock option: #{@stock_option.errors.messages}"
34
- end
35
- redirect_to :action => 'index'
36
- end
37
-
38
- end
39
-
40
-
41
-