ish_manager 0.1.8.214 → 0.1.8.215

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: 97420d8d5159de8bd16e2e2b4c364c72c0f90f1de487c7d4b9346e557a2c603b
4
- data.tar.gz: 98cf5b56ed11357f000d31f507f17834cdbbb1f97eeefc768511e71bce8f9042
3
+ metadata.gz: 9791d88698bca243d242655198761878359131f3101117d2451cef018afe5bb6
4
+ data.tar.gz: 15f1b4e28488b8c160097203e304c0d874dcff4be3501b537a3ed23b9237246f
5
5
  SHA512:
6
- metadata.gz: b91384e992d08ac1dad9d6a9bef4b7ff43d5a04f4729d679ee27f0a6954a49235008890aed9e05b0a75bfd782a8914d4ec23e53a120cbbcd56a1adb49f20da52
7
- data.tar.gz: fbd2cfaf7b4e1a436e62c57924f3f948bb996192e9f922603a63b1f02ab66243acfc6dbe219c304c8476c72c2e4177f7559dc89fec68aa598f35e3952f5559c1
6
+ metadata.gz: 7169b82928108aaa8a6bbc1306037899f9bea30623ee40a16cf7ec63064a8e3332557e538f2af63264ab1b0a00f68461e8aa610546d848c4bd1d5ae651827338
7
+ data.tar.gz: b86760c6d526595e2a10971fc3e493b5c11d1ae25f93204eb2e0536686ada3242936dd640087b4c2027007acd470449fdaf4eaea3bd4fd743b944965c05d09e2
@@ -202,3 +202,8 @@ table.stock_watches .trashy {
202
202
  border: 1px solid green;
203
203
  padding: 5px;
204
204
  }
205
+
206
+ .menu-secondary li.active a {
207
+ border-bottom: 5px solid black;
208
+ }
209
+
@@ -5,35 +5,22 @@ class IshManager::GalleriesController < IshManager::ApplicationController
5
5
  def index
6
6
  authorize! :index, Gallery
7
7
  @galleries = Gallery.unscoped.where( :is_trash => false, :user_profile => current_user.profile
8
- ).order_by( :created_at => :desc )
9
-
10
- if params[:render_type] == Gallery::RENDER_TITLES
11
- render 'index_titles'
12
- return
13
- else
14
- if params[:q]
15
- @galleries = @galleries.where({ :name => /#{params[:q]}/i })
16
- end
17
- @galleries = @galleries.page( params[:galleries_page] ).per( 20 )
18
- @shared_galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false ).page( params[:shared_galleries_page] ).per( 10 )
8
+ ).order_by( :created_at => :desc )
9
+ if params[:q]
10
+ @galleries = @galleries.where({ :name => /#{params[:q]}/i })
19
11
  end
12
+ @galleries = @galleries.page( params[:galleries_page] ).per( 20 )
20
13
 
14
+ render params[:render_type]
21
15
  end
22
16
 
23
- =begin
24
- def index_title
25
- end
26
- def index_thumb
27
- @galleries = Gallery.unscoped.where( :is_trash => false
28
- ).order_by( :created_at => :desc
29
- ).page( params[:galleries_page] ).per( 10 )
30
- end
31
- def index_mini
32
- @galleries = Gallery.unscoped.where( :is_trash => false
33
- ).order_by( :created_at => :desc
34
- ).page( params[:galleries_page] ).per( 10 )
17
+ def shared_with_me
18
+ authorize! :index, Gallery
19
+ @galleries = current_user.profile.shared_galleries.unscoped.where( :is_trash => false
20
+ ).order_by( :created_at => :desc
21
+ ).page( params[:shared_galleries_page] ).per( 10 )
22
+ render params[:render_type]
35
23
  end
36
- =end
37
24
 
38
25
  def new
39
26
  @gallery = Gallery.new
@@ -82,9 +69,7 @@ class IshManager::GalleriesController < IshManager::ApplicationController
82
69
  # puts! params[:gallery][:shared_profiles], 'shared profiles'
83
70
  if @gallery.update_attributes( params[:gallery].permit! )
84
71
  new_shared_profiles = IshModels::UserProfile.find( params[:gallery][:shared_profile_ids]
85
- ).select do |p|
86
- !old_shared_profile_ids.include?( p.id )
87
- end
72
+ ).select { |p| !old_shared_profile_ids.include?( p.id ) }
88
73
  ::IshManager::ApplicationMailer.shared_galleries( new_shared_profiles, @gallery ).deliver
89
74
  flash[:notice] = 'Success.'
90
75
  redirect_to galleries_path
@@ -1,4 +1,8 @@
1
- = form_tag galleries_path, :method => :get, :class => :search do
1
+
2
+ - # @TODO: definitely more abstract
3
+ - path ||= galleries_path
4
+
5
+ = form_tag path, :method => :get, :class => :search do
2
6
  .field.search_words
3
7
  .hide [x]
4
8
  = text_field_tag 'q', nil, :placeholder => 'Search'
@@ -0,0 +1,16 @@
1
+
2
+ .title
3
+ .row
4
+ .col-sm-12.col-md-12
5
+ %h1.center #{params[:action]} (#{@galleries.count}) #{link_to '[+]', new_gallery_path}
6
+ = render 'search'
7
+ %ul.menu-secondary
8
+ %li{ class: "#{params[:render_type] == 'index_titles' ? 'active' : ''}" }
9
+ = link_to 'titles list', galleries_index_titles_path( :render_type => Gallery::RENDER_THUMBS )
10
+ %li{ class: "#{params[:render_type] == 'index_thumbs' ? 'active' : ''}" }
11
+ = link_to 'thumbs list', galleries_index_thumbs_path( :render_type => Gallery::RENDER_TITLES )
12
+ %li{ class: "#{params[:render_type] == 'index_thumbs' ? 'active' : ''}" }
13
+ = link_to 'shared with me (thumbs)', galleries_shared_path( :render_type => Gallery::RENDER_THUMBS )
14
+ %li{ class: "#{params[:render_type] == 'index_titles' ? 'active' : ''}" }
15
+ = link_to 'shared with me (titles)', galleries_shared_titles_path
16
+
@@ -1,13 +1,18 @@
1
1
 
2
+ -# = render 'ish_manager/sites/header', :site => @site if @site
3
+
4
+ = render 'menu'
5
+
6
+
2
7
  - n_thumbs ||= 8
3
8
  - param_name ||= :galleries_page
4
9
 
5
- - if galleries.length > 0
10
+ - if @galleries.length > 0
6
11
  .galleries--list
7
- - if galleries.respond_to? :total_pages
8
- = paginate galleries, :param_name => param_name, :views_prefix => 'ish_manager'
12
+ - if @galleries.respond_to? :total_pages
13
+ = paginate @galleries, :param_name => param_name, :views_prefix => 'ish_manager'
9
14
 
10
- - galleries.each do |g|
15
+ - @galleries.each do |g|
11
16
  .panel
12
17
  .panel-body
13
18
  %h3
@@ -22,8 +27,9 @@
22
27
  - g.photos.limit( n_thumbs ).each do |photo|
23
28
  = link_to image_tag(photo.photo.url(:thumb), :alt => g.name, :class => :thumb ), gallery_path(g.galleryname)
24
29
 
25
- - if galleries.respond_to? :total_pages
26
- = paginate galleries, :param_name => param_name, :views_prefix => 'ish_manager'
30
+ - if @galleries.respond_to? :total_pages
31
+ = paginate @galleries, :param_name => param_name, :views_prefix => 'ish_manager'
27
32
 
28
33
  - else
29
34
  %h5 No Galleries
35
+
@@ -1,7 +1,5 @@
1
1
 
2
- .row
3
- .large-12.columns
4
- %h1 Titled Galleries
2
+ = render 'menu'
5
3
 
6
4
  %table#dataTable
7
5
  %thead
@@ -19,3 +17,4 @@
19
17
  %td
20
18
  = link_to '[~]', edit_gallery_path( g )
21
19
  = link_to '[x]', gallery_path( g ), :method => :delete, :data => { :confirm => 'Are you sure?' }
20
+
data/config/routes.rb CHANGED
@@ -23,12 +23,14 @@ IshManager::Engine.routes.draw do
23
23
  resources :feature
24
24
  resources :friends
25
25
 
26
- get 'galleries', :to => 'galleries#index'
26
+ get 'galleries', :to => 'galleries#index', :defaults => { :render_type => Gallery::RENDER_THUMBS }
27
27
  get 'galleries/index_titles', :to => 'galleries#index', :defaults => { :render_type => Gallery::RENDER_TITLES }
28
28
  get 'galleries/index_thumbs', :to => 'galleries#index', :defaults => { :render_type => Gallery::RENDER_THUMBS }
29
+ get 'galleries/shared', to: 'galleries#shared_with_me', defaults: { render_type: Gallery::RENDER_THUMBS }
30
+ get 'galleries/shared_titles', to: 'galleries#shared_with_me', defaults: { render_type: Gallery::RENDER_TITLES
31
+ }, as: :galleries_shared_titles
29
32
  resources :galleries do
30
33
  post 'multiadd', :to => 'photos#j_create', :as => :multiadd
31
- resources :newsitems
32
34
  end
33
35
 
34
36
  resources :invoices do
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.214
4
+ version: 0.1.8.215
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -223,12 +223,12 @@ files:
223
223
  - app/views/ish_manager/application/_form_errors.haml
224
224
  - app/views/ish_manager/application/_main_footer.haml
225
225
  - app/views/ish_manager/application/_main_header.haml
226
- - app/views/ish_manager/application/_main_header_.haml
227
226
  - app/views/ish_manager/application/_main_header_admin.haml
228
227
  - app/views/ish_manager/application/_main_header_guy.haml
229
228
  - app/views/ish_manager/application/_main_header_manager.haml
230
229
  - app/views/ish_manager/application/_meta.haml
231
230
  - app/views/ish_manager/application/_profile_pic.haml
231
+ - app/views/ish_manager/application/_search.haml
232
232
  - app/views/ish_manager/application/home.haml
233
233
  - app/views/ish_manager/application_mailer/condor_followup_alerb.html.erb
234
234
  - app/views/ish_manager/application_mailer/shared_galleries.html.erb
@@ -261,14 +261,12 @@ files:
261
261
  - app/views/ish_manager/features/show.haml
262
262
  - app/views/ish_manager/friends/index.haml
263
263
  - app/views/ish_manager/galleries/_form.haml
264
- - app/views/ish_manager/galleries/_index.haml
265
- - app/views/ish_manager/galleries/_index_title.haml
266
- - app/views/ish_manager/galleries/_search.haml
264
+ - app/views/ish_manager/galleries/_menu.haml
267
265
  - app/views/ish_manager/galleries/_thumbs.haml
268
266
  - app/views/ish_manager/galleries/_title.haml
269
267
  - app/views/ish_manager/galleries/edit.haml
270
- - app/views/ish_manager/galleries/index.haml
271
268
  - app/views/ish_manager/galleries/index_ajax.haml
269
+ - app/views/ish_manager/galleries/index_thumbs.haml
272
270
  - app/views/ish_manager/galleries/index_titles.haml
273
271
  - app/views/ish_manager/galleries/new.haml
274
272
  - app/views/ish_manager/galleries/show.haml
@@ -1,15 +0,0 @@
1
-
2
- .manager--main-header
3
- .container
4
- .row
5
- .col-sm-12
6
- %i.fa.fa-compress.collapse-expand#collapseHeader
7
- .content
8
- %ul.nav.nav-pills
9
- %li{ :class => params[:controller] == 'ish_manager/galleries' ? 'active' : '' }= link_to 'Galleries', galleries_path
10
- %li{ :class => params[:controller] == 'ish_manager/reports' ? 'active' : '' }= link_to 'Reports', reports_path
11
- %li{ :class => params[:controller] == 'ish_manager/videos' ? 'active' : '' }= link_to 'Videos', videos_path
12
- %li{ :class => params[:controller] == 'ish_manager/friends ' ? 'active' : '' }= link_to 'Friends', friends_path
13
- %ul.nav.nav-pills
14
- %hr
15
-
@@ -1,22 +0,0 @@
1
-
2
- -# galleries / _index_title
3
-
4
- - n_thumbs ||= 8
5
- - param_name ||= :galleries_page
6
-
7
- .manager--galleries-index
8
- %h5 Galleries (#{galleries.count}) #{link_to image_new, new_gallery_path}
9
-
10
- - if galleries.length > 0
11
- .galleries--list
12
- - galleries.each do |g|
13
- %h5
14
- = link_to '[~]', edit_gallery_path( g )
15
- = link_to g.name, gallery_path(g.galleryname)
16
- .c
17
-
18
- - if galleries.respond_to? :total_pages
19
- = paginate galleries, :param_name => param_name, :views_prefix => :ish_manager
20
-
21
- - else
22
- %p No Galleries
@@ -1,25 +0,0 @@
1
-
2
- - content_for :title do
3
- Manager Galleries Index
4
-
5
- = render 'ish_manager/sites/header', :site => @site if @site
6
-
7
- -# .title.hide
8
- .row
9
- .col-sm-12.col-md-12
10
- %h1.center Galleries
11
- %ul.menu-secondary
12
- %li= link_to 'titles list', galleries_index_titles_path( :render_type => Gallery::RENDER_THUMBS )
13
- %li= link_to 'thumbs list', galleries_index_thumbs_path( :render_type => Gallery::RENDER_TITLES )
14
-
15
- .row
16
- .col-sm-12.col-md-12
17
- %h4 My Galleries (#{@galleries.count}) #{link_to '[+]', new_gallery_path}
18
- = render 'search'
19
- - if params[:render_type] == Gallery::RENDER_TITLES
20
- = render 'ish_manager/galleries/index_title', :galleries => @galleries, :param_name => :galleries_page
21
- - else
22
- = render 'ish_manager/galleries/index', :galleries => @galleries, :param_name => :galleries_page
23
- .col-sm-12.col-md-6
24
- %h4 Shared with me
25
- = render 'ish_manager/galleries/index', :galleries => @shared_galleries, :param_name => :shared_galleries_page