ish_manager 0.1.8.22 → 0.1.8.23

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/ish_manager/application.css +11 -1
  3. data/app/controllers/ish_manager/tags_controller.rb +53 -0
  4. data/app/controllers/ish_manager/users_controller.rb +13 -0
  5. data/app/controllers/ish_manager/venues_controller.rb +48 -0
  6. data/app/controllers/ish_manager/venues_controller.rb~ +19 -0
  7. data/app/controllers/ish_manager/videos_controller.rb +96 -0
  8. data/app/views/ish_manager/application/_form_errors.haml +7 -0
  9. data/app/views/ish_manager/cities/show.haml +2 -1
  10. data/app/views/ish_manager/venues/_form.haml +25 -0
  11. data/app/views/ish_manager/venues/_form.haml~ +7 -0
  12. data/app/views/ish_manager/venues/_index.haml +14 -0
  13. data/app/views/ish_manager/venues/_index.haml~ +11 -0
  14. data/app/views/ish_manager/venues/edit.haml +5 -0
  15. data/app/views/ish_manager/venues/edit.haml~ +4 -0
  16. data/app/views/ish_manager/venues/index.haml +3 -0
  17. data/app/views/ish_manager/venues/index.haml~ +3 -0
  18. data/app/views/ish_manager/venues/new.haml +5 -0
  19. data/app/views/ish_manager/venues/new.haml~ +2 -0
  20. data/app/views/ish_manager/videos/_embed.erb +4 -0
  21. data/app/views/ish_manager/videos/_embed_half.erb +4 -0
  22. data/app/views/ish_manager/videos/_form.haml +52 -0
  23. data/app/views/ish_manager/videos/_form.haml~ +48 -0
  24. data/app/views/ish_manager/videos/_list.haml +14 -0
  25. data/app/views/ish_manager/videos/_list_small.haml +9 -0
  26. data/app/views/ish_manager/videos/edit.haml +7 -0
  27. data/app/views/ish_manager/videos/index.haml +16 -0
  28. data/app/views/ish_manager/videos/index.haml~ +0 -0
  29. data/app/views/ish_manager/videos/new.haml +5 -0
  30. data/app/views/ish_manager/videos/new.haml~ +5 -0
  31. data/app/views/ish_manager/videos/show.haml +16 -0
  32. metadata +30 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dab98bdd473dd73c5e605837baef4929d2c3a2e5
4
- data.tar.gz: c5b9dbf5af313ee127c5514b8f8de24cfe3c2826
3
+ metadata.gz: b7321ef6d866b6c6ef55008414a64bd2838c57aa
4
+ data.tar.gz: e01b404689d320b94b2dc60d032923b8e96be936
5
5
  SHA512:
6
- metadata.gz: 055cb68777f29f675ed4329af211d15b81508f1cd87e28c54e2d8a609ff3c38e83f72b4becc4ce70be8dee8b53dc79b71cdccea8e9c27eda5884539ffb4d4feb
7
- data.tar.gz: cb1caf9d2acf949542fa9d77c52d58d008ca90f42f7bb677f765e40e5f747334354fb2c453ec273f477aaff970c0eaf28e0b3818adddb89ad3ce647df3f43225
6
+ metadata.gz: b5cf4cb139bc4bd91696ca450ace3ce18dece7262477628227e8d64a954abcef65c874e18fe5afc937306a9a69a97a2b80ef46a1018ee26b047e4a781250e9dd
7
+ data.tar.gz: c37b1b4e10aa55eb68feec642265c481b6f92709d332514fc46e0ba0e591c7f8bcbe16356c93658dac69a7ded0b5634ed379a6b8bd12dfed5ca05b29718501d4
@@ -40,4 +40,14 @@ hr {
40
40
  }
41
41
  .large-photos img {
42
42
  width: 100%;
43
- }
43
+ }
44
+
45
+ .float-left {
46
+ float: left;
47
+ }
48
+ .float-right {
49
+ float: right;
50
+ }
51
+ .clearfix {
52
+ clear: both;
53
+ }
@@ -0,0 +1,53 @@
1
+
2
+ class IshManager::TagsController < IshManager::ApplicationController
3
+
4
+ before_action :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!
23
+ authorize! :create, @tag
24
+ if @tag.save
25
+ flash[:notice] = 'Success.'
26
+ redirect_to tags_path
27
+ else
28
+ puts! @tag.errors, "error creating tag."
29
+ flash[:error] = "No luck. #{@tag.errors.messages}"
30
+ render :action => :new
31
+ end
32
+ end
33
+
34
+ def edit
35
+ @tag = Tag.unscoped.find params[:id]
36
+ authorize! :edit, @tag
37
+ end
38
+
39
+ def update
40
+ @tag = Tag.unscoped.find params[:id]
41
+ authorize! :update, @tag
42
+ if @tag.update_attributes params[:tag].permit!
43
+ flash[:notice] = 'Success.'
44
+ redirect_to tags_path
45
+ else
46
+ flash[:error] = 'No luck.'
47
+ render :action => :new
48
+ end
49
+ end
50
+
51
+ end
52
+
53
+
@@ -0,0 +1,13 @@
1
+
2
+ class IshManager::UsersController < IshManager::ApplicationController
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
+
@@ -0,0 +1,48 @@
1
+
2
+ class IshManager::VenuesController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ def index
7
+ authorize! :index, Venue
8
+ @venues = Venue.all
9
+ end
10
+
11
+ def new
12
+ @venue = Venue.new
13
+ authorize! :new, @venue
14
+ end
15
+
16
+ def create
17
+ @venue = Venue.new params[:venue].permit!
18
+ authorize! :create, @venue
19
+ if @venue.save
20
+ redirect_to :action => :index
21
+ else
22
+ flash[:alert] = @venue.errors.messages
23
+ render :action => :new
24
+ end
25
+ end
26
+
27
+ def edit
28
+ @venue = Venue.find params[:id]
29
+ authorize! :edit, @venue
30
+ end
31
+
32
+ def update
33
+ @venue = Venue.find params[:id]
34
+ authorize! :update, @venue
35
+
36
+ flag = @venue.update_attributes params[:venue].permit!
37
+ if flag
38
+ flash[:notice] = 'updated venue'
39
+ redirect_to :action => :index
40
+ else
41
+ flash[:alert] = "No luck: #{@venue.errors.messages}"
42
+ render :action => :edit
43
+ end
44
+ end
45
+
46
+ end
47
+
48
+
@@ -0,0 +1,19 @@
1
+
2
+ class IshManager::VenuesController < IshManager::ApplicationController
3
+
4
+ def index
5
+ authorize! :index, Venue
6
+ end
7
+
8
+ def create
9
+ end
10
+
11
+ def edit
12
+ end
13
+
14
+ def update
15
+ end
16
+
17
+ end
18
+
19
+
@@ -0,0 +1,96 @@
1
+
2
+ class IshManager::VideosController < IshManager::ApplicationController
3
+
4
+ before_action :set_lists
5
+
6
+ def index
7
+ authorize! :index, Video.new
8
+ @videos = Video.all # .where( :site_id => @site.id )
9
+
10
+ if params[:city_id]
11
+ city = City.find params[:city_id]
12
+ @videos = @videos.where( :city => city )
13
+ end
14
+
15
+ if params[:tag_id]
16
+ tag = Tag.find params[:tag_id]
17
+ @videos = @videos.where( :tag => tag )
18
+ end
19
+
20
+ @videos = @videos.page( params[:videos_page] ).per( Video::PER_PAGE )
21
+
22
+ respond_to do |format|
23
+ format.html do
24
+ render
25
+ end
26
+ format.json do
27
+ render :json => @videos
28
+ end
29
+ end
30
+ end
31
+
32
+ def show
33
+ @video = Video.where( :youtube_id => params[:youtube_id] ).first
34
+ @video ||= Video.unscoped.find params[:id]
35
+ authorize! :show, @video
36
+
37
+ respond_to do |format|
38
+ format.html
39
+ format.json do
40
+ render :json => @video
41
+ end
42
+ end
43
+ end
44
+
45
+ def new
46
+ @video = Video.new
47
+ authorize! :new, @video
48
+
49
+ # @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
50
+ # @cities_list = City.list
51
+ end
52
+
53
+ def create
54
+ @video = Video.new params[:video].permit!
55
+ @video.user = current_user
56
+ if params[:video][:site_id]
57
+ @video.site = Site.find params[:video][:site_id]
58
+ else
59
+ @video.site = @site
60
+ end
61
+ authorize! :create, @video
62
+
63
+ if @video.save
64
+ flash[:notice] = 'Success'
65
+ redirect_to videos_path
66
+ else
67
+ flash[:error] = 'No luck'
68
+ @tags_list = Tag.list
69
+ @cities_list = City.list
70
+ render :action => 'new'
71
+ end
72
+ end
73
+
74
+ def edit
75
+ @video = Video.unscoped.find params[:video_id]
76
+ authorize! :edit, @video
77
+
78
+ @tags_list = Tag.unscoped.or( { :is_public => true }, { :user_id => current_user.id } ).list
79
+ @cities_list = City.list
80
+ end
81
+
82
+ def update
83
+ @video = Video.unscoped.find params[:video_id]
84
+ authorize! :update, @video
85
+
86
+ @video.update params[:video].permit!
87
+ if @video.save
88
+ flash[:notice] = 'Success.'
89
+ redirect_to organizer_path
90
+ else
91
+ flash[:error] = "No luck: #{@video.errors}"
92
+ render :edit
93
+ end
94
+ end
95
+
96
+ end
@@ -0,0 +1,7 @@
1
+
2
+ - if item.errors.any?
3
+ .error-explanation
4
+ %h5= t('e.there_are_errors')
5
+ %ul
6
+ - item.errors.full_messages.each do |msg|
7
+ %li= msg
@@ -53,6 +53,7 @@
53
53
  %ul
54
54
  - @city.events.each do |event|
55
55
  %li= event.name
56
+
57
+ = render :partial => 'ish_manager/venues/index', :locals => { :venues => @city.venues }
56
58
 
57
- %h3 Venues (#{@city.venues.length})
58
59
  %h3 Videos (#{@city.videos.length})
@@ -0,0 +1,25 @@
1
+
2
+ = form_for venue do |f|
3
+ .a
4
+ = f.label :name
5
+ = f.text_field :name
6
+
7
+ .a
8
+ = f.label :name_seo
9
+ = f.text_field :name_seo
10
+
11
+ .a
12
+ = f.label :descr
13
+ = f.text_area :descr
14
+
15
+ .a
16
+ coords
17
+ = f.text_field :x
18
+ = f.text_field :y
19
+
20
+ .a
21
+ = f.label :city
22
+ = f.select :city, options_for_select( @cities_list, :selected => venue.city_id )
23
+
24
+ .b
25
+ = f.submit
@@ -0,0 +1,7 @@
1
+
2
+ = form_for venue do |f|
3
+ .a
4
+ = f.label :name
5
+ = f.text_field :name
6
+ .b
7
+ = f.submit
@@ -0,0 +1,14 @@
1
+ .a
2
+ .b
3
+ %h3
4
+ Venues (#{venues.length})
5
+ = link_to '[+]', new_venue_path
6
+ %ol
7
+ - venues.each do |venue|
8
+ %li
9
+ = link_to '[~]', edit_venue_path( venue )
10
+ .float-left= button_to '[x]', venue_path( venue ), :method => 'delete', :html => { :confirm => 'Are you sure?' }
11
+ = link_to venue.name, venue_path( venue )
12
+ %br
13
+ %br
14
+ .clearfix
@@ -0,0 +1,11 @@
1
+ .a
2
+ .b
3
+ %h3
4
+ Venues (#{venues.length})
5
+ = link_to '[+]', new_venue_path
6
+ %ul
7
+ - venues.each do |venue|
8
+ %li.clearfix
9
+ = link_to '[~]', edit_venue_path( venue )
10
+ .float-left= button_to '[x]', venue_path( venue ), :method => 'delete', :html => { :confirm => 'Are you sure?' }
11
+ = link_to venue.name, venue_path( venue )
@@ -0,0 +1,5 @@
1
+
2
+ edit venue #{@venue.name}
3
+
4
+ = render :partial => 'form', :locals => { :venue => @venue }
5
+
@@ -0,0 +1,4 @@
1
+
2
+ edit venue #{@venue.name}
3
+
4
+ = render :partial => 'form', :locals => { :venue => @venue }
@@ -0,0 +1,3 @@
1
+
2
+ = render :partial => 'index', :locals => { :venues => @venues }
3
+
@@ -0,0 +1,3 @@
1
+
2
+ = render :partial => 'venues/index', :locals => { :venues => @venues }
3
+
@@ -0,0 +1,5 @@
1
+
2
+ %h1 new venue
3
+
4
+ = render :partial => 'form', :locals => { :venue => @venue }
5
+
@@ -0,0 +1,2 @@
1
+
2
+ %h1 new venue
@@ -0,0 +1,4 @@
1
+
2
+ <div class="video-embed">
3
+ <iframe width="560" height="315" src="http://www.youtube.com/embed/<%= video.youtube_id %>" frameborder="0" allowfullscreen></iframe>
4
+ </div>
@@ -0,0 +1,4 @@
1
+
2
+ <div class="video-embed-half">
3
+ <iframe width="430" height="322" src="http://www.youtube.com/embed/<%= video.youtube_id %>" frameborder="0" allowfullscreen></iframe>
4
+ </div>
@@ -0,0 +1,52 @@
1
+
2
+ - url = video.persisted? ? update_video_path( video ) : videos_path
3
+ = form_for video, :url => url do |f|
4
+
5
+ = render 'form_errors', :item => @video
6
+
7
+ .field
8
+ = f.label :youtube_id
9
+ = f.text_field :youtube_id
10
+
11
+ .field
12
+ = f.label :name
13
+ = f.text_field :name
14
+
15
+ .field
16
+ = f.label :tag_id
17
+ = select :video, :tag_id, @tags_list, :selected => params[:tag_id]
18
+
19
+ .field
20
+ = f.label :city_id
21
+ = select :video, :city_id, @cities_list
22
+
23
+ .field
24
+ = f.label :site_id
25
+ = select_tag 'video[site_id]', options_for_select( @sites_list )
26
+
27
+ .field
28
+ = f.label :descr
29
+ = f.text_field :descr
30
+
31
+ .row
32
+ .large-6.columns
33
+ = f.label :x
34
+ = f.text_field :x
35
+ .large-6.columns
36
+ = f.label :y
37
+ = f.text_field :y
38
+
39
+ .row
40
+ .small-4.columns
41
+ = f.label :is_public
42
+ = f.check_box :is_public
43
+ .small-4.columns
44
+ = f.label :is_trash
45
+ = f.check_box :is_trash
46
+ .small-4.columns
47
+ = f.label :is_feature
48
+ = f.check_box :is_feature
49
+
50
+
51
+ .action
52
+ = f.submit
@@ -0,0 +1,48 @@
1
+
2
+ - url = video.persisted? ? update_video_path( video ) : videos_path
3
+ = form_for video, :url => url do |f|
4
+
5
+ = render 'application/form_errors', :item => @video
6
+
7
+ .field
8
+ = f.label :youtube_id
9
+ = f.text_field :youtube_id
10
+
11
+ .field
12
+ = f.label :name
13
+ = f.text_field :name
14
+
15
+ .field
16
+ = f.label :tag_id
17
+ = select :video, :tag_id, @tags_list, :selected => params[:tag_id]
18
+
19
+ .field
20
+ = f.label :city_id
21
+ = select :video, :city_id, @cities_list
22
+
23
+ -# .field
24
+ -# = f.label :descr
25
+ -# = f.text_field :descr
26
+
27
+ .row
28
+ .large-6.columns
29
+ = f.label :x
30
+ = f.text_field :x
31
+ .large-6.columns
32
+ = f.label :y
33
+ = f.text_field :y
34
+
35
+ .row
36
+ .small-4.columns
37
+ = f.label :is_public
38
+ = f.check_box :is_public
39
+ .small-4.columns
40
+ = f.label :is_trash
41
+ = f.check_box :is_trash
42
+ .small-4.columns
43
+ = f.label :is_feature
44
+ = f.check_box :is_feature
45
+
46
+
47
+ .action
48
+ = f.submit
@@ -0,0 +1,14 @@
1
+
2
+ .videos-list
3
+ - if videos.blank?
4
+ = t('videos.no_videos')
5
+ - else
6
+ = paginate videos, :param_name => :videos_page, :views_prefix => 'templates'
7
+ - videos.each do |video|
8
+ .callout
9
+ %h5= link_to (video.name.blank? ? t('videos.no_title') : video.name), sites_video_path( @site.domain, video.youtube_id )
10
+ .text-center= render 'videos/embed', :video => video
11
+ = video.descr
12
+ = paginate videos, :param_name => :videos_page, :views_prefix => 'templates'
13
+ .c
14
+ .c
@@ -0,0 +1,9 @@
1
+
2
+ .list-small
3
+ %ul
4
+ - videos.each do |v|
5
+ %li
6
+ = image_tag( "http://img.youtube.com/vi/#{v.youtube_id}/1.jpg" )
7
+ = link_to '[~]', edit_video_path( v )
8
+ = link_to '[_]', video_path( v )
9
+ = paginate videos, :param_name => :videos_page, :views_prefix => 'templates'
@@ -0,0 +1,7 @@
1
+
2
+ -# videos / edit
3
+
4
+ .row
5
+ .large-12.columns
6
+ %h2 Edit video
7
+ = render 'videos/form', :video => @video
@@ -0,0 +1,16 @@
1
+
2
+ .a
3
+ .row
4
+ .large-12.columns
5
+ %h2
6
+ Videos (#{Video.count})
7
+ = link_to '[+]', new_video_path
8
+
9
+ = paginate @videos, :param_name => :videos_page
10
+ %ol
11
+ - @videos.each do |video|
12
+ %li
13
+ = video.name
14
+ = render :partial => 'embed', :locals => { :video => video }
15
+ = paginate @videos, :param_name => :videos_page
16
+
@@ -0,0 +1,5 @@
1
+
2
+ .row
3
+ .large-12.columns
4
+ %h2= t('videos.new')
5
+ = render 'form', :video => @video
@@ -0,0 +1,5 @@
1
+
2
+ .row
3
+ .large-12.columns
4
+ %h2= t('videos.new')
5
+ = render 'videos/form', :video => @video
@@ -0,0 +1,16 @@
1
+
2
+ - content_for :title do
3
+ #{@video.name} | #{@site.title}
4
+
5
+ .row
6
+ .large-12.columns
7
+
8
+ %h3
9
+ - if @video.name.blank?
10
+ = t('videos.no_title')
11
+ - else
12
+ = @video.name
13
+ = render 'application/meta', :item => @video
14
+ .text-center= render 'embed', :video => @video
15
+
16
+ = render 'disqus'
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.22
4
+ version: 0.1.8.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-09 00:00:00.000000000 Z
11
+ date: 2017-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -140,6 +140,11 @@ files:
140
140
  - app/controllers/ish_manager/photos_controller.rb
141
141
  - app/controllers/ish_manager/reports_controller.rb
142
142
  - app/controllers/ish_manager/sites_controller.rb
143
+ - app/controllers/ish_manager/tags_controller.rb
144
+ - app/controllers/ish_manager/users_controller.rb
145
+ - app/controllers/ish_manager/venues_controller.rb
146
+ - app/controllers/ish_manager/venues_controller.rb~
147
+ - app/controllers/ish_manager/videos_controller.rb
143
148
  - app/helpers/ish_manager/application_helper.rb
144
149
  - app/helpers/ish_manager/images_helper.rb
145
150
  - app/jobs/ish_manager/application_job.rb
@@ -147,6 +152,7 @@ files:
147
152
  - app/models/ish_manager/ability.rb
148
153
  - app/models/ish_manager/ability.rb~
149
154
  - app/models/ish_manager/application_record.rb
155
+ - app/views/ish_manager/application/_form_errors.haml
150
156
  - app/views/ish_manager/application/_main_footer.haml
151
157
  - app/views/ish_manager/application/_main_header.haml
152
158
  - app/views/ish_manager/application/_main_header.haml~
@@ -228,7 +234,29 @@ files:
228
234
  - app/views/ish_manager/tags/index.haml
229
235
  - app/views/ish_manager/tags/new.haml
230
236
  - app/views/ish_manager/tags/show.haml
237
+ - app/views/ish_manager/venues/_form.haml
238
+ - app/views/ish_manager/venues/_form.haml~
239
+ - app/views/ish_manager/venues/_index.haml
240
+ - app/views/ish_manager/venues/_index.haml~
241
+ - app/views/ish_manager/venues/edit.haml
242
+ - app/views/ish_manager/venues/edit.haml~
243
+ - app/views/ish_manager/venues/index.haml
244
+ - app/views/ish_manager/venues/index.haml~
245
+ - app/views/ish_manager/venues/new.haml
246
+ - app/views/ish_manager/venues/new.haml~
247
+ - app/views/ish_manager/videos/_embed.erb
248
+ - app/views/ish_manager/videos/_embed_half.erb
249
+ - app/views/ish_manager/videos/_form.haml
250
+ - app/views/ish_manager/videos/_form.haml~
231
251
  - app/views/ish_manager/videos/_index.haml
252
+ - app/views/ish_manager/videos/_list.haml
253
+ - app/views/ish_manager/videos/_list_small.haml
254
+ - app/views/ish_manager/videos/edit.haml
255
+ - app/views/ish_manager/videos/index.haml
256
+ - app/views/ish_manager/videos/index.haml~
257
+ - app/views/ish_manager/videos/new.haml
258
+ - app/views/ish_manager/videos/new.haml~
259
+ - app/views/ish_manager/videos/show.haml
232
260
  - app/views/layouts/ish_manager/application.haml
233
261
  - app/views/layouts/ish_manager/application.haml~
234
262
  - config/mongoid.yml