diff options
author | expo <expo@expobox.potato.hut> | 2016-07-02 23:42:47 +0100 |
---|---|---|
committer | expo <expo@expobox.potato.hut> | 2016-07-02 23:42:47 +0100 |
commit | 0239800ff15ce871c8efc7cb7c785d4b8113f7c3 (patch) | |
tree | 4ab54161c9b73d155de0a1138579be2ceaecc633 | |
parent | 4320e7629813aef22a8778b12efdb593687542da (diff) | |
download | troggle-0239800ff15ce871c8efc7cb7c785d4b8113f7c3.tar.gz troggle-0239800ff15ce871c8efc7cb7c785d4b8113f7c3.tar.bz2 troggle-0239800ff15ce871c8efc7cb7c785d4b8113f7c3.zip |
Fix cave pages to have entrances and description on one page.
Fixes broken links on description and entrance pages.
Removes need for jquery-ui.
-rw-r--r-- | core/views_caves.py | 1 | ||||
-rw-r--r-- | templates/cave.html | 121 |
2 files changed, 112 insertions, 10 deletions
diff --git a/core/views_caves.py b/core/views_caves.py index e3df0b3..2dcef5e 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -78,6 +78,7 @@ def caveDescription(request, slug): return render_with_context(request,'nonpublic.html', {'instance': cave}) else: return render_with_context(request,'cave_uground_description.html', {'cave': cave}) + def caveQMs(request, slug): cave = Cave.objects.get(caveslug__slug = slug) if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated(): diff --git a/templates/cave.html b/templates/cave.html index f38f66d..5bd77f6 100644 --- a/templates/cave.html +++ b/templates/cave.html @@ -1,5 +1,6 @@ {% extends "cavebase.html" %} +{% load wiki_markup %} {% block content %} {% block contentheader %} <table id="cavepage"> @@ -26,17 +27,117 @@ {% block related %} {% endblock %}{% endblock %} -<div id="tabs"> - <ul> - <li><a href="/cave/description/{{cave.slug}}">Description</a></li> - <li><a href="/cave/entrance/{{cave.slug}}">Entrances</a></li> - <li><a href="/cave/logbook/{{cave.slug}}">Logbook</a></li> - <li><a href="/cave/qms/{{cave.slug}}">QMs</a></li> - </ul> - <div id="qms"> +<div id="entrances"> + <p>{% if cave.entrances %} + <h2>Entrances</h2> + <ul> + {% for ent in cave.entrances %} + <li> + {{ ent.entrance_letter|safe }} + {% if ent.entrance.name %} + {{ ent.entrance.name|safe }} + {% endif %}<a href="{% url editentrance cave.slug ent.entrance.slug %}">Edit</a> + <dl> + {% if ent.entrance.marking %} + <dt>Marking</dt><dd>{{ ent.entrance.marking_val|safe }}</dd> + {% endif %} + {% if ent.entrance.marking_comment %} + <dt>Marking Comment</dt><dd>{{ ent.entrance.marking_comment|safe }}</dd> + {% endif %} + {% if ent.entrance.findability %} + <dt>Findability</dt><dd>{{ ent.entrance.findability_val|safe }}</dd> + {% endif %} + {% if ent.entrance.findability_comment %} + <dt>Findability Comment</dt><dd>{{ ent.entrance.findability_comment|safe }}</dd> + {% endif %} + {% if ent.entrance.location_description %} + <dt>Location</dt><dd>{{ ent.entrance.location_description|safe }}</dd> + {% endif %} + {% if ent.entrance.approach %} + <dt>Approach</dt><dd>{{ ent.entrance.approach|safe }}</dd> + {% endif %} + {% if ent.entrance.map_description %} + <dt>Map</dt><dd>{{ ent.entrance.map_description|safe }}</dd> + {% endif %} + {% if ent.entrance.underground_description %} + <dt>Underground</dt><dd>{{ ent.entrance.underground_description|safe }}</dd> + {% endif %} + {% if ent.entrance.photo %} + <dt>Photo</dt><dd>{{ ent.entrance.photo|safe }}</dd> + {% endif %} + {% if ent.entrance.entrance_description %} + <dt>Description</dt><dd>{{ ent.entrance.entrance_description|safe }}</dd> + {% endif %} + {% if ent.entrance.explorers %} + <dt>Explorers</dt><dd>{{ ent.entrance.explorers|safe }}</dd> + {% endif %} + {% if ent.entrance.northing %} + <dt>Location</dt><dd>{{ ent.entrance.northing|safe }}, {{ ent.entrance.easting|safe }}, {{ ent.entrance.alt|safe }}m</dd> + {% endif %} + {% if ent.entrance.tag_station %} + <dt>Tag Location</dt><dd>{{ ent.entrance.tag_station }} {{ ent.entrance.tag.y|safe }}, {{ ent.entrance.tag.x|safe }}, {{ ent.entrance.tag.z|safe }}m</dd> + {% endif %} + {% if ent.entrance.bearings %} + <dt>Bearings</dt><dd>{{ ent.entrance.bearings|safe }}</dd> + {% endif %} + {% if ent.entrance.exact_station %} + <dt>Exact Station</dt><dd>{{ ent.entrance.exact_station|safe }} {{ ent.entrance.exact_location.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m</dd> + {% endif %} + {% if ent.entrance.other_station %} + <dt>Other Station</dt><dd>{{ ent.entrance.other_station|safe }} + {% if ent.entrance.other_description %} + - {{ ent.entrance.other_description|safe }} + {% endif %} {{ ent.entrance.other_location.y|safe }}, {{ ent.entrance.other_location.x|safe }}, {{ ent.entrance.other_location.z|safe }}m + </dd> + {% endif %} + </dl> + </li> + {% endfor %} + </ul> - </div> +{% endif %}</p> +<a href="{% url newentrance cave.slug %}">New Entrance</a> </div> +<div id="Description"> + +<p>{% if cave.explorers %} + <h2>Explorers</h2> + {{ cave.explorers|safe }} +{% endif %} +{% if cave.underground_description %} + <h2>Underground Description</h2> + {{ cave.underground_description|safe }} +{% endif %} +{% if cave.equipment %} + <h2>Equipment</h2> + {{ cave.equipment|safe }} +{% endif %} +{% if cave.references %} + <h2>References</h2> + {{ cave.references|safe }} +{% endif %} +{% if cave.survey %} + <h2>Survey</h2> + {{ cave.survey|safe }} +{% endif %} +{% if cave.kataster_status %} + <h2>Kataster_status</h2> + {{ cave.kataster_status|safe }} +{% endif %} +{% if cave.underground_centre_line %} + <h2>Underground Centre Line</h2> + {{ cave.underground_centre_line|safe }} +{% endif %} +{% if cave.survex_file %} + <h2>Survex File</h2> + {{ cave.survex_file|safe }} +{% endif %} +{% if cave.notes %} + <h2>Notes</h2> + {{ cave.notes|safe }} +{% endif %}</p> + +</div> -{% endblock %} +{% endblock content %} |