| Class | MobAppController |
| In: |
app/controllers/mob_app_controller.rb
|
| Parent: | ApplicationController |
# File app/controllers/mob_app_controller.rb, line 61
61: def about
62: @pages = [Page.legal_iphone, Page.prop_int_iphone, Page.about_iphone].compact
63: render :action => "about.json"
64: end
# File app/controllers/mob_app_controller.rb, line 57
57: def appdata
58: render :action => "appdata.#{params[:version]}.json"
59: end
# File app/controllers/mob_app_controller.rb, line 14
14: def events
15: events = Event.in_irekia.published.translated.future(Time.zone.now - 1.day).find :all
16: @events = events.map {|e| e if e.show_in.eql?('actos')}.compact[0..14]
17:
18: # # 50 viejas
19: # events = Event.in_irekia.published.translated.find(:all, :conditions => "starts_at BETWEEN '#{Time.now - 3.months}' and '#{Time.now - 2.months}'")
20: # @events = events.map {|e| e if e.show_in.eql?('actos')}.compact[0..50]
21: # # 20 nuevas
22: # events = Event.in_irekia.published.translated.find(:all, :conditions => "starts_at BETWEEN '#{Time.now - 2.months}' and '#{Time.now - 0.months}'")
23: # @events = events.map {|e| e if e.show_in.eql?('actos')}.compact[0..20]
24: # :limit => 15
25:
26:
27: render :action => "events.json"
28: end
# File app/controllers/mob_app_controller.rb, line 4
4: def news
5: @news = News.in_irekia.published.translated.leading.find :all,
6: # :select => "id, title_es",
7: :limit => 15,
8: :order => 'published_at DESC'
9:
10: render :action => "news.json"
11: # render :json => @documents
12: end
# File app/controllers/mob_app_controller.rb, line 30
30: def photos
31: @photos = Photo.published.find :all,
32: :limit => 48, :order => "created_at DESC"
33:
34: respond_to do |format|
35: format.json {render :action => "photos.json"}
36: format.ipad {render :action => "photos_ipad.json"}
37: format.iphone4 {render :action => "photos_ipad.json"}
38: end
39: end
# File app/controllers/mob_app_controller.rb, line 53
53: def show
54: render :action => "show.json"
55: end
# File app/controllers/mob_app_controller.rb, line 41
41: def videos
42: @videos = Video.published.translated.find :all,
43: :limit => 15, :order => "published_at DESC"
44:
45: respond_to do |format|
46: format.json {render :action => "videos.json"}
47: format.ipad {render :action => "videos_ipad.json"}
48: format.iphone4 {render :action => "videos_ipad.json"}
49: end
50:
51: end