fix coach form todo-list

This commit is contained in:
Thibault Duplessis 2016-09-08 00:49:27 +02:00
parent a860b3015e
commit 7bbaaeceb9
4 changed files with 10 additions and 9 deletions

View file

@ -45,7 +45,7 @@ side = side.some) {
<h1>
@c.user.title.map { t => @t }@c.user.profileOrDefault.nonEmptyRealName.getOrElse(c.user.username)
</h1>
<div class="todo" data-profile="c.user.profileOrDefault.isComplete">
<div class="todo" data-profile="@c.user.profileOrDefault.isComplete">
<h3>TODO list before publishing your coach profile</h3>
<ul></ul>
</div>

View file

@ -26,8 +26,8 @@ case class Profile(
def isComplete = completionPercent == 100
def completionPercent: Int = {
val c = List(country, location, bio, firstName, lastName).map(_.isDefined)
100 * c.count(identity) / c.size
val c = List(country, location, bio, firstName, lastName)
100 * c.count(_.isDefined) / c.size
}
import Profile.OfficialRating

View file

@ -9,17 +9,17 @@ $(function() {
var $option = $editor.find('select[name=listed] option[value=true]');
var must = [{
name: 'Complete your lichess profile',
html: '<a href="/account/profile">Complete your lichess profile</a>',
check: function() {
return $el.data('profile');
}
}, {
name: 'Upload a profile picture',
html: 'Upload a profile picture',
check: function() {
return $editor.find('img.picture').length;
}
}, {
name: 'Fill in basic informations',
html: 'Fill in basic informations',
check: function() {
['profile.headline', 'profile.languages'].forEach(function(name) {
if (!$editor.find('[name="' + name + '"]').val()) return false;
@ -27,7 +27,7 @@ $(function() {
return true;
}
}, {
name: 'Fill at least 3 description texts',
html: 'Fill at least 3 description texts',
check: function() {
return $editor.find('.panel.texts textarea').filter(function() {
return !!$(this).val();
@ -38,7 +38,7 @@ $(function() {
return function() {
var points = [];
must.forEach(function(o) {
if (!o.check()) points.push($('<li>').text(o.name));
if (!o.check()) points.push($('<li>').html(o.html));
});
$el.find('ul').html(points);
var fail = !!points.length;

View file

@ -59,7 +59,8 @@
list-style: disc inside;
}
.coach_edit .top a {
.coach_edit .top a,
body.dark .coach_edit .top a {
color: #3893E8;
}