From d0bed792b221ed83f5537d708eb82d634c2c358f Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Mon, 11 Jun 2018 19:19:22 -0400 Subject: [PATCH] Add mention to user actions --- brutaldon/templates/main/user.html | 4 ++++ brutaldon/urls.py | 1 + brutaldon/views.py | 10 ++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/brutaldon/templates/main/user.html b/brutaldon/templates/main/user.html index bc755f0..55735c4 100644 --- a/brutaldon/templates/main/user.html +++ b/brutaldon/templates/main/user.html @@ -55,6 +55,10 @@ Brutaldon - {{ timeline }} timelime href="{{ user.url }}" title="home"> + + +
{% if not relationship.muting %} diff --git a/brutaldon/urls.py b/brutaldon/urls.py index 191c4cc..5fb039b 100644 --- a/brutaldon/urls.py +++ b/brutaldon/urls.py @@ -40,6 +40,7 @@ urlpatterns = [ path('thread/', views.thread, name='thread'), path('tags/', views.tag, name='tag'), path('user/', views.user, name='user'), + path('toot/', views.toot, name='toot'), path('toot', views.toot, name="toot"), path('reply/', views.reply, name='reply'), path('fav/', views.fav, name='fav'), diff --git a/brutaldon/views.py b/brutaldon/views.py index d78778f..508b5be 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -292,9 +292,15 @@ def settings(request): { 'form': form, 'fullbrutalism': fullbrutalism_p(request)}) @never_cache -def toot(request): +def toot(request, mention=None): if request.method == 'GET': - form = PostForm(initial={'visibility': request.session['user'].source.privacy}) + 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, 'fullbrutalism': fullbrutalism_p(request)})