mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
minor tweaks
This commit is contained in:
parent
a299ed8efd
commit
cf13ee0033
4 changed files with 10 additions and 9 deletions
|
@ -2349,7 +2349,7 @@ def resolve_remote_post(uri: str, community_id: int, announce_actor=None) -> Uni
|
|||
if post_request.status_code == 200:
|
||||
post_data = post_request.json()
|
||||
post_request.close()
|
||||
# check again that it doesn't already exist (can happen with different but equivilent URLs)
|
||||
# check again that it doesn't already exist (can happen with different but equivalent URLs)
|
||||
post = Post.query.filter_by(ap_id=post_data['id']).first()
|
||||
if post:
|
||||
return post
|
||||
|
|
|
@ -139,7 +139,7 @@ def retrieve_remote_post(community_id: int):
|
|||
community = Community.query.get_or_404(community_id)
|
||||
if form.validate_on_submit():
|
||||
address = form.address.data.strip()
|
||||
new_post = resolve_remote_post(address, community_id)
|
||||
new_post = resolve_remote_post(address, community_id)
|
||||
if new_post is None:
|
||||
flash(_('Post not found.'), 'warning')
|
||||
|
||||
|
|
|
@ -148,12 +148,10 @@
|
|||
</ul>
|
||||
{% endif %}
|
||||
{% if not community.is_local() %}
|
||||
<p>
|
||||
<a href="{{ community.profile_id() }}">View community on original server</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="/community/retrieve_remote_post/{{ community.id }}">Retrieve a post from the original server</a>
|
||||
</p>
|
||||
<ul>
|
||||
<li><p><a href="{{ community.profile_id() }}">{{ _('View community on original server') }}</a></p></li>
|
||||
<li><p><a href="{{ url_for('community.retrieve_remote_post', community_id=community.id) }}">{{ _('Retrieve a post from the original server') }}</a></p></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if community.local_only %}
|
||||
<p>{{ _('Only people on %(instance_name)s can post or reply in this community.', instance_name=current_app.config['SERVER_NAME']) }}</p>
|
||||
|
|
|
@ -52,7 +52,10 @@
|
|||
<td><p>{{ _('Results will have exactly that phrase in them.') }}</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h6 class="mt-5">{{ _('Trying to add a communitiy or post from another instance?') }} </h6>
|
||||
<p>{{ _('In many types of federated platforms you can put a URL of a post or community into the search in order to add it to your local instance. In PieFed the search is just for searching.') }}</p>
|
||||
<p><a href="{{ url_for('community.add_remote') }}" class="btn btn-primary">{{ _('Add remote community') }}</a></p>
|
||||
<p>{{ _('To add a post from a remote instance, find the community in PieFed then look for the "Retrieve a post from the original server" link.') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue