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