client/auth: fix being able to rate/fav things
This commit is contained in:
parent
4ca7c49239
commit
e90b8972c7
4 changed files with 15 additions and 2 deletions
|
@ -85,7 +85,8 @@
|
|||
margin-left: 2em
|
||||
font-size: 95%
|
||||
.edit, .delete, .score-container a, .nickname a
|
||||
color: mix($main-color, $inactive-tab-text-color)
|
||||
&:not(.inactive)
|
||||
color: mix($main-color, $inactive-tab-text-color)
|
||||
.edit, .delete
|
||||
font-size: 80%
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<span class='vim-nav-hint'>like</span>
|
||||
</a>
|
||||
<% } else { %>
|
||||
<a href class='upvote inactive'>
|
||||
<a class='upvote inactive'>
|
||||
<i class='fa fa-thumbs-o-up'></i>
|
||||
</a>
|
||||
<% } %>
|
||||
|
|
|
@ -222,6 +222,9 @@ class PostController {
|
|||
}
|
||||
|
||||
_evtScorePost(e) {
|
||||
if (!api.hasPrivilege('posts:score')) {
|
||||
return;
|
||||
}
|
||||
e.detail.post.setScore(e.detail.score)
|
||||
.catch(errorMessage => {
|
||||
window.alert(errorMessage);
|
||||
|
@ -229,6 +232,9 @@ class PostController {
|
|||
}
|
||||
|
||||
_evtFavoritePost(e) {
|
||||
if (!api.hasPrivilege('posts:favorite')) {
|
||||
return;
|
||||
}
|
||||
e.detail.post.addToFavorites()
|
||||
.catch(errorMessage => {
|
||||
window.alert(errorMessage);
|
||||
|
@ -236,6 +242,9 @@ class PostController {
|
|||
}
|
||||
|
||||
_evtUnfavoritePost(e) {
|
||||
if (!api.hasPrivilege('posts:favorite')) {
|
||||
return;
|
||||
}
|
||||
e.detail.post.removeFromFavorites()
|
||||
.catch(errorMessage => {
|
||||
window.alert(errorMessage);
|
||||
|
|
|
@ -90,6 +90,9 @@ class CommentControl extends events.EventTarget {
|
|||
|
||||
_evtScoreClick(e, score) {
|
||||
e.preventDefault();
|
||||
if (!api.hasPrivilege('comments:score')) {
|
||||
return;
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('score', {
|
||||
detail: {
|
||||
comment: this._comment,
|
||||
|
|
Loading…
Reference in a new issue