2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-24 16:21:53 +00:00
This commit is contained in:
Philip Sargent 2024-07-23 09:39:21 +02:00
parent c01f0e1dff
commit feaf38aa39
2 changed files with 6 additions and 4 deletions

View File

@ -223,9 +223,11 @@ def personexpedition(request, slug="", year=""):
def logentrydelete(request, year): def logentrydelete(request, year):
"""This only gets called by a POST from the logreport page """This only gets called by a POST from the logreport page
The function in memory of James Waite who managed to make so many duplicate logbook entries This function is dedicated to James Waite who managed to make so many duplicate logbook entries
that we needed a sopecial mechanism to delete them. that we needed a sopecial mechanism to delete them.
""" """
for i in request.POST:
print(f" - '{i}' {request.POST[i]}")
eslug = request.POST["entry_slug"] eslug = request.POST["entry_slug"]
entry = LogbookEntry.objects.get(slug=eslug) entry = LogbookEntry.objects.get(slug=eslug)
# OK we delete it formt he db and then re-save logbook.html file # OK we delete it formt he db and then re-save logbook.html file

View File

@ -21,7 +21,6 @@
<p>(Hover mouse over the date to see the slug for the entry.) <p>(Hover mouse over the date to see the slug for the entry.)
{% if logged_in %}<font color="red">Logged in as expoadmin</font>{% endif %} {% if logged_in %}<font color="red">Logged in as expoadmin</font>{% endif %}
<input type="hidden" value="{{entry.slug}}" name="entry_slug">
<table class="expeditionlogbooks"> <table class="expeditionlogbooks">
<tr><th>Date</th><th>Logged trips and diary entries</th><th>Cave</th><th>Text..</th><th>Words</th><th>Author</th><th>Who else</th> <tr><th>Date</th><th>Logged trips and diary entries</th><th>Cave</th><th>Text..</th><th>Words</th><th>Author</th><th>Who else</th>
@ -33,7 +32,7 @@
<tr> <tr>
<td title="{{entry.slug}}">{{date.grouper|date:"D d M Y"}}</td> <td title="{{entry.slug}}">{{date.grouper|date:"D d M Y"}}</td>
<td> <td>
<a href="{{ entry.get_absolute_url }}">{{entry.title|truncatechars:30|safe|striptags}}</a>&nbsp; <a href="{{ entry.get_absolute_url }}">{{entry.title|truncatechars:25|safe|striptags}}</a>&nbsp;
</td> </td>
<td> <td>
{% if entry.cave %} {% if entry.cave %}
@ -60,10 +59,11 @@
</td> </td>
{% if logged_in %} {% if logged_in %}
<form name="import" method="post" action="/logentrydelete/{{year}}">{% csrf_token %} <form name="delete_entry" method="post" action="/logentrydelete/{{year}}">{% csrf_token %}
<td> <td>
{{entry.slug}}</td> {{entry.slug}}</td>
<td> <td>
<input type="hidden" value="{{entry.slug}}" name="entry_slug">
<input type="submit" value="delete"></td> <input type="submit" value="delete"></td>
</form> </form>
{% endif %} {% endif %}