mirror of
https://gitlab.com/brutaldon/brutaldon
synced 2025-02-11 17:10:42 +01:00
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">
|
href="{{ user.url }}" title="home">
|
||||||
<span class="is-hidden">View on home site</span>
|
<span class="is-hidden">View on home site</span>
|
||||||
</a>
|
</a>
|
||||||
|
<a class="level-item fa fa-envelope"
|
||||||
|
href="{% url 'toot' user.acct %}" title="mention">
|
||||||
|
<span class="is-hidden">Mention</span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="level-right">
|
<div class="level-right">
|
||||||
{% if not relationship.muting %}
|
{% if not relationship.muting %}
|
||||||
|
@ -40,6 +40,7 @@ urlpatterns = [
|
|||||||
path('thread/<int:id>', views.thread, name='thread'),
|
path('thread/<int:id>', views.thread, name='thread'),
|
||||||
path('tags/<tag>', views.tag, name='tag'),
|
path('tags/<tag>', views.tag, name='tag'),
|
||||||
path('user/<username>', views.user, name='user'),
|
path('user/<username>', views.user, name='user'),
|
||||||
|
path('toot/<mention>', views.toot, name='toot'),
|
||||||
path('toot', views.toot, name="toot"),
|
path('toot', views.toot, name="toot"),
|
||||||
path('reply/<int:id>', views.reply, name='reply'),
|
path('reply/<int:id>', views.reply, name='reply'),
|
||||||
path('fav/<int:id>', views.fav, name='fav'),
|
path('fav/<int:id>', views.fav, name='fav'),
|
||||||
|
@ -292,8 +292,14 @@ def settings(request):
|
|||||||
{ 'form': form, 'fullbrutalism': fullbrutalism_p(request)})
|
{ 'form': form, 'fullbrutalism': fullbrutalism_p(request)})
|
||||||
|
|
||||||
@never_cache
|
@never_cache
|
||||||
def toot(request):
|
def toot(request, mention=None):
|
||||||
if request.method == 'GET':
|
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})
|
form = PostForm(initial={'visibility': request.session['user'].source.privacy})
|
||||||
return render(request, 'main/post.html',
|
return render(request, 'main/post.html',
|
||||||
{'form': form,
|
{'form': form,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user