More stable, I hope...
This commit is contained in:
@@ -10,11 +10,13 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def compile_page params
|
||||
@data = params[:data]
|
||||
@data = params[:data] unless params[:data].nil?
|
||||
render json: {
|
||||
status: (params[:status] unless params[:status].nil?),
|
||||
renderer: "unified",
|
||||
data: @data,
|
||||
html: render_compact_partial(params[:partial])
|
||||
html: render_compact_partial(params[:partial]),
|
||||
title: params[:title],
|
||||
status: (params[:status] unless params[:status].nil?)
|
||||
}, include: (params[:include] unless params[:include].nil?)
|
||||
end
|
||||
|
||||
|
||||
@@ -4,18 +4,20 @@ class PageController < ApplicationController
|
||||
end
|
||||
|
||||
def greetings
|
||||
render partial: 'greetings'
|
||||
compile_page(partial: "page/greetings", title: t("title.greetings"))
|
||||
end
|
||||
|
||||
def about
|
||||
render partial: 'about'
|
||||
compile_page(partial: "page/about", title: t("title.about"))
|
||||
end
|
||||
|
||||
def stat
|
||||
@artists = Artist.count
|
||||
@albums = Album.count
|
||||
@tracks = Track.count
|
||||
@users = User.count
|
||||
render partial: 'stat'
|
||||
data = {
|
||||
artists: Artist.count,
|
||||
albums: Album.count,
|
||||
tracks: Track.count,
|
||||
users: User.count
|
||||
}
|
||||
compile_page(data: data, partial: "page/stat", title: t("title.stat"))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user