ishapi 0.1.8.39 → 0.1.8.40

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: a03e7a23a56473ffb3bec9258496b2ca9540188b
4
- data.tar.gz: 1459021e9585b6531ab9d5556d9b326a43861328
3
+ metadata.gz: 89fcd96a1a5fd1d61b520030884fa5de0cb8e2ce
4
+ data.tar.gz: 645baf85d6b1321a17fb13f0b4cba0bf838c6e92
5
5
  SHA512:
6
- metadata.gz: a623d72a2274a679a6ef4290af96a001ea3f1fa6453aae758e10d0de599373c64f3dc7837b0d675914adf479ef929c882168e4143a2ffedd4822ab36c0111197
7
- data.tar.gz: 2b4be1351143d21d01e25abed0bd94fb00a6436aa8f7f571dce11643991dce0e4d0d9e1135f03708a1848f91387e75e305a88df1ea1c67beae7ab496b972d93e
6
+ metadata.gz: 788554098c180689be69d9061dd4ed80549cd346e316cf6562267eb6bfd7615eb2fd54c45fbc66661303d2e6dccd60974633d3421d078884627c5be552ebe838
7
+ data.tar.gz: 716ac31a8709504622a90e6e63b951b1ff0eca956bd5aba88fe7b58451b5fe0d792cecfb54543957e31c3a28c03ae338754e94140b67f38b7ea194927d01602a
@@ -4,6 +4,8 @@ module Ishapi
4
4
  class ApiController < ApplicationController
5
5
 
6
6
  def home
7
+ puts! params, 'params'
8
+
7
9
  render :json => { :status => :ok, :message => 'Ishapi::ApiController.home',
8
10
  :n_reports => Report.count, :n_cities => City.count }
9
11
  authorize! :welcome_home, Ishapi
@@ -14,6 +14,12 @@ module Ishapi
14
14
  city = City.find_by :cityname => params[:cityname]
15
15
  @reports = @reports.where( :city_id => city.id )
16
16
  end
17
+ if params[:domain]
18
+ site = Site.find_by :domain => params[:domain], :lang => :en
19
+ @reports = @reports.where( :site_id => site.id )
20
+ end
21
+
22
+ @reports = @reports.page( params[:reports_page] ).per( 10 )
17
23
  end
18
24
 
19
25
  end
@@ -4,10 +4,13 @@
4
4
  #
5
5
 
6
6
  json.array! @reports do |report|
7
- json.id report.id.to_s
8
- json.name report.name
9
- json.reportname report.name_seo
10
- json.subhead report.subhead
7
+ json.created_at report.created_at
8
+
9
+ json.id report.id.to_s
10
+ json.name report.name
11
+ json.reportname report.name_seo
12
+ json.subhead report.subhead
13
+ json.description report.descr
11
14
  if report.photo
12
15
  json.photo report.photo.photo.url( :thumb )
13
16
  end
data/config/routes.rb CHANGED
@@ -2,6 +2,7 @@
2
2
  Ishapi::Engine.routes.draw do
3
3
 
4
4
  root :to => 'api#home'
5
+ post 'home', :to => 'api#home'
5
6
 
6
7
  get 'cities', :to => 'cities#index'
7
8
  get 'cities/view/:cityname', :to => 'cities#show'
@@ -25,8 +26,10 @@ Ishapi::Engine.routes.draw do
25
26
  get 'reports', :to => 'reports#index'
26
27
  get 'reports/view/:name_seo', :to => 'reports#show'
27
28
 
28
- get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
29
- get 'sites/view/:domain/newsitems/:newsitems_page', :to => 'newsitems#index', :constraints => { :domain => /[^\/]+/ }
29
+ get 'sites/view/:domain', :to => 'sites#show', :constraints => { :domain => /[^\/]+/ }
30
+ get 'sites/view/:domain/newsitems/:newsitems_page', :to => 'newsitems#index', :constraints => { :domain => /[^\/]+/ }
31
+ get 'sites/view/:domain/reports', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
32
+ get 'sites/view/:domain/reports/page/:reports_page', :to => 'reports#index', :constraints => { :domain => /[^\/]+/ }
30
33
 
31
34
  post 'users/fb_sign_in', :to => 'users#fb_sign_in'
32
35
  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.39
4
+ version: 0.1.8.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-07 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails