ish_manager 0.1.8.256 → 0.1.8.257
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b660106cd844ab90b5803fd365df05e8d61fd3af1814ef776f593361daee27f
|
4
|
+
data.tar.gz: 158d6293c36c5386b67bd080968530588d987e57c9fdf681693cf56b6a44bbd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e230441cad9274a3ed7487b7fb2d8f7f2195dca79e910bfa85899d2b4f98faace4e82f7d44939e4a4bc744dcb0a50e7390db77b349f3cb72e168cf05e17c7c69
|
7
|
+
data.tar.gz: 4a8f0c327ab53d6fae4d4b14bfedb7db501f7cec920d74aa11cfa7fdffe09860674526930f4e13c33c63744d2452b849d459687600018415a65b65874dd4939b
|
@@ -2,33 +2,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
|
|
2
2
|
|
3
3
|
before_action :set_lists
|
4
4
|
|
5
|
-
|
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] =
|
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
|
|
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.
|
4
|
+
version: 0.1.8.257
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|