summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-08-22 11:46:54 -0700
committerDessalines <tyhou13@gmx.com>2019-08-22 11:46:54 -0700
commit954c89edaf1bcc5dc46c3b593bf8b065f0db74a9 (patch)
tree9f5c35aae70684032c00c321bebddbfa44502a62
parentb7e73a5559d05a8d06ef2e01f7382a90bb50f44f (diff)
cross-posting almost done.
-rw-r--r--ui/src/components/post-listing.tsx14
-rw-r--r--ui/src/translations/en.ts1
2 files changed, 15 insertions, 0 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index bb6f2cec..f67a0fc7 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -150,6 +150,9 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<li className="list-inline-item mr-2">
<span class="pointer" onClick={linkEvent(this, this.handleSavePostClick)}>{post.saved ? i18n.t('unsave') : i18n.t('save')}</span>
</li>
+ <li className="list-inline-item mr-2">
+ <span class="pointer" onClick={linkEvent(this, this.handleCrossPostClick)}><T i18nKey="cross_post">#</T></span>
+ </li>
{this.myPost &&
<>
<li className="list-inline-item">
@@ -270,6 +273,17 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
WebSocketService.Instance.savePost(form);
}
+ handleCrossPostClick(i: PostListing) {
+ let params = `?name=${i.props.post.name}`;
+ if (i.props.post.url) {
+ params += `&url=${i.props.post.url}`;
+ }
+ if (i.props.post.body) {
+ params += `&body=${i.props.post.body}`;
+ }
+ i.context.router.history.push(`/create_post${params}`);
+ }
+
handleModRemoveShow(i: PostListing) {
i.state.showRemoveDialog = true;
i.setState(i.state);
diff --git a/ui/src/translations/en.ts b/ui/src/translations/en.ts
index 90497ada..94e06d02 100644
--- a/ui/src/translations/en.ts
+++ b/ui/src/translations/en.ts
@@ -9,6 +9,7 @@ export const en = {
posts: 'Posts',
related_posts: 'These posts might be related',
cross_posts: 'This link has also been posted to:',
+ cross_post: 'cross-post',
comments: 'Comments',
number_of_comments:'{{count}} Comments',
remove_comment: 'Remove Comment',