2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

msg that control panel not working

This commit is contained in:
Philip Sargent 2021-12-30 00:55:42 +00:00
parent 02e475642a
commit 928c451040
2 changed files with 33 additions and 14 deletions

View File

@ -148,15 +148,17 @@ def controlpanel(request):
def exportlogbook(request,year=None,extension=None):
'''Constructs, from the database, a complete HTML (or TXT) formatted logbook - but TEXT ONLY
for the current year. Formats available are HTML2005 or 2008text
'''Constructs, from the database, a complete HTML formatted logbook - but TEXT ONLY
for the current year. Formats available are HTML2005 or HTML2022 (planned)
There are no images stored in the database, so this is only a tool for a first pass, to be followed by
extensive hand-editing.
NEED TO ADD IN THE MATERIAL WHIHC IS NOT IN ANY LBE ! e.g. front matter.
NEED TO ADD IN THE MATERIAL WHICH IS NOT IN ANY LBE ! e.g. front matter.
This is the recipient of the POST action os the export form in the control panel
This function DOES NOT WORK.
This function is the recipient of the POST action os the export form in the control panel
'''
def lbeKey(lbe):
"""This function goes into a lexicogrpahic sort function
@ -178,13 +180,13 @@ def exportlogbook(request,year=None,extension=None):
#print(f'Logbook has {len(logbook_entries)} entries in it.')
if extension =='txt':
response = HttpResponse(content_type='text/plain')
style='2008'
else :
extension == 'html'
if extension == 'html2005':
response = HttpResponse(content_type='text/html')
style='2005'
else :
extension == 'html2022'
response = HttpResponse(content_type='text/html')
style='2022'
filename='newlogbook.' + extension
template='logbook'+style+'style.'+extension

View File

@ -20,8 +20,24 @@
</div>
{% endif %}
<div style="column-count: 2;">
{%comment%}
<h3>This control panel is being redeveloped</h3>
<p>Do not attempt to use any of these functions as they are in active development.
<ol>
<li>Importing things in the wrong order will screw-up the database links and break things.
<li>The export of logbooks in a standard HTML-like format is very much not working.
</ol>
<p>Today (Jan. 2022) we use the <a href="/handbook/troggle/trogimport.html">databaseReset program</a> to import from the master files. This is run on the server itself only by nerds who remotely log in to the server using ssh.
<p>Before you even think about doing database imports, you should understand the implications on everyone else. See <a href="/handbook/troggle/trogindex.html">the Troggle documentation</a>.
<p>As soon as you can cope, you should read the source code for
<a href="http://expo.survex.com/repositories/troggle/.git/tree/databaseReset.py">databaseReset</a> to see what it does, as the details are not documented anywhere else yet. But at least the code is quite well commented.
<p>There is currently no feedback here when an import failure occurs - even a catastrophic one. You can see the list of parsing errors on the most recent imports on the <a href="/dataissues">Data Issues</a> page.
<font style="color: silver">
<div style="column-count: 2; ">
{% comment %}
<form name="reset" method="post" action="">
{% csrf_token %}
<h3>Wipe:</h3>
@ -38,7 +54,7 @@
{% endcomment %}
<h3>Import (on top of existing data):</h3>
<p>To get a fully-functioning system, all these imports must be done and in this order.
<p>To get a fully-functioning system, all these imports must be done and in this order.
<form name="import" method="post" action="">
{% csrf_token %}
<table>
@ -111,8 +127,8 @@
<p>
Output style:
<select name="extension">
<option value="html">.html file - 2005 style</option>
<option value="txt">.txt file with MediaWiki markup</option>
<option value="html2005">.html file - 2005 style</option>
<option value="html2022">.html file - 2022 style</option>
</select>
</p>
<p>
@ -125,4 +141,5 @@
</table>
</form>
</div>
</font>
{% endblock %}