Move to top results as default page.

This commit is contained in:
Timothy Allen 2018-08-14 11:15:34 +02:00
parent 8007a3690c
commit 688c2d1374
2 changed files with 3 additions and 5 deletions

View File

@ -10,8 +10,6 @@ app = Flask(__name__)
PAGE_SIZE=20
MIN_MONTHS_FOR_LISTINGS=3
# TODO: Replace rankings with top recent results: position, sexposition, or catposition < 10, sorted by event and date
@app.template_filter('urlescape')
def urlescape(string):
if string is None:
@ -227,8 +225,8 @@ def read_db(listing=None, event=None, person=None, licence=None, search=dict(),
def list(title=None, year=None):
''' Set defaults for the index page '''
if year is None and title is None:
year = now().year
title = 'runners'
#year = now().year
title = 'top'
title = urllib.parse.unquote_plus(title)
if title not in ( 'races', 'top', 'rankings', 'runners', 'licence', ):
abort(404)

View File

@ -1,7 +1,7 @@
<nav class="tabs">
<span><a href="{{ url_for('list', title='top', year=None, start=None, show=ns.show) }}">Top Results</a></span>
<span><a href="{{ url_for('list', title='runners', year=now|year, start=None, show=ns.show) }}">Runners</a></span>
<!--span><a href="{{ url_for('list', title='rankings', year=now|year, start=None, show=ns.show) }}">Rankings</a></span-->
<span><a href="{{ url_for('list', title='top', year=None, start=None, show=ns.show) }}">Top Results</a></span>
<span><a href="{{ url_for('index', title=None, year=None, start=None, show=ns.show) }}">All Results</a></span>
<span><a href="{{ url_for('list', title='races', year=None, start=None, show=ns.show) }}">Races</a></span>
<span><a href="{{ url_for('list', title='licence', year=now|year, start=None, show=ns.show) }}">Licences</a></span>