added blogger badge
This commit is contained in:
parent
6d68da5ae1
commit
0d639fd6ec
24
Rakefile
24
Rakefile
|
@ -70,7 +70,7 @@ namespace :justask do
|
||||||
fail "user #{args[:screen_name]} not found" if user.nil?
|
fail "user #{args[:screen_name]} not found" if user.nil?
|
||||||
user.admin = false
|
user.admin = false
|
||||||
user.save!
|
user.save!
|
||||||
puts "#{user.screen_name} no longer an admin."
|
puts "#{user.screen_name} is no longer an admin."
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Gives moderator status to an user."
|
desc "Gives moderator status to an user."
|
||||||
|
@ -113,6 +113,26 @@ namespace :justask do
|
||||||
puts "#{user.screen_name} is no longer banned."
|
puts "#{user.screen_name} is no longer banned."
|
||||||
end
|
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."
|
desc "Gives supporter status to an user."
|
||||||
task :sup, [:screen_name] => :environment do |t, args|
|
task :sup, [:screen_name] => :environment do |t, args|
|
||||||
fail "screen name required" if args[:screen_name].nil?
|
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?
|
fail "user #{args[:screen_name]} not found" if user.nil?
|
||||||
user.supporter = false
|
user.supporter = false
|
||||||
user.save!
|
user.save!
|
||||||
puts "#{user.screen_name} no longer an supporter."
|
puts "#{user.screen_name} is no longer an supporter."
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Lists all users."
|
desc "Lists all users."
|
||||||
|
|
|
@ -22,27 +22,6 @@
|
||||||
margin: 0px 0px 0.2em;
|
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 {
|
.profile--text {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
|
@ -106,20 +85,17 @@
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-badge-danger {
|
$colours: danger $brand-danger,
|
||||||
background-color: #E51C23;
|
default #BBB,
|
||||||
}
|
success $brand-success,
|
||||||
|
warning $brand-warning,
|
||||||
|
info $brand-info,
|
||||||
|
primary $brand-primary;
|
||||||
|
|
||||||
.panel-badge-default {
|
@each $colour in $colours {
|
||||||
background-color: #BBB;
|
.panel-badge-#{nth($colour, 1)} {
|
||||||
|
background-color: nth($colour, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-badge-success {
|
|
||||||
background-color: #4CAF50;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-badge-warning {
|
|
||||||
background-color: #FF9800;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user--banned {
|
.user--banned {
|
||||||
|
|
|
@ -12,6 +12,10 @@
|
||||||
.profile--panel-badge.panel-badge-warning
|
.profile--panel-badge.panel-badge-warning
|
||||||
%i.fa.fa-star
|
%i.fa.fa-star
|
||||||
Supporter
|
Supporter
|
||||||
|
- if @user.blogger?
|
||||||
|
.profile--panel-badge.panel-badge-info
|
||||||
|
%i.fa.fa-pencil.fa-spin
|
||||||
|
Blogger
|
||||||
- if @user.banned?
|
- if @user.banned?
|
||||||
.profile--panel-badge.panel-badge-default
|
.profile--panel-badge.panel-badge-default
|
||||||
%i.fa.fa-ban
|
%i.fa.fa-ban
|
||||||
|
|
Loading…
Reference in New Issue