mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
hide community selection when editing post
This commit is contained in:
parent
49db71e05d
commit
5ab1082551
2 changed files with 14 additions and 5 deletions
|
@ -604,6 +604,7 @@ def post_reply_options(post_id: int, comment_id: int):
|
||||||
def post_edit(post_id: int):
|
def post_edit(post_id: int):
|
||||||
post = Post.query.get_or_404(post_id)
|
post = Post.query.get_or_404(post_id)
|
||||||
form = CreatePostForm()
|
form = CreatePostForm()
|
||||||
|
del form.communities
|
||||||
if post.user_id == current_user.id or post.community.is_moderator():
|
if post.user_id == current_user.id or post.community.is_moderator():
|
||||||
if g.site.enable_nsfl is False:
|
if g.site.enable_nsfl is False:
|
||||||
form.nsfl.render_kw = {'disabled': True}
|
form.nsfl.render_kw = {'disabled': True}
|
||||||
|
@ -614,7 +615,7 @@ def post_edit(post_id: int):
|
||||||
form.nsfl.data = True
|
form.nsfl.data = True
|
||||||
form.nsfw.render_kw = {'disabled': True}
|
form.nsfw.render_kw = {'disabled': True}
|
||||||
|
|
||||||
form.communities.choices = [(c.id, c.display_name()) for c in current_user.communities()]
|
#form.communities.choices = [(c.id, c.display_name()) for c in current_user.communities()]
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
save_post(form, post)
|
save_post(form, post)
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
<h1>{{ _('Edit post') }}</h1>
|
<h1>{{ _('Edit post') }}</h1>
|
||||||
<form method="post" enctype="multipart/form-data" role="form">
|
<form method="post" enctype="multipart/form-data" role="form">
|
||||||
{{ form.csrf_token() }}
|
{{ form.csrf_token() }}
|
||||||
{{ render_field(form.communities) }}
|
|
||||||
<nav id="post_type_chooser">
|
<nav id="post_type_chooser">
|
||||||
<div class="nav nav-tabs nav-justified" id="typeTab" role="tablist">
|
<div class="nav nav-tabs nav-justified" id="typeTab" role="tablist">
|
||||||
<button class="nav-link active" id="discussion-tab" data-bs-toggle="tab" data-bs-target="#discussion-tab-pane"
|
<button class="nav-link active" id="discussion-tab" data-bs-toggle="tab" data-bs-target="#discussion-tab-pane"
|
||||||
|
@ -143,11 +142,20 @@
|
||||||
<h2>{{ post.community.title }}</h2>
|
<h2>{{ post.community.title }}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>{{ post.community.description|safe }}</p>
|
<p>{{ post.community.description_html|safe if post.community.description_html else '' }}</p>
|
||||||
<p>{{ post.community.rules|safe }}</p>
|
<p>{{ post.community.rules_html|safe if post.community.rules_html else '' }}</p>
|
||||||
|
{% if len(mods) > 0 and not post.community.private_mods %}
|
||||||
|
<h3>Moderators</h3>
|
||||||
|
<ul class="moderator_list">
|
||||||
|
{% for mod in mods %}
|
||||||
|
<li><a href="/u/{{ mod.link() }}">{{ mod.display_name() }}</a></li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% include "_inoculation_links.html" %}
|
||||||
</aside>
|
</aside>
|
||||||
{% include "_inoculation_links.html" %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Add table
Reference in a new issue