mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
minor tweaks #144
This commit is contained in:
parent
bf03020089
commit
329ad0093e
4 changed files with 4 additions and 1 deletions
|
@ -1397,6 +1397,7 @@ def create_post(activity_log: ActivityPubLog, community: Community, request_json
|
|||
if post.image_id:
|
||||
make_image_sizes(post.image_id, 150, 512, 'posts') # the 512 sized image is for masonry view
|
||||
|
||||
# Update list of cross posts
|
||||
if post.url:
|
||||
other_posts = Post.query.filter(Post.id != post.id, Post.url == post.url,
|
||||
Post.posted_at > post.posted_at - timedelta(days=6)).all()
|
||||
|
|
|
@ -470,6 +470,7 @@ def add_post(actor):
|
|||
if post.image_id and post.image.file_path is None:
|
||||
make_image_sizes(post.image_id, 150, 512, 'posts') # the 512 sized image is for masonry view
|
||||
|
||||
# Update list of cross posts
|
||||
if post.url:
|
||||
other_posts = Post.query.filter(Post.id != post.id, Post.url == post.url,
|
||||
Post.posted_at > post.posted_at - timedelta(days=6)).all()
|
||||
|
|
|
@ -212,7 +212,7 @@ def save_post(form, post: Post):
|
|||
post.body = form.link_body.data
|
||||
post.body_html = markdown_to_html(post.body)
|
||||
url_changed = post.id is None or form.link_url.data != post.url
|
||||
post.url = remove_tracking_from_link(form.link_url.data)
|
||||
post.url = remove_tracking_from_link(form.link_url.data.strip())
|
||||
post.type = POST_TYPE_LINK
|
||||
domain = domain_from_url(form.link_url.data)
|
||||
domain.post_count += 1
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<div class="row">
|
||||
<div class="col col-login mx-auto">
|
||||
<h3 class="mt-2 post_title">{{ _('Cross-posts for "%(post_title)s"', post_title=post.title) }}</h3>
|
||||
<p>{{ _('Posts to the same url have also been created in the following communities:') }}</p>
|
||||
<ul class="cross_post_list">
|
||||
{% for cross_post in cross_posts %}
|
||||
<li><a href="{{ url_for('activitypub.post_ap', post_id=cross_post.id) }}">
|
||||
|
|
Loading…
Add table
Reference in a new issue