From 78a5f656b9ff5cad37299892ee84ff97a26c5a8a Mon Sep 17 00:00:00 2001 From: Rad Date: Mon, 25 Feb 2019 22:24:33 +0000 Subject: [PATCH] added Rad's playground --- core/views_caves.py | 11 ++++++++++ docker/compose/mysql.env | 5 +++++ docker/mysql.env | 5 +++++ templates/millenialcaves.html | 39 +++++++++++++++++++++++++++++++++++ urls.py | 5 ++++- 5 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 docker/compose/mysql.env create mode 100644 docker/mysql.env create mode 100644 templates/millenialcaves.html diff --git a/core/views_caves.py b/core/views_caves.py index ecf26d5..f8420d7 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -59,6 +59,17 @@ def caveindex(request): caves1626.sort(caveCmp) return render_with_context(request,'caveindex.html', {'caves1623': caves1623, 'caves1626': caves1626, 'notablecaves':notablecaves, 'cavepage': True}) +def millenialcaves(request): + caves = Cave.objects.all() + notablecavehrefs = settings.NOTABLECAVESHREFS + notablecaves = [Cave.objects.get(kataster_number=kataster_number) for kataster_number in notablecavehrefs ] + caves1623 = list(Cave.objects.filter(area__short_name = "1623")) + caves1626 = list(Cave.objects.filter(area__short_name = "1626")) + caves1623.sort(caveCmp) + caves1626.sort(caveCmp) + return render_with_context(request,'millenialcaves.html', {'caves1623': caves1623, 'caves1626': caves1626, 'notablecaves':notablecaves, 'cavepage': True}) + + def cave3d(request, cave_id=''): cave = getCave(cave_id) survexfilename = settings.SURVEX_DATA + cave.survex_file diff --git a/docker/compose/mysql.env b/docker/compose/mysql.env new file mode 100644 index 0000000..9cebaa7 --- /dev/null +++ b/docker/compose/mysql.env @@ -0,0 +1,5 @@ +MYSQL_ROOT_PASSWORD=expo123 +MYSQL_DATABASE=troggle +MYSQL_USER=troggleuser +MYSQL_PASSWORD=expo123 + diff --git a/docker/mysql.env b/docker/mysql.env new file mode 100644 index 0000000..9cebaa7 --- /dev/null +++ b/docker/mysql.env @@ -0,0 +1,5 @@ +MYSQL_ROOT_PASSWORD=expo123 +MYSQL_DATABASE=troggle +MYSQL_USER=troggleuser +MYSQL_PASSWORD=expo123 + diff --git a/templates/millenialcaves.html b/templates/millenialcaves.html new file mode 100644 index 0000000..7bc5942 --- /dev/null +++ b/templates/millenialcaves.html @@ -0,0 +1,39 @@ +{% extends "cavebase.html" %} +{% load wiki_markup %} + +{% block title %}Cave Index{% endblock %} + +{% block content %} + +

Cave Index

+ +

Notable caves

+ + +

1623

+ + +{% for cave in caves1623 %} + + + +{% endfor %} +
{% if cave.kataster_number %}{{ cave.kataster_number }}{% else %}{{cave.unofficial_number }}{%endif %} {{cave.official_name|safe}}
+ +

1626

+ + + +New Cave + +{% endblock %} diff --git a/urls.py b/urls.py index 77b2bd2..f3fd9bd 100644 --- a/urls.py +++ b/urls.py @@ -16,11 +16,14 @@ admin.autodiscover() # type url probably means it's used. actualurlpatterns = patterns('', + + url(r'^millenialcaves/?$', views_caves.millenialcaves, name="millenialcaves"), #Radost's dev area + url(r'^troggle$', views_other.frontpage, name="frontpage"), url(r'^todo/$', views_other.todo, name="todo"), - url(r'^caves/?$', views_caves.caveindex, name="caveindex"), + url(r'^caves/?$', views_caves.caveindex, name="caveindex"), url(r'^people/?$', views_logbooks.personindex, name="personindex"), url(r'^newqmnumber/?$', views_other.ajax_QM_number, ),