ishapi 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/ishapi/application_controller.rb +6 -0
- data/app/controllers/ishapi/galleries_controller.rb +10 -0
- data/app/controllers/ishapi/galleries_controller.rb~ +20 -0
- data/app/views/ishapi/cities/index.jbuilder +9 -0
- data/app/views/ishapi/cities/show.jbuilder +9 -3
- data/app/views/ishapi/features/_index.jbuilder +7 -0
- data/app/views/ishapi/galleries/_index.jbuilder +10 -0
- data/app/views/ishapi/galleries/_index.jbuilder~ +10 -0
- data/app/views/ishapi/galleries/_show.jbuilder +10 -0
- data/app/views/ishapi/galleries/_show.jbuilder~ +9 -0
- data/app/views/ishapi/galleries/show.jbuilder +15 -0
- data/app/views/ishapi/galleries/show.jbuilder~ +22 -0
- data/app/views/ishapi/newsitems/_index.jbuilder +16 -0
- data/app/views/ishapi/newsitems/_index.jbuilder~ +5 -0
- data/app/views/ishapi/photos/_index.jbuilder +10 -0
- data/app/views/ishapi/photos/_index.jbuilder~ +10 -0
- data/app/views/ishapi/photos/_show.jbuilder +9 -0
- data/app/views/ishapi/photos/_show.jbuilder~ +7 -0
- data/app/views/ishapi/reports/_index.jbuilder +13 -0
- data/app/views/ishapi/reports/_index.jbuilder~ +12 -0
- data/app/views/ishapi/reports/show.jbuilder +14 -0
- data/app/views/ishapi/reports/show.jbuilder~ +4 -0
- data/app/views/ishapi/sites/show.jbuilder +1 -5
- data/config/routes.rb +2 -0
- data/lib/ishapi/version.rb +1 -1
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bc2551ac0f596f9a00805d21aac56f9b47bcb95
|
4
|
+
data.tar.gz: 92906c76403bbedfdfa1c48637ff73c2f47890e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28f3be37b2755ea3a4369b9938c394cda3f8383be3dff28de75dc1402b54f43b9b187b93d2942809ac10a397615b05e0767cc9c2f8623a45d7b8698c8a19a19c
|
7
|
+
data.tar.gz: 3c07240b2b30509bb8eb60feb48a7dbd6d2682bb828829720d29274db762f0b957dbbe488fa1c6b3878ce4eaa30527016223ff732aca36cc101dc3905a8abc36
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_dependency "ishapi/application_controller"
|
2
|
+
module Ishapi
|
3
|
+
class SitesController < ApplicationController
|
4
|
+
|
5
|
+
def index
|
6
|
+
@sites = ::Site.all
|
7
|
+
end
|
8
|
+
|
9
|
+
def show
|
10
|
+
if params[:domain].include?(".json")
|
11
|
+
domain = params[:domain][0...-5]
|
12
|
+
else
|
13
|
+
domain = params[:domain]
|
14
|
+
end
|
15
|
+
@site = ::Site.find_by :domain => domain, :lang => :en
|
16
|
+
@newsitems = @site.newsitems.limit(10)
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -6,8 +6,14 @@
|
|
6
6
|
key = [ @city, params.permit! ]
|
7
7
|
json.cache! key do
|
8
8
|
json.city do
|
9
|
-
json.id
|
10
|
-
json.name
|
11
|
-
json.cityname
|
9
|
+
json.id @city.id.to_s
|
10
|
+
json.name @city.name
|
11
|
+
json.cityname @city.cityname
|
12
|
+
json.description @city.description
|
13
|
+
json.x @city.x
|
14
|
+
json.y @city.y
|
15
|
+
json.partial! 'ishapi/newsitems/index', :newsitems => @city.newsitems
|
16
|
+
json.partial! 'ishapi/galleries/index', :galleries => @city.galleries
|
17
|
+
json.partial! 'ishapi/reports/index', :reports => @city.reports
|
12
18
|
end
|
13
19
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# ishapi / galleries / show
|
4
|
+
#
|
5
|
+
|
6
|
+
this_key = [ @gallery, params.permit! ]
|
7
|
+
json.cache! this_key do
|
8
|
+
json.gallery do
|
9
|
+
json.id @gallery.id.to_s
|
10
|
+
json.name @gallery.name
|
11
|
+
json.galleryname @gallery.galleryname
|
12
|
+
json.partial! 'ishapi/photos/index', :photos => @gallery.photos
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# ishapi / galleries / show
|
4
|
+
#
|
5
|
+
|
6
|
+
this_key = [ @gallery, params.permit! ]
|
7
|
+
json.cache! this_key do
|
8
|
+
json.gallery do
|
9
|
+
json.id @gallery.id.to_s
|
10
|
+
json.name @gallery.name
|
11
|
+
json.galleryname @gallery.galleryname
|
12
|
+
json.photos do
|
13
|
+
json.array! @gallery.photos do |photo|
|
14
|
+
json.photo do
|
15
|
+
json.thumb_url photo.photo.url( :thumb )
|
16
|
+
json.large_url photo.photo.url( :large )
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# ishapi / newsitems / _index
|
4
|
+
#
|
5
|
+
|
6
|
+
json.newsitems do
|
7
|
+
json.array! newsitems do |item|
|
8
|
+
if item.gallery
|
9
|
+
json.item_type 'gallery' #@TODO: should be a constant
|
10
|
+
json.name item.gallery.name
|
11
|
+
json.galleryname item.gallery.galleryname
|
12
|
+
json.partial! 'ishapi/photos/index', :photos => item.gallery.photos
|
13
|
+
end
|
14
|
+
json.descr item.descr
|
15
|
+
end
|
16
|
+
end
|
@@ -9,10 +9,6 @@ json.cache! key do
|
|
9
9
|
json.id @site.id.to_s
|
10
10
|
json.domain @site.domain
|
11
11
|
json.lang @site.lang
|
12
|
-
json.newsitems
|
13
|
-
json.array! @newsitems do |item|
|
14
|
-
json.descr item.descr
|
15
|
-
end
|
16
|
-
end
|
12
|
+
json.partial! 'ishapi/newsitems/index', :newsitems => @newsitems
|
17
13
|
end
|
18
14
|
end
|
data/config/routes.rb
CHANGED
@@ -6,6 +6,8 @@ Ishapi::Engine.routes.draw do
|
|
6
6
|
get 'cities', :to => 'cities#index'
|
7
7
|
get 'cities/view/:cityname', :to => 'cities#show'
|
8
8
|
|
9
|
+
get 'galleries/view/:galleryname', :to => 'galleries#show'
|
10
|
+
|
9
11
|
get 'reports/view/:name_seo', :to => 'reports#show'
|
10
12
|
|
11
13
|
get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
|
data/lib/ishapi/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piousbox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -102,6 +102,8 @@ files:
|
|
102
102
|
- app/controllers/ishapi/articles_controller.rb
|
103
103
|
- app/controllers/ishapi/cities_controller.rb
|
104
104
|
- app/controllers/ishapi/cities_controller.rb~
|
105
|
+
- app/controllers/ishapi/galleries_controller.rb
|
106
|
+
- app/controllers/ishapi/galleries_controller.rb~
|
105
107
|
- app/controllers/ishapi/reports_controller.rb
|
106
108
|
- app/controllers/ishapi/reports_controller.rb~
|
107
109
|
- app/controllers/ishapi/sites_controller.rb
|
@@ -120,6 +122,23 @@ files:
|
|
120
122
|
- app/views/ishapi/cities/index.jbuilder
|
121
123
|
- app/views/ishapi/cities/show.jbuilder
|
122
124
|
- app/views/ishapi/cities/show.jbuilder~
|
125
|
+
- app/views/ishapi/features/_index.jbuilder
|
126
|
+
- app/views/ishapi/galleries/_index.jbuilder
|
127
|
+
- app/views/ishapi/galleries/_index.jbuilder~
|
128
|
+
- app/views/ishapi/galleries/_show.jbuilder
|
129
|
+
- app/views/ishapi/galleries/_show.jbuilder~
|
130
|
+
- app/views/ishapi/galleries/show.jbuilder
|
131
|
+
- app/views/ishapi/galleries/show.jbuilder~
|
132
|
+
- app/views/ishapi/newsitems/_index.jbuilder
|
133
|
+
- app/views/ishapi/newsitems/_index.jbuilder~
|
134
|
+
- app/views/ishapi/photos/_index.jbuilder
|
135
|
+
- app/views/ishapi/photos/_index.jbuilder~
|
136
|
+
- app/views/ishapi/photos/_show.jbuilder
|
137
|
+
- app/views/ishapi/photos/_show.jbuilder~
|
138
|
+
- app/views/ishapi/reports/_index.jbuilder
|
139
|
+
- app/views/ishapi/reports/_index.jbuilder~
|
140
|
+
- app/views/ishapi/reports/show.jbuilder
|
141
|
+
- app/views/ishapi/reports/show.jbuilder~
|
123
142
|
- app/views/ishapi/sites/show.jbuilder
|
124
143
|
- app/views/ishapi/sites/show.jbuilder~
|
125
144
|
- app/views/layouts/ishapi/application.html.erb
|