Class: Admin::DashboardController
Instance Method Summary
collapse
Methods included from BlogHelper
#blog_base_url, #this_blog
Instance Method Details
#index ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/admin/dashboard_controller.rb', line 4
def index
today = Time.zone.now.strftime("%Y-%m-%d 00:00")
last_sign_in = current_user.last_sign_in_at
@newposts_count = Article.published_since(last_sign_in).count
@newcomments_count = Feedback.created_since(last_sign_in).count
@statposts = Article.published.where("published_at > ?", today).count
@statsdrafts = Article.drafts.where("created_at > ?", today).count
@statspages = Page.where("published_at > ?", today).count
@statuses = Note.where("published_at > ?", today).count
@statuserposts = Article.published.where("published_at > ?", today)
.where(user_id: current_user.id).count
@statcomments = Comment.where("created_at > ?", today).count
@presumedspam = Comment.presumed_spam.where("created_at > ?", today).count
@confirmed = Comment.ham.where("created_at > ?", today).count
@unconfirmed = Comment.unconfirmed.where("created_at > ?", today).count
@comments = Comment.last_published
@drafts = Article.drafts.where(user_id: current_user.id).limit(5)
@statspam = Comment.spam.count
end
|