1
0
Fork 0

Merge branch 'atomaka/feature/dashboard' into 'master'

Get Started On Dashboard

Add a few things for a basic dashboard

See merge request !20
This commit is contained in:
Andrew Tomaka 2015-11-03 16:22:35 -05:00
commit 9505e08b28
5 changed files with 48 additions and 2 deletions

View file

@ -37,6 +37,8 @@ class Card < ActiveRecord::Base
default_scope { order(:gameid) }
scope :new_this_week, -> { where('created_at > ?', 1.week.ago) }
def dokkan?
dokkan_id != nil
end
@ -49,6 +51,10 @@ class Card < ActiveRecord::Base
"card_#{gameid}_thumb.png"
end
def self.verified
Card.where(verified: true)
end
private
def set_stat_types

View file

@ -7,4 +7,8 @@ class Link < ActiveRecord::Base
uniqueness: true
default_scope { order(:name) }
def self.issues
Link.where(description: nil)
end
end

View file

@ -13,4 +13,8 @@ class PassiveSkill < ActiveRecord::Base
def display_name
name.present? ? name : 'UNNAMED'
end
def self.issues
PassiveSkill.where("name = '' OR description = ''")
end
end

View file

@ -10,4 +10,8 @@ class SuperAttack < ActiveRecord::Base
def full
"#{name} - #{description}"
end
def self.issues
SuperAttack.where("name = '' OR description = ''")
end
end

View file

@ -5,8 +5,8 @@
.col-xs-3
= glyph 'credit-card', classes: 'large-icon'
.col-xs-9.text-right
.huge XX
div New Cards!
.huge= Card.new_this_week.count
div New Cards This Week!
a href="#"
.panel-footer
.pull-left View Details
@ -26,3 +26,31 @@
.pull-left View Details
.pull-right= glyph 'circle-arrow-right'
.clearfix
.col-md-6
.panel.panel-default
.panel-heading Card Stats
.panel-body
.list-group
a.list-group-item
= 'Total'
span.pull-right.text-muted= Card.count
a.list-group-item
= 'Verified'
span.pull-right.text-muted= Card.verified.count
.col-md-6
.panel.panel-default
.panel-heading Potential Issues
.panel-body
.list-group
a.list-group-item
= 'Cards Without Links'
span.pull-right.text-muted= Card.where('links_count < 1').count
a.list-group-item
= 'Passive Skills missing information'
span.pull-right.text-muted= PassiveSkill.issues.count
a.list-group-item
= 'Super Attacks missing information'
span.pull-right.text-muted= SuperAttack.issues.count
a.list-group-item
= 'Links missing information'
span.pull-right.text-muted= Link.issues.count