adding DM view options

This commit is contained in:
evilchili
2022-08-07 11:57:35 -07:00
parent 4f010ba507
commit 5edf5f2283
7 changed files with 40 additions and 21 deletions
@@ -837,3 +837,7 @@ a.disabled:hover {
-o-transform:skew(8deg) rotate(3deg);
transform:skew(8deg) rotate(3deg);
}
.dm {
display: none !important;
}
@@ -11,6 +11,10 @@
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{% endblock head %}
{% block extrahead %}{% endblock %}
{% if is_dm %}
<style type="text/css">.dm { display: block !important; }</style>
{% endif %}
</head>
<body id="index" class="archive">
@@ -46,4 +50,5 @@
</footer><!-- /#contentinfo -->
</div>
</body>
{% block is_dm %}{{ ' ' if 'localhost' in SITEURL else '' }}{% endblock %}
</html>
+16 -16
View File
@@ -1,26 +1,26 @@
{% macro key_image(ref) %}
{% if ref.key_image %}
<a class='key_image' href="{{ ref.key_image.src }}">
<img src="{{ ref.key_image.src|replace('.','_thumb.') }}" alt="{{ ref.key_image.alt}}">
</a>
{% endif %}
{% if ref.key_image %}
<a class='key_image' href="{{ ref.key_image.src }}">
<img src="{{ ref.key_image.src|replace('.','_thumb.') }}" alt="{{ ref.key_image.alt}}">
</a>
{% endif %}
{% endmacro %}
{% macro list_to_cols(l, headers) %}
{% macro table(t, headers=[]) %}
<table>
<tr>{% for h in headers %}{% if h %}<th>{{ h }}</th>{% endif %}{% endfor %}</tr>
{% for key in t %}
<tr><td>{{ key }}</td>{{ _list_to_cols(t[key], headers) }}</tr>
{% endfor %}
</table>
{% endmacro %}
{% macro _list_to_cols(l, headers) %}
{% if l is mapping %}
{% for key in l if key in headers%}
{{ list_to_cols(l[key], headers) }}
{{ _list_to_cols(l[key], headers) }}
{% endfor %}
{% elif l %}
<td>{{ l }}</td>
{% endif %}
{% endmacro %}
{% macro table(t, headers=[]) %}
<table>
<tr>{% for h in headers %}{% if h %}<th>{{ h }}</th>{% endif %}{% endfor %}</tr>
{% for key in t %}
<tr><td>{{ key }}</td>{{ list_to_cols(t[key], headers) }}</tr>
{% endfor %}
</table>
{% endmacro %}
@@ -20,12 +20,13 @@
{{ article.content }}
{% set target = article.title.replace(' ', '_') %}
{% if self.is_dm() %}
<div class='statblock'>
<div style='cursor: pointer;'
onclick="document.getElementById('{{target}}').style.display=((document.getElementById('{{ target }}').style.display=='none')?'':'none');" ><h3>{{ article.title }}</h3></div>
<div id="{{ target }}" style='display:none;'>
<div class='read'>
{{ r.description }}
{{ r.dm_notes }}
</div>
<dl>
<dt>Size</dt><dd>{{ r.size }} sq. miles </dd>
@@ -37,6 +38,7 @@
</dl>
</div>
</div>
{% endif %}
<hr>
{% include "bottom-nav.html" %}
</div>