Organizing misc pages
This commit is contained in:
@@ -30,9 +30,11 @@ class window.BeatHaven
|
||||
lang: 'ru'
|
||||
|
||||
init: ->
|
||||
log "Initiatin BeatHaven ..."
|
||||
|
||||
window._vkontakte = new Vkontakte(2335068)
|
||||
window._vkontakte.init()
|
||||
window._vk_music = new VkontakteMusic
|
||||
window._vk_music = new VkontakteMusic()
|
||||
|
||||
window._ajax = new Ajax()
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ class window.Vkontakte
|
||||
@api_id
|
||||
|
||||
init: ->
|
||||
log "Initiatin Vkontakte API ..."
|
||||
window.vkAsyncInit = ->
|
||||
VK.init apiId: _vkontakte.getApiId()
|
||||
VK.Auth.getLoginStatus (response) ->
|
||||
|
||||
@@ -5,28 +5,19 @@ class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
before_filter :set_locale
|
||||
|
||||
def index; end
|
||||
|
||||
def greetings
|
||||
render partial: 'greetings'
|
||||
end
|
||||
|
||||
def about
|
||||
render partial: 'about'
|
||||
end
|
||||
|
||||
def stat
|
||||
@artists = Artist.count
|
||||
@albums = Album.count
|
||||
@tracks = Track.count
|
||||
@users = User.count
|
||||
render partial: 'stat'
|
||||
end
|
||||
|
||||
def cache_for time
|
||||
response.headers['Cache-Control'] = 'public, max-age=' + time.seconds.to_s
|
||||
end
|
||||
|
||||
def compile_page params
|
||||
@data = params[:data]
|
||||
render json: {
|
||||
status: (params[:status] unless params[:status].nil?),
|
||||
data: @data,
|
||||
html: render_compact_partial(params[:partial])
|
||||
}, include: (params[:include] unless params[:include].nil?)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def authorize
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
class PageController < ApplicationController
|
||||
def index
|
||||
# Something
|
||||
end
|
||||
|
||||
def greetings
|
||||
render partial: 'greetings'
|
||||
end
|
||||
|
||||
def about
|
||||
render partial: 'about'
|
||||
end
|
||||
|
||||
def stat
|
||||
@artists = Artist.count
|
||||
@albums = Album.count
|
||||
@tracks = Track.count
|
||||
@users = User.count
|
||||
render partial: 'stat'
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user