added blogger badge

This commit is contained in:
nilsding 2015-01-25 20:30:09 +01:00
parent 6d68da5ae1
commit 0d639fd6ec
3 changed files with 36 additions and 36 deletions

View File

@ -70,7 +70,7 @@ namespace :justask do
fail "user #{args[:screen_name]} not found" if user.nil?
user.admin = false
user.save!
puts "#{user.screen_name} no longer an admin."
puts "#{user.screen_name} is no longer an admin."
end
desc "Gives moderator status to an user."
@ -113,6 +113,26 @@ namespace :justask do
puts "#{user.screen_name} is no longer banned."
end
desc "Gives blogger status to an user."
task :blog, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.blogger = true
user.save!
puts "#{user.screen_name} is now a blogger."
end
desc "Removes blogger status from an user."
task :unblog, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
user = User.find_by_screen_name(args[:screen_name])
fail "user #{args[:screen_name]} not found" if user.nil?
user.blogger = false
user.save!
puts "#{user.screen_name} is no longer a blogger."
end
desc "Gives supporter status to an user."
task :sup, [:screen_name] => :environment do |t, args|
fail "screen name required" if args[:screen_name].nil?
@ -130,7 +150,7 @@ namespace :justask do
fail "user #{args[:screen_name]} not found" if user.nil?
user.supporter = false
user.save!
puts "#{user.screen_name} no longer an supporter."
puts "#{user.screen_name} is no longer an supporter."
end
desc "Lists all users."

View File

@ -22,27 +22,6 @@
margin: 0px 0px 0.2em;
}
.profile--admin {
color: $brand-danger;
text-transform: uppercase;
font-weight: bold;
font-size: 80%;
}
.profile--moderator {
color: $brand-success;
text-transform: uppercase;
font-weight: bold;
font-size: 80%;
}
.profile--supporter {
color: $brand-warning;
text-transform: uppercase;
font-weight: bold;
font-size: 80%;
}
.profile--text {
margin-bottom: 2px;
line-height: 1.5em;
@ -106,20 +85,17 @@
color: #fff;
}
.panel-badge-danger {
background-color: #E51C23;
}
$colours: danger $brand-danger,
default #BBB,
success $brand-success,
warning $brand-warning,
info $brand-info,
primary $brand-primary;
.panel-badge-default {
background-color: #BBB;
@each $colour in $colours {
.panel-badge-#{nth($colour, 1)} {
background-color: nth($colour, 2);
}
.panel-badge-success {
background-color: #4CAF50;
}
.panel-badge-warning {
background-color: #FF9800;
}
.user--banned {

View File

@ -12,6 +12,10 @@
.profile--panel-badge.panel-badge-warning
%i.fa.fa-star
Supporter
- if @user.blogger?
.profile--panel-badge.panel-badge-info
%i.fa.fa-pencil.fa-spin
Blogger
- if @user.banned?
.profile--panel-badge.panel-badge-default
%i.fa.fa-ban