Skip to content

Commit

Permalink
added blog support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dem13n committed Jan 19, 2021
1 parent ba8cca8 commit 7ad7539
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/dist/forum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ app.initializers.add('dem13n-topic-starter-label', () => {

const routeName = app.current.get('routeName');

if (routeName === 'discussion' || routeName === 'discussion.near') {
if (routeName === 'discussion' || routeName === 'discussion.near' || routeName === 'blogArticle') {

const labelText = (routeName === 'blogArticle') ? app.translator.trans('dem13n.forum.blog_article_author') : app.translator.trans('dem13n.forum.topic_starter');
const post = this.attrs.post;
const postAuthor = post.user().id();
const discussionAuthor = post.discussion().user().id();
Expand All @@ -29,7 +30,7 @@ app.initializers.add('dem13n-topic-starter-label', () => {

if (postAuthor === discussionAuthor && checkFP(post)) {
vnode.children.push(
<span className="topicStarter">{app.translator.trans('dem13n.forum.topic_starter')}</span>
<span className="topicStarter">{labelText}</span>
);
}
}
Expand Down
1 change: 1 addition & 0 deletions locale/en.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dem13n:
forum:
topic_starter: Topic starter
blog_article_author: Author
1 change: 1 addition & 0 deletions locale/ru.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dem13n:
forum:
topic_starter: Автор темы
blog_article_author: Автор

0 comments on commit 7ad7539

Please sign in to comment.