ishapi 0.1.3 → 0.1.4

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: 17f6e5094d7aedb4ea067d3beb102e7d7343c4e1
4
- data.tar.gz: cb80dae36fe3f304aa59b6cafaf71152e4ba11f2
3
+ metadata.gz: b12aa0f7a51bb0ae81a76a6f54c0bd200f1fcfe5
4
+ data.tar.gz: 8c2ae7b6e33a27aa67d429bd586fa509cca5975f
5
5
  SHA512:
6
- metadata.gz: a54b28afeaaabc66f165b58437dad3d97d2a97bf9a6aacd6d4792755b3f5a2743badb26ceadfb2165ebf0f87815ebe45316b21ac3f061bac60da0c3a47875f50
7
- data.tar.gz: 298dc2d9b0800082f9b6404ad962000047fa542e6550137f9ed33fa9b133d63d87fbfea3270161ea1dd64e33dc29ee51b37c90d5a1faad15a5a56a4b82a9f11d
6
+ metadata.gz: f8fa6de9dff4045b905f2b04a62b4145aaa2bf6c108ec5430e3d11866a6cde6eb539de67e00ba0da44c6101254b4253b0c3b012221df95822eec7a5cb394567d
7
+ data.tar.gz: 674e5c1ebca037b4fa0bddae22c782ef4577416d0af19a93404066c4fcf282ed4a88b2bfe31ab82c03be29211c67f2209f17a546d569e94bb07236bfedf639bb
@@ -1,5 +1,6 @@
1
1
  module Ishapi
2
2
  class ApplicationController < ActionController::Base
3
3
  protect_from_forgery with: :exception
4
+ layout :false
4
5
  end
5
6
  end
@@ -3,7 +3,7 @@ module Ishapi
3
3
  class SitesController < ApplicationController
4
4
 
5
5
  def index
6
- @sites = Site.all
6
+ @sites = ::Site.all
7
7
  end
8
8
 
9
9
  def show
@@ -12,7 +12,8 @@ module Ishapi
12
12
  else
13
13
  domain = params[:domain]
14
14
  end
15
- @site = Site.find_by :domain => domain, :lang => :en
15
+ @site = ::Site.find_by :domain => domain, :lang => :en
16
+ @newsitems = @site.newsitems.limit(10)
16
17
  end
17
18
 
18
19
  end
@@ -0,0 +1,18 @@
1
+
2
+ #
3
+ # ishapi / sites / show
4
+ #
5
+
6
+ key = [ @site, params.permit! ]
7
+ json.cache! key do
8
+ json.site do
9
+ json.id @site.id.to_s
10
+ json.domain @site.domain
11
+ json.lang @site.lang
12
+ json.newsitems do
13
+ json.array! @newsitems do |item|
14
+ json.descr item.descr
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+
2
+ #
3
+ # ishapi / sites / show
4
+ #
5
+
6
+ key = [ @site, params.permit! ]
7
+ json.cache! key do
8
+ json.id @site.id.to_s
9
+ json.domain @site.domain
10
+ json.lang @site.lang
11
+ json.newsitems @site.newsitems
12
+
13
+ # json.reports @site.reports
14
+ end
@@ -1,3 +1,3 @@
1
1
  module Ishapi
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
@@ -120,6 +120,8 @@ files:
120
120
  - app/views/ishapi/cities/index.jbuilder
121
121
  - app/views/ishapi/cities/show.jbuilder
122
122
  - app/views/ishapi/cities/show.jbuilder~
123
+ - app/views/ishapi/sites/show.jbuilder
124
+ - app/views/ishapi/sites/show.jbuilder~
123
125
  - app/views/layouts/ishapi/application.html.erb
124
126
  - config/routes.rb
125
127
  - lib/ishapi.rb