ish_manager 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ish_manager/application.js +1 -0
  3. data/app/assets/stylesheets/ish_manager/application.css +0 -4
  4. data/app/controllers/ish_manager/application_controller.rb +1 -1
  5. data/app/controllers/ish_manager/sites_controller.rb +0 -2
  6. data/app/helpers/ish_manager/images_helper.rb +1 -2
  7. data/app/views/ish_manager/application/_main_footer.haml +2 -6
  8. data/app/views/ish_manager/cities/edit.haml +3 -3
  9. data/app/views/ish_manager/sites/_form.haml +1 -1
  10. data/app/views/ish_manager/sites/edit.haml +2 -2
  11. data/app/views/ish_manager/sites/index.haml +7 -7
  12. data/app/views/layouts/ish_manager/application.haml +1 -2
  13. data/config/routes.rb +1 -4
  14. data/lib/ish_manager.rb +0 -2
  15. data/lib/ish_manager/version.rb +1 -1
  16. metadata +1 -80
  17. data/app/controllers/ish_manager/features_controller.rb +0 -125
  18. data/app/controllers/ish_manager/galleries_controller.rb +0 -86
  19. data/app/controllers/ish_manager/newsitems_controller.rb +0 -113
  20. data/app/controllers/ish_manager/photos_controller.rb +0 -55
  21. data/app/controllers/ish_manager/reports_controller.rb +0 -64
  22. data/app/controllers/ish_manager/tags_controller.rb +0 -54
  23. data/app/controllers/ish_manager/users_controller.rb +0 -13
  24. data/app/views/ish_manager/features/_form.haml +0 -61
  25. data/app/views/ish_manager/features/_index.haml +0 -23
  26. data/app/views/ish_manager/features/_item.haml +0 -14
  27. data/app/views/ish_manager/features/edit.haml +0 -16
  28. data/app/views/ish_manager/features/index.haml +0 -25
  29. data/app/views/ish_manager/features/new.haml +0 -11
  30. data/app/views/ish_manager/features/show.haml +0 -0
  31. data/app/views/ish_manager/galleries/#_thumbs.haml# +0 -5
  32. data/app/views/ish_manager/galleries/_form.haml +0 -46
  33. data/app/views/ish_manager/galleries/_index.haml +0 -14
  34. data/app/views/ish_manager/galleries/_list.haml +0 -23
  35. data/app/views/ish_manager/galleries/_list_short.haml +0 -9
  36. data/app/views/ish_manager/galleries/_menu_secondary.haml +0 -13
  37. data/app/views/ish_manager/galleries/_meta.haml +0 -16
  38. data/app/views/ish_manager/galleries/_search.haml +0 -7
  39. data/app/views/ish_manager/galleries/_thumbs.haml +0 -12
  40. data/app/views/ish_manager/galleries/_title.haml +0 -17
  41. data/app/views/ish_manager/galleries/all_photos.haml +0 -4
  42. data/app/views/ish_manager/galleries/edit.haml +0 -11
  43. data/app/views/ish_manager/galleries/index.haml +0 -18
  44. data/app/views/ish_manager/galleries/index_ajax.haml +0 -9
  45. data/app/views/ish_manager/galleries/index_mini.haml +0 -0
  46. data/app/views/ish_manager/galleries/index_short.haml +0 -19
  47. data/app/views/ish_manager/galleries/index_thumb.haml +0 -16
  48. data/app/views/ish_manager/galleries/index_title.haml +0 -15
  49. data/app/views/ish_manager/galleries/index_trash.haml +0 -20
  50. data/app/views/ish_manager/galleries/new.haml +0 -7
  51. data/app/views/ish_manager/galleries/show.haml +0 -34
  52. data/app/views/ish_manager/newsitems/_form.haml +0 -10
  53. data/app/views/ish_manager/newsitems/_index.haml +0 -17
  54. data/app/views/ish_manager/newsitems/_item.haml +0 -53
  55. data/app/views/ish_manager/newsitems/edit.haml +0 -14
  56. data/app/views/ish_manager/newsitems/new.haml +0 -16
  57. data/app/views/ish_manager/photos/_meta.haml +0 -9
  58. data/app/views/ish_manager/photos/_multinew.haml +0 -23
  59. data/app/views/ish_manager/photos/show.haml +0 -2
  60. data/app/views/ish_manager/photos/without_gallery.haml +0 -11
  61. data/app/views/ish_manager/reports/_form.haml +0 -42
  62. data/app/views/ish_manager/reports/_index.haml +0 -16
  63. data/app/views/ish_manager/reports/edit.haml +0 -6
  64. data/app/views/ish_manager/reports/index.haml +0 -26
  65. data/app/views/ish_manager/reports/new.haml +0 -5
  66. data/app/views/ish_manager/reports/show.haml +0 -18
  67. data/app/views/ish_manager/videos/_index.haml +0 -12
@@ -1,113 +0,0 @@
1
-
2
- class Manager::NewsitemsController < Manager::ManagerController
3
-
4
- def new
5
- authorize! :new, ManagerNewsitem.new
6
- @newsitem = Newsitem.new
7
- if params[:city_id]
8
- @city = City.find params[:city_id]
9
- @newsitem.city = @city
10
- end
11
- if params[:site_id]
12
- @site = Site.find params[:site_id]
13
- @newsitem.site = @site
14
- end
15
- end
16
-
17
- def create
18
- authorize! :create, ManagerNewsitem.new
19
-
20
- n = Newsitem.new params[:newsitem].permit!
21
- n.report = Report.find params[:newsitem][:report_id] unless params[:newsitem][:report_id].blank?
22
- n.gallery = Gallery.find params[:newsitem][:gallery_id] unless params[:newsitem][:gallery_id].blank?
23
- n.photo = Photo.find params[:newsitem][:photo_id] unless params[:newsitem][:photo_id].blank?
24
- n.descr = params[:newsitem][:descr]
25
-
26
- if params[:city_id]
27
- @city = City.find params[:city_id]
28
- @city.newsitems << n
29
- flag = @city.save
30
- if flag
31
- url = edit_manager_city_path( @city.id )
32
- else
33
- error = 'No Luck. ' + @city.errors.inspect
34
- end
35
- end
36
-
37
- if params[:site_id]
38
- @site = Site.find params[:site_id]
39
- @site.newsitems << n
40
- flag = @site.save
41
- if flag
42
- url = edit_manager_site_path( @site.id )
43
- else
44
- error = 'No Luck. ' + @site.errors.inspect
45
- end
46
- end
47
-
48
- if flag
49
- flash[:notice] = 'Success'
50
- redirect_to url
51
- else
52
- flash[:error] = error
53
- render :action => :new
54
- end
55
- end
56
-
57
- def show
58
- end
59
-
60
- def index
61
- end
62
-
63
- def destroy
64
- if params[:city_id]
65
- flag = City.find( params[:city_id] ).newsitems.find( params[:id] ).destroy
66
- url = edit_manager_city_path( params[:city_id] )
67
- end
68
- if params[:site_id]
69
- site = Site.find( params[:site_id] )
70
- flag = site.newsitems.find( params[:id] ).destroy
71
- url = edit_manager_site_path( params[:site_id] )
72
- end
73
-
74
- flash[:notice] = "Success? #{flag}"
75
- redirect_to url
76
- end
77
-
78
- def update
79
- if params[:site_id]
80
- @site = Site.find params[:site_id]
81
- @site.touch
82
- @newsitem = @site.newsitems.find params[:id]
83
- url = edit_manager_site_path( @site )
84
- end
85
- if params[:city_id]
86
- @city = City.find params[:city_id]
87
- @newsitem = @city.newsitems.find params[:id]
88
- url = edit_manager_city_path( @city )
89
- end
90
- flag = @newsitem.update_attributes params[:newsitem].permit!
91
-
92
- if flag
93
- flash[:notice] = 'Success'
94
- else
95
- flash[:error] = "No Luck: #{@newsitem.errors.messages}"
96
- end
97
-
98
- redirect_to url
99
- end
100
-
101
- def edit
102
- if params[:site_id]
103
- @site = Site.find params[:site_id]
104
- @newsitem = @site.newsitems.find( params[:id] )
105
- end
106
- if params[:city_id]
107
- @city = City.find params[:city_id]
108
- @newsitem = @city.newsitems.find( params[:id] )
109
- end
110
- end
111
-
112
- end
113
-
@@ -1,55 +0,0 @@
1
-
2
- class Manager::PhotosController < Manager::ManagerController
3
-
4
- # @TODO: this is bad? _vp_ 20170513
5
- skip_authorization_check :only => [ :j_create ]
6
- protect_from_forgery :except => [ :j_create]
7
-
8
- def without_gallery
9
- @photos = Photo.unscoped.where( :gallery => nil, :is_trash => false )
10
- end
11
-
12
- def destroy
13
- @photo = Photo.unscoped.find params[:id]
14
- @photo.is_trash = true
15
- @photo.save
16
- redirect_to request.referrer
17
- end
18
-
19
- def show
20
- @photo = Photo.unscoped.find params[:id]
21
- end
22
-
23
- def j_create
24
- @photo = Photo.new params[:photo].permit!
25
- authorize! :create, @photo
26
- @photo.is_public = true
27
-
28
- if params[:galleryname]
29
- gallery = Gallery.unscoped.where( :galleryname => params[:galleryname] ).first
30
- @photo.gallery_id = gallery.id
31
- elsif params[:gallery_id]
32
- gallery = Gallery.find( params[:gallery_id] )
33
- @photo.gallery_id = gallery.id
34
- end
35
-
36
- # @TODO this is badd
37
- @photo.user = User.where( :username => 'piousbox' ).first
38
-
39
- if @photo.save
40
- j = { :name => @photo.photo.original_filename,
41
- :size => @photo.photo.size,
42
- :url => @photo.photo.url( :large ),
43
- :thumbnail_url => @photo.photo.url( :thumb ),
44
- :delete_url => photo_path(@photo),
45
- :delete_type => 'DELETE',
46
- :name => @photo.name
47
- }
48
- render :json => [ j ]
49
- else
50
- render :json => { "errors" => @photo.errors }
51
- end
52
- end
53
-
54
- end
55
-
@@ -1,64 +0,0 @@
1
-
2
- class IshManager::ReportsController < IshManager::ApplicationController
3
-
4
- # before_filter :authenticate_user!
5
- # before_filter :set_lists
6
-
7
- def index
8
- authorize! :index, Report
9
- @reports = Report.unscoped.where( :is_trash => false ).page( params[:reports_page] ).per( Report::PER_PAGE )
10
- if false === params[:site]
11
- @reports = @reports.where( :site_id => nil )
12
- end
13
- if params[:site_id]
14
- @site = Site.find params[:site_id]
15
- @reports = @reports.where( :site_id => params[:site_id] )
16
- end
17
- end
18
-
19
- def show
20
- @report = Report.unscoped.where({ :is_trash => false }).find params[:id]
21
- authorize! :show, @report
22
- end
23
-
24
- def edit
25
- @report = Report.unscoped.find params[:id]
26
- end
27
-
28
- def destroy
29
- @report = Report.unscoped.find params[:id]
30
- @report.is_trash = true
31
- @report.save
32
- redirect_to request.referrer
33
- end
34
-
35
- def update
36
- @report = Report.unscoped.find params[:id]
37
- authorize! :update, @report
38
-
39
- # photo
40
- photo = Photo.new
41
- photo.photo = params[:report][:photo]
42
- photo.report_id = @report.id
43
- photo.user = @report.user
44
- photo.is_public = @report.is_public
45
- photo.is_trash = false
46
- photo.save
47
- @report.photo = photo
48
- params[:report][:photo] = nil
49
-
50
- respond_to do |format|
51
- if @report.update_attributes(params[:report].permit( :name, :subhead, :descr, :venue, :city, :x, :y, :tag, :is_public, :photo, :site, :site_id ))
52
- format.html do
53
- redirect_to manager_report_path(@report), :notice => 'Report was successfully updated.'
54
- end
55
- format.json { head :ok }
56
- else
57
- format.html { render :action => "edit" }
58
- format.json { render :json => @report.errors, :status => :unprocessable_entity }
59
- end
60
- end
61
- end
62
-
63
- end
64
-
@@ -1,54 +0,0 @@
1
-
2
- class Manager::TagsController < Manager::ManagerController
3
-
4
- before_filter :set_lists
5
-
6
- def index
7
- @tags = Tag.unscoped
8
- authorize! :index, Tag.new
9
- end
10
-
11
- def show
12
- @tag = Tag.unscoped.find params[:id]
13
- authorize! :show, @tag
14
- end
15
-
16
- def new
17
- @tag = Tag.new
18
- authorize! :new, @tag
19
- end
20
-
21
- def create
22
- @tag = Tag.create params[:tag].permit( :name, :name_seo, :descr, :is_public, :is_feature, :is_trash,
23
- :weight, :parent_tag_id, :site_id )
24
- authorize! :create, @tag
25
- if @tag.save
26
- flash[:notice] = 'Success.'
27
- redirect_to manager_tags_path
28
- else
29
- puts! @tag.errors, "error creating tag."
30
- flash[:error] = "No luck. #{@tag.errors.messages}"
31
- render :action => :new
32
- end
33
- end
34
-
35
- def edit
36
- @tag = Tag.unscoped.find params[:id]
37
- authorize! :edit, @tag
38
- end
39
-
40
- def update
41
- @tag = Tag.unscoped.find params[:id]
42
- authorize! :update, @tag
43
- if @tag.update_attributes params[:tag].permit( :name, :name_seo, :descr,
44
- :is_public, :is_trash, :is_feature, :weight,
45
- :site_id, :parent_tag_id )
46
- flash[:notice] = 'Success.'
47
- redirect_to manager_tags_path
48
- else
49
- flash[:error] = 'No luck.'
50
- render :action => :new
51
- end
52
- end
53
-
54
- end
@@ -1,13 +0,0 @@
1
-
2
- class Manager::UsersController < Manager::ManagerController
3
-
4
- def index
5
- @users = User.all
6
- end
7
-
8
- def show
9
- @user = User.find params[:id]
10
- end
11
-
12
- end
13
-
@@ -1,61 +0,0 @@
1
-
2
- -# manager/features/_form
3
-
4
- - if @site
5
- - if 'new' == params[:action]
6
- - url = manager_site_features_path site.id
7
- - if 'edit' == params[:action]
8
- - url = manager_site_feature_path site.id, feature.id
9
- - elsif @city
10
- - if 'new' == params[:action]
11
- - url = manager_city_features_path city.id
12
- - if 'edit' == params[:action]
13
- - url = manager_city_feature_path city.id, feature.id
14
- - elsif @tag
15
- - if 'new' == params[:action]
16
- - url = manager_tag_features_path tag.id
17
- - if 'edit' == params[:action]
18
- - url = manager_tag_feature_path tag.id, feature.id
19
-
20
- = form_for feature, :url => url do |f|
21
- .row
22
- .large-6.columns
23
- = f.label :name
24
- = f.text_field :name
25
- %br
26
- = f.label :subhead
27
- = f.text_field :subhead
28
- %br
29
- = f.label :image_path
30
- = f.text_field :image_path
31
- %br
32
- = f.label :link_path
33
- = f.text_field :link_path
34
- %br
35
- = f.label :photo
36
- = f.file_field :photo
37
- .large-6.columns
38
- = f.label :report
39
- = select :feature, :report_id, @reports_list
40
- %br
41
- = f.label :gallery
42
- = select :feature, :gallery_id, @galleries_list
43
- %br
44
- = f.label :video
45
- = select :feature, :video_id, @videos_list
46
-
47
- .row
48
- %hr
49
- .large-6.columns
50
- %br
51
- = f.label :weight
52
- = f.text_field :weight
53
- %br
54
- = f.label :partial_name
55
- = f.text_field :partial_name
56
- .large-6.columns
57
- .field
58
- = f.label :inner_html
59
- = f.text_area :inner_html
60
- .actions
61
- = f.submit
@@ -1,23 +0,0 @@
1
-
2
- - if defined? city
3
- - edit_url = -> (feature ) { edit_city_feature_path( city.id, feature.id ) }
4
- - delete_url = -> (feature ) { city_feature_path( city.id, feature.id ) }
5
- - new_path = new_city_feature_path( city.id )
6
- - if defined? site
7
- - edit_url = -> (feature) { edit_manager_site_feature_path( site.id, feature.id ) }
8
- - delete_url = -> (feature) { manager_site_feature_path( site.id, feature.id ) }
9
- - new_path = new_manager_site_feature_path( site.id )
10
-
11
- .manager-features--index
12
- %h2
13
- Features (#{features.length})
14
- = link_to '[+]', new_path
15
-
16
- -# = paginate features, :param_name => 'features_page'
17
- %ul.large-block-grid-4
18
- - features.each_with_index do |feature, idx|
19
- %li
20
- = link_to '[~]', edit_url.call( feature )
21
- = link_to '[x]', delete_url.call( feature ), :method => :delete, :data => { :confirm => 'Are you sure?' }
22
- .item= render 'manager/features/item', :feature => feature
23
-
@@ -1,14 +0,0 @@
1
-
2
- .panel
3
- - if !feature.partial_name.blank?
4
- = render feature.partial_name
5
- - else
6
- - unless feature[:name].blank?
7
- %h3= link_to feature[:name].titleize, feature[:link_path]
8
- - unless feature[:image_path].blank?
9
- = link_to image_tag( feature[:image_path] ), feature[:link_path]
10
- - unless feature[:subhead].blank?
11
- .descr= raw feature[:subhead]
12
- - unless feature.report.blank?
13
- %h3= link_to feature.report.name, report_path(feature.report.name_seo)
14
- .descr= raw feature.report.subhead
@@ -1,16 +0,0 @@
1
-
2
- .row
3
- .large-12.columns
4
- %h1
5
- Edit Feature
6
- .meta
7
- = "in city #{@feature.city.name}" unless @feature.city.blank?
8
- = "in site http://#{@feature.site.domain}/#{@feature.site.lang}" unless @feature.site.blank?
9
- = "in tag #{@feature.tag.name}" unless @feature.tag.blank?
10
-
11
- - if @site
12
- = render 'manager/features/form', :feature => @feature, :site => @site
13
- - elsif @city
14
- = render 'manager/features/form', :feature => @feature, :city => @city
15
- - elsif @tag
16
- = render 'manager/features/form', :feature => @feature, :tag => @tag
@@ -1,25 +0,0 @@
1
-
2
- .row
3
- .large-12.columns
4
- %h5 Features in <b>#{@resource.class.name}</b> #{@resource.name}/
5
-
6
- %ul
7
- - @resource.features.each do |feature|
8
- %li
9
- .gray= feature.id
10
-
11
- = link_to '[~]', edit_manager_city_feature_path( @resource, feature ) if 'City' == @resource.class.name
12
- = link_to '[~]', edit_manager_tag_feature_path( @resource, feature ) if 'Tag' == @resource.class.name
13
- = link_to '[~]', edit_manager_site_feature_path( @resource, feature ) if 'Site' == @resource.class.name
14
- = link_to '[~]', edit_manager_venue_feature_path( @resource, feature ) if 'Venue' == @resource.class.name
15
-
16
- = link_to( '[x]', manager_city_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'City' == @resource.class.name
17
- = link_to( '[x]', manager_tag_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'Tag' == @resource.class.name
18
- = link_to( '[x]', manager_site_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'Site' == @resource.class.name
19
- = link_to( '[x]', manager_venue_feature_path( @resource, feature ), :method => :delete, :data => { :confirm => :'Are you sure?' } ) if 'Venue' == @resource.class.name
20
-
21
- %ul
22
- %li Name #{feature.name}
23
- %li Subhead: #{feature.subhead}
24
- %li Report: #{feature.report}
25
- %li Gallery: #{feature.gallery}