diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-02-15 16:27:25 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-02-15 16:27:25 +0000 |
commit | 6a5513e52bd18dd2a4941baa5994afd3f95dcd1c (patch) | |
tree | ad501147d6e8675bce8f1b72c9b3b5db4fd5c309 | |
parent | dc83ae1bc632876f50e40c64e69de15718a7fead (diff) | |
download | troggle-6a5513e52bd18dd2a4941baa5994afd3f95dcd1c.tar.gz troggle-6a5513e52bd18dd2a4941baa5994afd3f95dcd1c.tar.bz2 troggle-6a5513e52bd18dd2a4941baa5994afd3f95dcd1c.zip |
idenitifed login stuff
-rw-r--r-- | core/views/wallets_edit.py | 8 | ||||
-rw-r--r-- | templates/walletform.html | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/core/views/wallets_edit.py b/core/views/wallets_edit.py index bc83633..3f9e98d 100644 --- a/core/views/wallets_edit.py +++ b/core/views/wallets_edit.py @@ -24,10 +24,11 @@ from troggle.core.utils import ( WriteAndCommitError, add_commit, current_expo, - get_cookie, + get_editor, git_commit, git_string, sanitize_name, + is_identified_user, write_and_commit, ) 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) elevd = 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, 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>'", @@ -680,7 +682,8 @@ def walletedit(request, path=None): fresh_wallet = False - editor = get_cookie(request) + identified_login = is_identified_user(request.user) + editor = get_editor(request) form = WalletFilesForm() if request.method == "POST": @@ -955,6 +958,7 @@ def walletedit(request, path=None): "peoplesize": str(len(str(people))), "filesaved": filesaved, "actual_saved": actual_saved, + "identified_login": identified_login, "who_are_you": editor, } diff --git a/templates/walletform.html b/templates/walletform.html index 7300434..f92599f 100644 --- a/templates/walletform.html +++ b/templates/walletform.html @@ -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" placeholder="['caves-1623/148/148-2007.svx']" value="{{survex}}" /> <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 %} label = "Who are you" name = "who_are_you" size ="{{freetextsize}}" title="Who are you:" |