ishapi 0.1.8.10 → 0.1.8.11

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: dec22b17843557b11ea219a23ed534e732401562
4
- data.tar.gz: 38f8521035921173869f63455ba5e31c8e09274f
3
+ metadata.gz: d79a3a719d7fa36883dd109423711e35e28cf65b
4
+ data.tar.gz: 50cd2e9879a2df1eceae77400f6d1560278e7718
5
5
  SHA512:
6
- metadata.gz: 50e9f89dfbdb81cb464820aabfb3f8b70be56c6d154c3948698b15d02a32c25aa9a0e0d28b77b0b6b5551d45a4927ea1236bf4421dfe9eb3f86af71ab4e8a0a4
7
- data.tar.gz: 98da29586f07f4135f01165ca66a353cfc5b11eb3caeb1456b21d66135a34e5ecca23f32da0ad8ded358c51a11248506cdd8b8c88604c47bdcdf0929c0520d5a
6
+ metadata.gz: 3fdfa54a03c5475de38df30c3be81d8a1c2a3586f98d1a7b9ec44e8d1a52d44edbc8fe34a95e6893d610a490f8d363bcafdaa1a0ca2a034fb1845149730736bf
7
+ data.tar.gz: e3d02942bf3758da0eccbedb10afc692c2a1281561f937f6d8a58b3a8ba44f645577ec9501c16a27a153596e5c34d4a8ba02920ce86cf6bf3ae4302f3820550f
@@ -0,0 +1,16 @@
1
+ require_dependency "ishapi/application_controller"
2
+ module Ishapi
3
+ class VenuesController < ApplicationController
4
+
5
+ def index
6
+ authorize! :index, ::Venue
7
+ @venues = ::Venue.all
8
+ end
9
+
10
+ def show
11
+ @venue = Venue.find_by :name_seo => params[:venuename]
12
+ authorize! :show, @venue
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,23 @@
1
+ require_dependency "ishapi/application_controller"
2
+ module Ishapi
3
+ class SitesController < ApplicationController
4
+
5
+ def index
6
+ authorize! :index, ::Site
7
+ @sites = ::Site.all
8
+ end
9
+
10
+ def show
11
+ if params[:domain].include?(".json")
12
+ domain = params[:domain][0...-5]
13
+ else
14
+ domain = params[:domain]
15
+ end
16
+ @site = ::Site.find_by :domain => domain, :lang => :en
17
+ authorize! :show, @site
18
+
19
+ @newsitems = @site.newsitems.limit(10)
20
+ end
21
+
22
+ end
23
+ end
@@ -37,5 +37,9 @@ class Ishapi::Ability
37
37
 
38
38
  can [ :index, :show ], Site
39
39
 
40
+ can [ :index ], Venue
41
+ can [ :show ], Venue do |venue|
42
+ venue.is_public
43
+ end
40
44
  end
41
45
  end
@@ -7,6 +7,7 @@ json.venues do
7
7
  json.array! venues do |venue|
8
8
  json.id venue.id.to_s
9
9
  json.name venue.name
10
+ json.name_seo venue.name_seo
10
11
  json.description venue.descr
11
12
  json.x venue.x
12
13
  json.y venue.y
@@ -0,0 +1,14 @@
1
+
2
+ #
3
+ # ishapi / venues / _index
4
+ #
5
+
6
+ json.venues do
7
+ json.array! venues do |venue|
8
+ json.id venue.id.to_s
9
+ json.name venue.name
10
+ json.description venue.descr
11
+ json.x venue.x
12
+ json.y venue.y
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+
2
+ #
3
+ # ishapi / venues / show
4
+ #
5
+
6
+ key = [ @venue, params.permit! ]
7
+ json.cache! key do
8
+ json.venue do
9
+ json.name @venue.name
10
+ json.venuename @venue.name_seo
11
+ json.description @venue.descr
12
+ end
13
+ end
14
+
15
+
@@ -0,0 +1,12 @@
1
+
2
+ #
3
+ # ishapi / venues / show
4
+ #
5
+
6
+ key = [ @venue, params.permit! ]
7
+ json.cache! key do
8
+ json.name @venue.name
9
+ json.venuename @venue.name_seo
10
+ json.description @venue.descr
11
+ end
12
+
@@ -12,4 +12,6 @@ Ishapi::Engine.routes.draw do
12
12
 
13
13
  get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
14
14
 
15
+ get 'venues/view/:venuename', :to => 'venues#show'
16
+
15
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.10
4
+ version: 0.1.8.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -150,6 +150,8 @@ files:
150
150
  - app/controllers/ishapi/reports_controller.rb~
151
151
  - app/controllers/ishapi/sites_controller.rb
152
152
  - app/controllers/ishapi/sites_controller.rb~
153
+ - app/controllers/ishapi/venues_controller.rb
154
+ - app/controllers/ishapi/venues_controller.rb~
153
155
  - app/helpers/ishapi/application_helper.rb
154
156
  - app/helpers/ishapi/articles_helper.rb
155
157
  - app/jobs/ishapi/application_job.rb
@@ -187,6 +189,9 @@ files:
187
189
  - app/views/ishapi/sites/show.jbuilder~
188
190
  - app/views/ishapi/venues/_index.haml~
189
191
  - app/views/ishapi/venues/_index.jbuilder
192
+ - app/views/ishapi/venues/_index.jbuilder~
193
+ - app/views/ishapi/venues/show.jbuilder
194
+ - app/views/ishapi/venues/show.jbuilder~
190
195
  - app/views/layouts/ishapi/application.html.erb
191
196
  - config/routes.rb
192
197
  - lib/ishapi.rb