user profile edition

pull/1/merge
Thibault Duplessis 2012-06-01 16:00:42 +02:00
parent 103ac96039
commit da460019b1
8 changed files with 13 additions and 17 deletions

View File

@ -57,10 +57,10 @@ object User extends LilaController {
val setBio = AuthBody { ctx
me
implicit val req = ctx.body
IORedirect(forms.bio.bindFromRequest.fold(
f putStrLn(f.errors.toString) map { _ routes.User show me.username },
bio userRepo.setBio(me, bio) map { _ routes.User show me.username }
))
JsonIOk(forms.bio.bindFromRequest.fold(
f putStrLn(f.errors.toString) map { _ me.bio | "" },
bio userRepo.setBio(me, bio) map { _ bio }
) map { bio Map("bio" -> bio) })
}
val close = Auth { implicit ctx

View File

@ -5,7 +5,7 @@ title = u.username,
robots = false) {
<div class="content_box no_padding user_show">
<div class="content_box_top">
<h1 class="lichess_title title_block">@u.username</h1>
<h1 class="lichess_title">@u.username</h1>
</div>
<div class="content_box_content clearfix">
This account is closed.

View File

@ -20,7 +20,7 @@
@bio = {
@if(ctx is u) {
<div class="editable" data-url="@routes.User.setBio">
<div class="editable" data-url="@routes.User.getBio">
<span class="user_bio" data-name="bio" data-type="textarea" data-provider-url="@routes.User.getBio">
@shorten(u.bio | "Click here to tell about yourself.", 400)
</span>
@ -53,7 +53,8 @@
@user.layout(
title = title,
robots = false,
evenMoreJs = evenMoreJs) {
evenMoreJs = evenMoreJs,
evenMoreCss = evenMoreCss) {
<div class="content_box no_padding user_show">
<div class="content_box_top">
@if(ctx.me.fold(u !=, false)) {

View File

@ -73,7 +73,7 @@ GET /people/stats controllers.User.stats
GET /people/autocomplete controllers.User.autocomplete
GET /people/online controllers.User.online
GET /account/bio controllers.User.getBio
POST /account/bio controllers.User.setBio
PUT /account/bio.json controllers.User.setBio
GET /account/close controllers.User.close
POST /account/closeConfirm controllers.User.closeConfirm

View File

@ -1,5 +1,5 @@
$(function() {
$('#lichess_user div.editable').each(function() {
$('div.editable').each(function() {
$(this).editableSet({
event: "click",
action: $(this).attr('data-url'),

View File

@ -5,7 +5,7 @@
#pgnText {
color: #666;
width: 182px;
height: 300px;
height: 220px;
border: 1px solid #C0C0C0;
overflow: auto;
padding: 5px;

View File

@ -1,10 +1,3 @@
#lichess_user div.user_show h1.lichess_title {
margin-bottom: 0;
float: left;
}
#lichess_user div.user_show h1.lichess_title.title_block {
float: none;
}
div.user_show div.content_box_top .status {
display: block;
width: 16px;

2
todo
View File

@ -33,6 +33,8 @@ guess friend list
profile edition
nb-playing is wrong (mongo date?)
new elo system http://en.wikipedia.org/wiki/Glicko_rating_system
spectator chat!
star people and games (and forum threads?)
new translations:
-rematchOfferCanceled=Rematch offer canceled