mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-18 13:27:10 +00:00
idenitifed login stuff
This commit is contained in:
@@ -24,10 +24,11 @@ from troggle.core.utils import (
|
|||||||
WriteAndCommitError,
|
WriteAndCommitError,
|
||||||
add_commit,
|
add_commit,
|
||||||
current_expo,
|
current_expo,
|
||||||
get_cookie,
|
get_editor,
|
||||||
git_commit,
|
git_commit,
|
||||||
git_string,
|
git_string,
|
||||||
sanitize_name,
|
sanitize_name,
|
||||||
|
is_identified_user,
|
||||||
write_and_commit,
|
write_and_commit,
|
||||||
)
|
)
|
||||||
from troggle.core.views.auth import login_required_if_public
|
from troggle.core.views.auth import login_required_if_public
|
||||||
@@ -91,6 +92,7 @@ class WalletForm(forms.Form): # not a model-form, just a form-form
|
|||||||
pland = forms.CharField(strip=True, required=False)
|
pland = forms.CharField(strip=True, required=False)
|
||||||
elevd = forms.CharField(strip=True, required=False)
|
elevd = forms.CharField(strip=True, required=False)
|
||||||
survex = forms.CharField(strip=True, required=False)
|
survex = forms.CharField(strip=True, required=False)
|
||||||
|
identified_login = forms.BooleanField(required=False,widget=forms.CheckboxInput(attrs={"onclick":"return false"})) # makes it readonly
|
||||||
who_are_you = forms.CharField(strip=True,
|
who_are_you = forms.CharField(strip=True,
|
||||||
widget=forms.TextInput( # We are not using auto form rendering for this form, so this widget is not used.
|
widget=forms.TextInput( # We are not using auto form rendering for this form, so this widget is not used.
|
||||||
attrs={"size": 100, "placeholder": "You are editing this page, who are you ? e.g. 'Becka' or 'Animal <mta@gasthof.expo>'",
|
attrs={"size": 100, "placeholder": "You are editing this page, who are you ? e.g. 'Becka' or 'Animal <mta@gasthof.expo>'",
|
||||||
@@ -680,7 +682,8 @@ def walletedit(request, path=None):
|
|||||||
|
|
||||||
fresh_wallet = False
|
fresh_wallet = False
|
||||||
|
|
||||||
editor = get_cookie(request)
|
identified_login = is_identified_user(request.user)
|
||||||
|
editor = get_editor(request)
|
||||||
form = WalletFilesForm()
|
form = WalletFilesForm()
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
@@ -955,6 +958,7 @@ def walletedit(request, path=None):
|
|||||||
"peoplesize": str(len(str(people))),
|
"peoplesize": str(len(str(people))),
|
||||||
"filesaved": filesaved,
|
"filesaved": filesaved,
|
||||||
"actual_saved": actual_saved,
|
"actual_saved": actual_saved,
|
||||||
|
"identified_login": identified_login,
|
||||||
"who_are_you": editor,
|
"who_are_you": editor,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -241,7 +241,10 @@ and <em>also</em> the exported files in standard formats: svx, svg etc. See why
|
|||||||
title="List of survex files using this data"
|
title="List of survex files using this data"
|
||||||
placeholder="['caves-1623/148/148-2007.svx']" value="{{survex}}" />
|
placeholder="['caves-1623/148/148-2007.svx']" value="{{survex}}" />
|
||||||
<br>
|
<br>
|
||||||
<label for="who_are_you">Who are you:</label>
|
<label for="id_identified_login">Identified login:</label>
|
||||||
|
<input type="checkbox" name="identified_login" onclick="return false" id="id_identified_login"><br />
|
||||||
|
<br>
|
||||||
|
<label for="who_are_you">Who are you:</label>
|
||||||
<input {% if not user.username %} disabled{% endif %}
|
<input {% if not user.username %} disabled{% endif %}
|
||||||
label = "Who are you" name = "who_are_you" size ="{{freetextsize}}"
|
label = "Who are you" name = "who_are_you" size ="{{freetextsize}}"
|
||||||
title="Who are you:"
|
title="Who are you:"
|
||||||
|
|||||||
Reference in New Issue
Block a user