user profile edition
parent
103ac96039
commit
da460019b1
|
@ -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 ⇒
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
$(function() {
|
||||
$('#lichess_user div.editable').each(function() {
|
||||
$('div.editable').each(function() {
|
||||
$(this).editableSet({
|
||||
event: "click",
|
||||
action: $(this).attr('data-url'),
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#pgnText {
|
||||
color: #666;
|
||||
width: 182px;
|
||||
height: 300px;
|
||||
height: 220px;
|
||||
border: 1px solid #C0C0C0;
|
||||
overflow: auto;
|
||||
padding: 5px;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue