ishapi 0.1.8.53 → 0.1.8.54

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
  SHA1:
3
- metadata.gz: b62f4c9e48fbdace0290ac3548dea0ee7c95e0d2
4
- data.tar.gz: 72e101241e6e8be73e6b3c5adcfe9ed0f993319f
3
+ metadata.gz: 183ed41578658cfbf4c05b46e2e4f415044e1f6a
4
+ data.tar.gz: ce53db992cb8fce63be8af00c4161e10e4c186b0
5
5
  SHA512:
6
- metadata.gz: 0aa6eed78a9ba44ae37032f9b42fd4a5fe9efb2933346c87319fee34a3a1f2cc4fa4ac25763f8065b27f47bad24e5ce99c06319259f02e8c39cca841094213de
7
- data.tar.gz: f93bfcf69162647fc2a92d74d1cca173d10e44f1c3622dc40e429cef460ff38ba931a6c360c8470b192360a9e03d6e8de1c8dbc7804b39d5bee0d283513f5993
6
+ metadata.gz: 1462a727f8980131b9fb84bd94c422456a3057894474c835f1c1ffc8bb9c11875b0190071f5cc55934ae4347f0fa7309019c3f10b6649e5b6d33fac2638976f7
7
+ data.tar.gz: 1385f7170798ccc196f6075e995097b71cadcd7721ecfeb746321b1f1e6e65ba9bd91f8f69ad92752724a6cee62b62f70476b105d61730cfc45ed05a8c51d533
@@ -16,7 +16,9 @@ module Ishapi
16
16
  @site = ::Site.find_by :domain => domain, :lang => :en
17
17
  authorize! :show, @site
18
18
 
19
+ @galleries = @site.galleries.limit( 10 )
19
20
  @newsitems = @site.newsitems.limit(10)
21
+ @reports = @site.reports.limit( 10 )
20
22
  @langs = ::Site.where( :domain => domain ).map( &:lang )
21
23
  end
22
24
 
@@ -0,0 +1,26 @@
1
+ require_dependency "ishapi/application_controller"
2
+ module Ishapi
3
+ class VideosController < ApplicationController
4
+
5
+ def show
6
+ @video = Video.unscoped.find_by :name_seo => params[:name_seo]
7
+ authorize! :show, @video
8
+ end
9
+
10
+ def index
11
+ authorize! :index, Video
12
+ @videos = Video.all
13
+ if params[:cityname]
14
+ city = City.find_by :cityname => params[:cityname]
15
+ @videos = @videos.where( :city_id => city.id )
16
+ end
17
+ if params[:domain]
18
+ site = Site.find_by :domain => params[:domain], :lang => :en
19
+ @videos = @videos.where( :site_id => site.id )
20
+ end
21
+
22
+ @videos = @videos.page( params[:videos_page] ).per( 10 )
23
+ end
24
+
25
+ end
26
+ end
@@ -50,5 +50,9 @@ class Ishapi::Ability
50
50
  can [ :show ], Venue do |venue|
51
51
  venue.is_public
52
52
  end
53
+ can [ :index ], Video
54
+ can [ :show ], Video do |video|
55
+ video.is_public
56
+ end
53
57
  end
54
58
  end
@@ -5,7 +5,6 @@
5
5
 
6
6
  json.array! @reports do |report|
7
7
  json.created_at report.created_at
8
-
9
8
  json.id report.id.to_s
10
9
  json.name report.name
11
10
  json.reportname report.name_seo
@@ -16,3 +15,4 @@ json.array! @reports do |report|
16
15
  end
17
16
  end
18
17
 
18
+
@@ -18,7 +18,7 @@ json.cache! key do
18
18
  # @TODO: move this to meta
19
19
  json.created_at @report.created_at.strftime('%Y%m%d')
20
20
  json.updated_at @report.updated_at.strftime('%Y%m%d')
21
- json.username @report.user_profile.name
21
+ json.username @report.user_profile.name if @report.user_profile
22
22
  json.cityname @report.city.cityname if @report.city
23
23
  json.tagname @report.tag.name_seo if @report.tag
24
24
 
@@ -18,7 +18,10 @@ json.cache! key do
18
18
  json.newsitems_per_page @site.newsitems_per_page
19
19
 
20
20
  json.partial! 'ishapi/features/index', :features => @site.features, :resource => @site
21
- json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
21
+ json.partial! 'ishapi/galleries/index', :galleries => @galleries, :resource => @site
22
+ json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems, :resource => @site
23
+ json.partial! 'ishapi/reports/index', :reports => @reports, :resource => @site
22
24
  json.partial! 'ishapi/videos/index', :videos => @site.videos
25
+
23
26
  end
24
27
  end
@@ -4,6 +4,8 @@
4
4
  #
5
5
 
6
6
  json.n_videos videos.count
7
- json.videos videos do |video|
8
- json.partial! 'ishapi/videos/show', :video => video
7
+ json.videos do
8
+ json.array! videos do |video|
9
+ json.partial! 'ishapi/videos/show', :video => video
10
+ end
9
11
  end
@@ -0,0 +1,3 @@
1
+
2
+
3
+ json.partial! 'ishapi/videos/index', :videos => @videos
data/config/routes.rb CHANGED
@@ -48,4 +48,6 @@ Ishapi::Engine.routes.draw do
48
48
  get 'venues', :to => 'venues#index'
49
49
  get 'venues/view/:venuename', :to => 'venues#show'
50
50
 
51
+ resources :videos
52
+
51
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.53
4
+ version: 0.1.8.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-26 00:00:00.000000000 Z
11
+ date: 2017-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -192,6 +192,7 @@ files:
192
192
  - app/controllers/ishapi/users_controller.rb~
193
193
  - app/controllers/ishapi/venues_controller.rb
194
194
  - app/controllers/ishapi/venues_controller.rb~
195
+ - app/controllers/ishapi/videos_controller.rb
195
196
  - app/helpers/ishapi/application_helper.rb
196
197
  - app/helpers/ishapi/articles_helper.rb
197
198
  - app/jobs/ishapi/application_job.rb
@@ -254,6 +255,7 @@ files:
254
255
  - app/views/ishapi/videos/_index.jbuilder~
255
256
  - app/views/ishapi/videos/_show.jbuilder
256
257
  - app/views/ishapi/videos/_show.jbuilder~
258
+ - app/views/ishapi/videos/index.jbuilder
257
259
  - app/views/layouts/ishapi/application.html.erb
258
260
  - config/initializers/koala.rb
259
261
  - config/routes.rb