mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 07:13:52 -05:00
Sharing bookmarklet works
This commit is contained in:
parent
da1de5ea32
commit
2da4fd0de2
@ -166,6 +166,12 @@
|
||||
value="Save" class="button is-primary" >
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<h2 class="subtitle">Bookmarklet</h2>
|
||||
<p>
|
||||
<a href="{{ bookmarklet_url }}">Share via brutaldon</a>
|
||||
</p>
|
||||
|
||||
<h2 class="subtitle">Filters and More</h2>
|
||||
<p><a href="{% url "list_filters" %}">List filters</a></p>
|
||||
<p><a href="{% url "follow_requests" %}">Follow requests</a></p>
|
||||
|
@ -191,6 +191,11 @@ def min_visibility(visibility1, visibility2):
|
||||
]
|
||||
|
||||
|
||||
def bookmarklet_url(request):
|
||||
share_url = request.build_absolute_uri(reverse("share"))
|
||||
return f"javascript:location.href='{share_url}?url='+encodeURIComponent(location.href)+';title='+encodeURIComponent(document.title)"
|
||||
|
||||
|
||||
def timeline(
|
||||
request,
|
||||
timeline="home",
|
||||
@ -792,7 +797,13 @@ def settings(request):
|
||||
return redirect(home)
|
||||
else:
|
||||
return render(
|
||||
request, "setup/settings.html", {"form": form, "account": account}
|
||||
request,
|
||||
"setup/settings.html",
|
||||
{
|
||||
"form": form,
|
||||
"account": account,
|
||||
"bookmarklet_url": bookmarklet_url(request),
|
||||
},
|
||||
)
|
||||
else:
|
||||
request.session["timezone"] = account.preferences.timezone
|
||||
@ -800,7 +811,12 @@ def settings(request):
|
||||
return render(
|
||||
request,
|
||||
"setup/settings.html",
|
||||
{"form": form, "account": account, "preferences": account.preferences},
|
||||
{
|
||||
"form": form,
|
||||
"account": account,
|
||||
"preferences": account.preferences,
|
||||
"bookmarklet_url": bookmarklet_url(request),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user