Added quick mention, improved create experience

This commit is contained in:
Yusur 2019-10-10 14:22:06 +02:00
parent bd188a02bc
commit 528e9e2c1c
4 changed files with 6 additions and 4 deletions

1
app.py
View file

@ -407,7 +407,6 @@ def create():
file.save(UPLOAD_DIRECTORY + str(upload.id) + '.' + ext)
flash('Your message has been posted successfully')
return redirect(url_for('user_detail', username=user.username))
return render_template('create.html')
@app.route('/notifications/')

View file

@ -8,3 +8,4 @@ body{margin:0}
.header h1{margin:0;display:inline-block}
.flash{background-color:#ff9;border:yellow 1px solid}
.message-visual img{max-width:100%;max-height:8em}
.create_text{width:100%;height:8em}

View file

@ -4,8 +4,9 @@
<form action="{{ url_for('create') }}" method="POST" enctype="multipart/form-data">
<dl>
<dt>Message:</dt>
<dd><textarea name="text" placeholder="What's happening?"></textarea></dd>
<dd><textarea name="text" placeholder="What's happening?" class="create_text">{{ request.args['preload'] }}</textarea></dd>
<dd id="fileInputContainer"><a href="javascript:attachFileInput();">Add a file...</a>
<dd><small>Messages are public and can be seen on your profile as well as public timeline.</small></dd>
<dd><input type="submit" value="Create" /></dd>
</dl>
</form>

View file

@ -12,13 +12,14 @@
{% if user.username != current_user.username %}
{% if current_user|is_following(user) %}
<form action="{{ url_for('user_unfollow', username=user.username) }}" method="post">
<input type="submit" value="- Un-follow" />
<input type="submit" class="follow_button following" value="- Un-follow" />
</form>
{% else %}
<form action="{{ url_for('user_follow', username=user.username) }}" method="post">
<input type="submit" value="+ Follow" />
<input type="submit" class="follow_button" value="+ Follow" />
</form>
{% endif %}
<p><a href="/create/?preload=%2B{{ user.username }}">Mention this user in a message</a></p>
{% endif %}
{% endif %}
<ul>