Improve styling

This commit is contained in:
Niklas Fiekas 2016-09-18 11:48:59 +02:00
parent 9d7aa97d9f
commit 7a5caf77a2
3 changed files with 31 additions and 27 deletions

View file

@ -39,8 +39,8 @@ description = shorten(posts.currentPageResults.headOption.??(_.text).replace("\n
@authorLink(post, "author".some)
@if(post.hasEdits) {
<span class="post-edited">edited</span>
@momentFromNow(post.updatedAt)
<span class="post-edited"> - Edited</span>
} else {
@momentFromNow(post.createdAt)
}
@ -61,8 +61,10 @@ description = shorten(posts.currentPageResults.headOption.??(_.text).replace("\n
@if(ctx.userId.fold(false)(post.canBeEditedByNow(_))) {
<form class="edit-post-form" method="post" action="@routes.ForumPost.edit(post.id)">
<textarea name="changes" class="edit-post-box" minlength="3">@post.text</textarea>
<button type="submit" class="submit button">@trans.apply()</button>
<a class="edit-post-cancel" href="@routes.ForumPost.redirect(post.id)" style="margin-left:20px">@trans.cancel()</a>
<div class="edit-buttons">
<a class="edit-post-cancel" href="@routes.ForumPost.redirect(post.id)" style="margin-left:20px">@trans.cancel()</a>
<button type="submit" class="submit button">@trans.apply()</button>
</div>
</form>
}
</div>

View file

@ -1,8 +1,12 @@
$(function () {
$('.edit.button').add('.edit-post-cancel').click(function(e) {
e.preventDefault();
var post = $(this).closest('.post');
post.find('.message').toggle();
post.find('form.edit-post-form').toggle()[0].reset();
var message = post.find('.message').toggle();
var form = post.find('form.edit-post-form').toggle();
form[0].reset();
form.find('textarea').height(message.height());
});
});

View file

@ -183,30 +183,28 @@ div.post .message {
line-height: 1.5em;
}
div.post .edit-buttons {
float: right;
}
div.post .edit-post-box {
width: 100%;
height: 250px;
}
div.post a.post-edited {
font-size: 0.8em;
font-style: bold;
color: #aaa;
margin-top: 0.3em;
margin-left: 1em;
float: left;
}
.edit-post-form {
form.edit-post-form {
display: none;
margin-top: 1.5em;
}
div.post .button-hidden {
display: none;
form.edit-post-form textarea {
width: 728px;
border: 1px solid #D4D4D4;
padding: 0.5em;
}
div.post .edit-buttons {
text-align: right;
margin-top: 0.5em;
}
div.post .edit-buttons a {
margin-right: 1em;
}
div.post .post-edited {
font-size: 0.8em;
color: #aaa;
margin-top: 0.3em;
margin-left: 1em;
float: left;
}
div.topicReply,