Add mention to user actions
This commit is contained in:
parent
9122a44216
commit
d0bed792b2
|
@ -55,6 +55,10 @@ Brutaldon - {{ timeline }} timelime
|
|||
href="{{ user.url }}" title="home">
|
||||
<span class="is-hidden">View on home site</span>
|
||||
</a>
|
||||
<a class="level-item fa fa-envelope"
|
||||
href="{% url 'toot' user.acct %}" title="mention">
|
||||
<span class="is-hidden">Mention</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="level-right">
|
||||
{% if not relationship.muting %}
|
||||
|
|
|
@ -40,6 +40,7 @@ urlpatterns = [
|
|||
path('thread/<int:id>', views.thread, name='thread'),
|
||||
path('tags/<tag>', views.tag, name='tag'),
|
||||
path('user/<username>', views.user, name='user'),
|
||||
path('toot/<mention>', views.toot, name='toot'),
|
||||
path('toot', views.toot, name="toot"),
|
||||
path('reply/<int:id>', views.reply, name='reply'),
|
||||
path('fav/<int:id>', views.fav, name='fav'),
|
||||
|
|
|
@ -292,8 +292,14 @@ def settings(request):
|
|||
{ 'form': form, 'fullbrutalism': fullbrutalism_p(request)})
|
||||
|
||||
@never_cache
|
||||
def toot(request):
|
||||
def toot(request, mention=None):
|
||||
if request.method == 'GET':
|
||||
if mention:
|
||||
if not mention.startswith('@'):
|
||||
mention = '@'+mention
|
||||
form = PostForm(initial={'visibility': request.session['user'].source.privacy,
|
||||
'status': mention + '\n' })
|
||||
else:
|
||||
form = PostForm(initial={'visibility': request.session['user'].source.privacy})
|
||||
return render(request, 'main/post.html',
|
||||
{'form': form,
|
||||
|
|
Loading…
Reference in New Issue