From: Dessalines Date: Thu, 22 Aug 2019 18:46:54 +0000 (-0700) Subject: cross-posting almost done. X-Git-Url: http://these/git/%7B%60/static/assets/css/themes/%24%7BappleTouchIcon%7D?a=commitdiff_plain;h=954c89edaf1bcc5dc46c3b593bf8b065f0db74a9;p=lemmy.git cross-posting almost done. --- 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 {
  • {post.saved ? i18n.t('unsave') : i18n.t('save')}
  • +
  • + # +
  • {this.myPost && <>
  • @@ -270,6 +273,17 @@ export class PostListing extends Component { 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',