mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-24 11:51:27 -08:00
add language choices to UI - logged in users only #51
This commit is contained in:
parent
af4dee7ea3
commit
7867b5b346
2 changed files with 6 additions and 6 deletions
|
@ -517,7 +517,7 @@ def add_discussion_post(actor):
|
||||||
else:
|
else:
|
||||||
form.communities.data = community.id
|
form.communities.data = community.id
|
||||||
form.notify_author.data = True
|
form.notify_author.data = True
|
||||||
form.language_id.data = current_user.language_id if current_user.language_id else english_language_id()
|
form.language_id.data = current_user.language_id if current_user.is_authenticated and current_user.language_id else english_language_id()
|
||||||
if community.posting_warning:
|
if community.posting_warning:
|
||||||
flash(community.posting_warning)
|
flash(community.posting_warning)
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ def add_image_post(actor):
|
||||||
else:
|
else:
|
||||||
form.communities.data = community.id
|
form.communities.data = community.id
|
||||||
form.notify_author.data = True
|
form.notify_author.data = True
|
||||||
form.language_id.data = current_user.language_id if current_user.language_id else english_language_id()
|
form.language_id.data = current_user.language_id if current_user.is_authenticated and current_user.language_id else english_language_id()
|
||||||
|
|
||||||
return render_template('community/add_image_post.html', title=_('Add post to community'), form=form, community=community,
|
return render_template('community/add_image_post.html', title=_('Add post to community'), form=form, community=community,
|
||||||
markdown_editor=current_user.markdown_editor, low_bandwidth=False, actor=actor,
|
markdown_editor=current_user.markdown_editor, low_bandwidth=False, actor=actor,
|
||||||
|
@ -679,7 +679,7 @@ def add_link_post(actor):
|
||||||
else:
|
else:
|
||||||
form.communities.data = community.id
|
form.communities.data = community.id
|
||||||
form.notify_author.data = True
|
form.notify_author.data = True
|
||||||
form.language_id.data = current_user.language_id if current_user.language_id else english_language_id()
|
form.language_id.data = current_user.language_id if current_user.is_authenticated and current_user.language_id else english_language_id()
|
||||||
|
|
||||||
return render_template('community/add_link_post.html', title=_('Add post to community'), form=form, community=community,
|
return render_template('community/add_link_post.html', title=_('Add post to community'), form=form, community=community,
|
||||||
markdown_editor=current_user.markdown_editor, low_bandwidth=False, actor=actor,
|
markdown_editor=current_user.markdown_editor, low_bandwidth=False, actor=actor,
|
||||||
|
@ -759,7 +759,7 @@ def add_video_post(actor):
|
||||||
else:
|
else:
|
||||||
form.communities.data = community.id
|
form.communities.data = community.id
|
||||||
form.notify_author.data = True
|
form.notify_author.data = True
|
||||||
form.language_id.data = current_user.language_id if current_user.language_id else english_language_id()
|
form.language_id.data = current_user.language_id if current_user.is_authenticated and current_user.language_id else english_language_id()
|
||||||
|
|
||||||
return render_template('community/add_video_post.html', title=_('Add post to community'), form=form, community=community,
|
return render_template('community/add_video_post.html', title=_('Add post to community'), form=form, community=community,
|
||||||
markdown_editor=current_user.markdown_editor, low_bandwidth=False, actor=actor,
|
markdown_editor=current_user.markdown_editor, low_bandwidth=False, actor=actor,
|
||||||
|
|
|
@ -229,7 +229,7 @@ def show_post(post_id: int):
|
||||||
else:
|
else:
|
||||||
replies = post_replies(post.id, sort)
|
replies = post_replies(post.id, sort)
|
||||||
form.notify_author.data = True
|
form.notify_author.data = True
|
||||||
form.language_id.data = current_user.language_id if current_user.language_id else english_language_id()
|
form.language_id.data = current_user.language_id if current_user.is_authenticated and current_user.language_id else english_language_id()
|
||||||
|
|
||||||
og_image = post.image.source_url if post.image_id else None
|
og_image = post.image.source_url if post.image_id else None
|
||||||
description = shorten_string(markdown_to_text(post.body), 150) if post.body else None
|
description = shorten_string(markdown_to_text(post.body), 150) if post.body else None
|
||||||
|
@ -771,7 +771,7 @@ def add_reply(post_id: int, comment_id: int):
|
||||||
return redirect(url_for('post.continue_discussion', post_id=post_id, comment_id=reply.parent_id))
|
return redirect(url_for('post.continue_discussion', post_id=post_id, comment_id=reply.parent_id))
|
||||||
else:
|
else:
|
||||||
form.notify_author.data = True
|
form.notify_author.data = True
|
||||||
form.language_id.data = current_user.language_id if current_user.language_id else english_language_id()
|
form.language_id.data = current_user.language_id if current_user.is_authenticated and current_user.language_id else english_language_id()
|
||||||
|
|
||||||
return render_template('post/add_reply.html', title=_('Discussing %(title)s', title=post.title), post=post,
|
return render_template('post/add_reply.html', title=_('Discussing %(title)s', title=post.title), post=post,
|
||||||
is_moderator=is_moderator, form=form, comment=in_reply_to, markdown_editor=current_user.is_authenticated and current_user.markdown_editor,
|
is_moderator=is_moderator, form=form, comment=in_reply_to, markdown_editor=current_user.is_authenticated and current_user.markdown_editor,
|
||||||
|
|
Loading…
Add table
Reference in a new issue