1
0
Fork 0

Add some basic info to the dashboard

This commit is contained in:
Andrew Tomaka 2015-11-03 16:15:20 -05:00
parent a0be5a27d2
commit 6a6a31b77c
5 changed files with 44 additions and 0 deletions

View file

@ -49,6 +49,10 @@ class Card < ActiveRecord::Base
"card_#{gameid}_thumb.png" "card_#{gameid}_thumb.png"
end end
def self.verified
Card.where(verified: true)
end
private private
def set_stat_types def set_stat_types

View file

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

View file

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

View file

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

View file

@ -26,3 +26,31 @@
.pull-left View Details .pull-left View Details
.pull-right= glyph 'circle-arrow-right' .pull-right= glyph 'circle-arrow-right'
.clearfix .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