2014-06-17 02:29:49 -04:00
|
|
|
# Trust level system badges.
|
2014-05-04 14:15:38 -04:00
|
|
|
trust_level_badges = [
|
2014-07-07 03:55:25 -04:00
|
|
|
{id: 1, name: "Basic User", type: BadgeType::Bronze},
|
|
|
|
{id: 2, name: "Regular User", type: BadgeType::Bronze},
|
|
|
|
{id: 3, name: "Leader", type: BadgeType::Silver},
|
|
|
|
{id: 4, name: "Elder", type: BadgeType::Gold}
|
2014-05-04 14:15:38 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
trust_level_badges.each do |spec|
|
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = spec[:id]
|
|
|
|
b.name = spec[:name]
|
|
|
|
b.badge_type_id = spec[:type]
|
2014-07-03 03:29:44 -04:00
|
|
|
b.query = Badge::Queries.trust_level(spec[:id])
|
2014-07-08 22:17:39 -04:00
|
|
|
|
|
|
|
# allow title for leader and elder
|
|
|
|
b.allow_title = spec[:id] > 2
|
2014-05-04 14:15:38 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-15 01:16:41 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::Reader
|
|
|
|
b.name = "Reader"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = false
|
|
|
|
b.query = Badge::Queries::Reader
|
|
|
|
b.auto_revoke = false
|
|
|
|
end
|
|
|
|
|
2014-07-11 03:32:29 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::ReadFaq
|
|
|
|
b.name = "Read Faq"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = false
|
|
|
|
b.query = Badge::Queries::ReadFaq
|
|
|
|
end
|
|
|
|
|
2014-07-09 21:18:02 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::FirstLink
|
|
|
|
b.name = "First Link"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = true
|
|
|
|
b.query = Badge::Queries::FirstLink
|
|
|
|
end
|
|
|
|
|
2014-07-11 00:17:01 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::FirstQuote
|
|
|
|
b.name = "First Quote"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = true
|
|
|
|
b.query = Badge::Queries::FirstQuote
|
|
|
|
end
|
|
|
|
|
2014-07-08 00:26:53 -04:00
|
|
|
Badge.seed do |b|
|
2014-07-08 22:17:39 -04:00
|
|
|
b.id = Badge::FirstLike
|
|
|
|
b.name = "First Like"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = true
|
|
|
|
b.query = Badge::Queries::FirstLike
|
|
|
|
end
|
|
|
|
|
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::FirstFlag
|
|
|
|
b.name = "First Flag"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = false
|
|
|
|
b.query = Badge::Queries::FirstFlag
|
|
|
|
end
|
|
|
|
|
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::FirstShare
|
|
|
|
b.name = "First Share"
|
2014-07-08 00:26:53 -04:00
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = true
|
2014-07-08 22:17:39 -04:00
|
|
|
b.query = Badge::Queries::FirstShare
|
2014-07-08 00:26:53 -04:00
|
|
|
end
|
|
|
|
|
2014-07-03 03:29:44 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::Welcome
|
|
|
|
b.name = "Welcome"
|
2014-07-07 03:55:25 -04:00
|
|
|
b.badge_type_id = BadgeType::Bronze
|
2014-07-03 03:29:44 -04:00
|
|
|
b.multiple_grant = false
|
|
|
|
b.target_posts = true
|
|
|
|
b.query = Badge::Queries::Welcome
|
|
|
|
end
|
2014-05-15 20:34:06 -04:00
|
|
|
|
2014-07-03 03:29:44 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::Autobiographer
|
|
|
|
b.name = "Autobiographer"
|
2014-07-07 03:55:25 -04:00
|
|
|
b.badge_type_id = BadgeType::Bronze
|
2014-07-03 03:29:44 -04:00
|
|
|
b.multiple_grant = false
|
|
|
|
b.query = Badge::Queries::Autobiographer
|
2014-05-04 14:15:38 -04:00
|
|
|
end
|
2014-07-03 03:29:44 -04:00
|
|
|
|
2014-07-07 03:55:25 -04:00
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = Badge::Editor
|
|
|
|
b.name = "Editor"
|
|
|
|
b.badge_type_id = BadgeType::Bronze
|
|
|
|
b.multiple_grant = false
|
|
|
|
b.query = Badge::Queries::Editor
|
|
|
|
end
|
|
|
|
|
2014-06-17 02:29:49 -04:00
|
|
|
#
|
|
|
|
# Like system badges.
|
|
|
|
like_badges = [
|
2014-07-07 03:55:25 -04:00
|
|
|
{id: 6, name: "Nice Post", type: BadgeType::Bronze, multiple: true},
|
|
|
|
{id: 7, name: "Good Post", type: BadgeType::Silver, multiple: true},
|
|
|
|
{id: 8, name: "Great Post", type: BadgeType::Gold, multiple: true}
|
2014-06-17 02:29:49 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
like_badges.each do |spec|
|
|
|
|
Badge.seed do |b|
|
|
|
|
b.id = spec[:id]
|
|
|
|
b.name = spec[:name]
|
|
|
|
b.badge_type_id = spec[:type]
|
|
|
|
b.multiple_grant = spec[:multiple]
|
2014-07-03 03:29:44 -04:00
|
|
|
b.target_posts = true
|
|
|
|
b.query = Badge::Queries.like_badge(Badge.like_badge_counts[spec[:id]])
|
2014-06-17 02:29:49 -04:00
|
|
|
end
|
|
|
|
end
|