mirror of
https://github.com/flarum/core.git
synced 2025-07-17 06:41:21 +02:00
committed by
GitHub
parent
b663d9b199
commit
080f553a08
@@ -5,7 +5,7 @@ import CommentPost from 'flarum/components/CommentPost';
|
||||
|
||||
export default function() {
|
||||
extend(CommentPost.prototype, 'actionItems', function(items) {
|
||||
const post = this.props.post;
|
||||
const post = this.attrs.post;
|
||||
|
||||
if (post.isHidden() || !post.canLike()) return;
|
||||
|
||||
@@ -15,7 +15,6 @@ export default function() {
|
||||
|
||||
items.add('like',
|
||||
Button.component({
|
||||
children: app.translator.trans(isLiked ? 'flarum-likes.forum.post.unlike_link' : 'flarum-likes.forum.post.like_link'),
|
||||
className: 'Button Button--link',
|
||||
onclick: () => {
|
||||
isLiked = !isLiked;
|
||||
@@ -37,7 +36,7 @@ export default function() {
|
||||
data.unshift({type: 'users', id: app.session.user.id()});
|
||||
}
|
||||
}
|
||||
})
|
||||
}, app.translator.trans(isLiked ? 'flarum-likes.forum.post.unlike_link' : 'flarum-likes.forum.post.like_link'))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import PostLikesModal from './components/PostLikesModal';
|
||||
|
||||
export default function() {
|
||||
extend(CommentPost.prototype, 'footerItems', function(items) {
|
||||
const post = this.props.post;
|
||||
const post = this.attrs.post;
|
||||
const likes = post.likes();
|
||||
|
||||
if (likes && likes.length) {
|
||||
@@ -22,7 +22,7 @@ export default function() {
|
||||
.slice(0, overLimit ? limit - 1 : limit)
|
||||
.map(user => {
|
||||
return (
|
||||
<a href={app.route.user(user)} config={m.route}>
|
||||
<a route={app.route.user(user)}>
|
||||
{user === app.session.user ? app.translator.trans('flarum-likes.forum.post.you_text') : username(user)}
|
||||
</a>
|
||||
);
|
||||
|
@@ -7,17 +7,17 @@ export default class PostLikedNotification extends Notification {
|
||||
}
|
||||
|
||||
href() {
|
||||
return app.route.post(this.props.notification.subject());
|
||||
return app.route.post(this.attrs.notification.subject());
|
||||
}
|
||||
|
||||
content() {
|
||||
const notification = this.props.notification;
|
||||
const notification = this.attrs.notification;
|
||||
const user = notification.fromUser();
|
||||
|
||||
return app.translator.transChoice('flarum-likes.forum.notifications.post_liked_text', 1, {user});
|
||||
}
|
||||
|
||||
excerpt() {
|
||||
return truncate(this.props.notification.subject().contentPlain(), 200);
|
||||
return truncate(this.attrs.notification.subject().contentPlain(), 200);
|
||||
}
|
||||
}
|
||||
|
@@ -15,9 +15,9 @@ export default class PostLikesModal extends Modal {
|
||||
return (
|
||||
<div className="Modal-body">
|
||||
<ul className="PostLikesModal-list">
|
||||
{this.props.post.likes().map(user => (
|
||||
{this.attrs.post.likes().map(user => (
|
||||
<li>
|
||||
<a href={app.route.user(user)} config={m.route}>
|
||||
<a route={app.route.user(user)}>
|
||||
{avatar(user)} {' '}
|
||||
{username(user)}
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user