Don't lose text or spoiler text when expanding toot form

This commit is contained in:
Jason McBrayer 2018-10-14 08:36:47 -04:00
parent 66e53837cf
commit bb65be3e8b
2 changed files with 5 additions and 2 deletions

View File

@ -33,6 +33,7 @@
ic-get-from="{% url "toot" %}"
ic-target="#post-form"
ic-select-from-response="#post-form"
ic-include="#id_status,#id_spoiler_text"
title="Complete toot form (media, visibility, etc"
class="fa fa-edit">
<span class="is-hidden">Complete toot form (media, visibility etc)</span>

View File

@ -424,10 +424,12 @@ def toot(request, mention=None):
if mention:
if not mention.startswith('@'):
mention = '@'+mention
form = PostForm(initial={'visibility': request.session['user'].source.privacy,
form = PostForm(request.GET, request.FILES,
initial={'visibility': request.session['user'].source.privacy,
'status': mention + '\n' })
else:
form = PostForm(initial={'visibility': request.session['user'].source.privacy})
form = PostForm(request.GET, request.FILES,
initial={'visibility': request.session['user'].source.privacy})
return render(request, 'main/post.html',
{'form': form,
'own_acct': request.session['user'],