ishapi 0.1.8.41 → 0.1.8.42

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a883e11d90f8f74f961c6a91097556c3c2016d51
4
- data.tar.gz: 92ffa965314c84944c1748276aee2d537915904c
3
+ metadata.gz: 50478dc9ef74f07d9e55743549eae13b214a832a
4
+ data.tar.gz: 8186fe6dd4bf00b270bedea220a2835292375e4e
5
5
  SHA512:
6
- metadata.gz: ed517c30f438b146139b95ea752e655557d2e7f67e8f24a5413ee0a0a0e77c9d689f05300fdec57dd98b9a137dbca75bcf873f1a152d7820f644ed4c53d587eb
7
- data.tar.gz: f737444d0684f66300004a740e3e55afefc1a1037ae63054877242d88b26f809ef893b09f7cdb0bb15c78b6224cd98997a5b6ee7516bd9cbb000fb43966eec83
6
+ metadata.gz: 84ba91222819c74653acfa87e3b57a9b47e43386812c98749b5bdcd797d4fc6f07958681ca05a2528ade63153abc84ea85094ab9066c3a5c619cb46ebb9e6269
7
+ data.tar.gz: 89fa5037cc9636179c766425aa036e8cb9f5ee85dc1fa4f96a28c16c66c5256aaeae886ccda861d9184b70f34cf2ba8a40b3509a213962a2c62585446ba7ba6c
@@ -0,0 +1,24 @@
1
+ require_dependency "ishapi/application_controller"
2
+ module Ishapi
3
+ class TagsController < ApplicationController
4
+
5
+ def index
6
+ authorize! :index, Tag
7
+ @tags = Tag.all
8
+ if params[:domain]
9
+ @site = Site.find_by( :domain => params[:domain], :lang => :en )
10
+ @tags = @tags.where( :site => @site )
11
+ end
12
+ end
13
+
14
+ def show
15
+ begin
16
+ @tag = Tag.find_by( :name_seo => params[:tagname] )
17
+ rescue Mongoid::Errors::DocumentNotFound
18
+ @tag = Tag.find params[:tagname]
19
+ end
20
+ authorize! :show, @tag
21
+ end
22
+
23
+ end
24
+ end
@@ -39,6 +39,11 @@ class Ishapi::Ability
39
39
 
40
40
  can [ :index, :show ], Site
41
41
 
42
+ can [ :index ], Tag
43
+ can [ :show ], Tag do |tag|
44
+ tag.is_public
45
+ end
46
+
42
47
  can [ :index ], Venue
43
48
  can [ :show ], Venue do |venue|
44
49
  venue.is_public
@@ -0,0 +1,11 @@
1
+
2
+ #
3
+ # ishapi / tags / index
4
+ #
5
+
6
+ json.array! @tags do |tag|
7
+ json.id tag.id.to_s
8
+ json.name tag.name
9
+ json.name_seo tag.name_seo
10
+ end
11
+
@@ -0,0 +1,18 @@
1
+
2
+ # ishapi / tags / show
3
+
4
+ json.id @tag.id.to_s
5
+ json.name @tag.name
6
+ json.name_seo @tag.name_seo
7
+
8
+ json.videos do
9
+ json.array! @tag.videos
10
+ end
11
+
12
+ json.reports do
13
+ json.array! @tag.reports
14
+ end
15
+
16
+ json.galleries do
17
+ json.array! @tag.galleries
18
+ end
@@ -30,6 +30,9 @@ Ishapi::Engine.routes.draw do
30
30
  get 'sites/view/:domain/newsitems/:newsitems_page', :to => 'newsitems#index', :constraints => { :domain => /[^\/]+/ }
31
31
  get 'sites/view/:domain/reports', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
32
32
  get 'sites/view/:domain/reports/page/:reports_page', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
33
+ get 'sites/view/:domain/tags', :to => 'tags#index', :constraints => { :domain => /[^\/]+/ }
34
+
35
+ get 'tags/view/:tagname', :to => 'tags#show'
33
36
 
34
37
  post 'users/fb_sign_in', :to => 'users#fb_sign_in'
35
38
  post 'users/profile', :to => 'users#show'
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.41
4
+ version: 0.1.8.42
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-10 00:00:00.000000000 Z
11
+ date: 2017-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -186,6 +186,7 @@ files:
186
186
  - app/controllers/ishapi/reports_controller.rb~
187
187
  - app/controllers/ishapi/sites_controller.rb
188
188
  - app/controllers/ishapi/sites_controller.rb~
189
+ - app/controllers/ishapi/tags_controller.rb
189
190
  - app/controllers/ishapi/users_controller.rb
190
191
  - app/controllers/ishapi/users_controller.rb~
191
192
  - app/controllers/ishapi/venues_controller.rb
@@ -234,6 +235,8 @@ files:
234
235
  - app/views/ishapi/reports/show.jbuilder~
235
236
  - app/views/ishapi/sites/show.jbuilder
236
237
  - app/views/ishapi/sites/show.jbuilder~
238
+ - app/views/ishapi/tags/index.jbuilder
239
+ - app/views/ishapi/tags/show.jbuilder
237
240
  - app/views/ishapi/users/_index.jbuilder
238
241
  - app/views/ishapi/users/_index.jbuilder~
239
242
  - app/views/ishapi/users/show.jbuilder