Implement private option as hide until auth is added

This commit is contained in:
Tim Van Baak 2021-02-12 17:11:52 -08:00
parent a51a60c171
commit f626c86f8a
1 changed files with 8 additions and 2 deletions

View File

@ -38,22 +38,26 @@ window.onload = function () {
<div id="{{ tab.name }}-page" class="tab-page{% if selected %} tab-page-selected{% endif %}"> <div id="{{ tab.name }}-page" class="tab-page{% if selected %} tab-page-selected{% endif %}">
<table id="{{ tab.name }}-page-table" class="page-table"> <table id="{{ tab.name }}-page-table" class="page-table">
{% for tag in tab.tags %} {% for tag in tab.tags %}
{%- if not tag.options.private -%}
<tr {% if tab.options.hide_names %}class="hide-tag-name"{% endif %}> <tr {% if tab.options.hide_names %}class="hide-tag-name"{% endif %}>
<td>{{ tag.name }}</td> <td>{{ tag.name }}</td>
<td>{{ make_tag_value(tag) }}</td> <td>{{ make_tag_value(tag) }}</td>
</tr> </tr>
{%- endif -%}
{% for subtag in tag.subtags %} {% for subtag in tag.subtags %}
{%- if not tag.options.private and not subtag.options.private -%}
<tr {% if tab.options.hide_names %}class="hide-tag-name"{% endif %}> <tr {% if tab.options.hide_names %}class="hide-tag-name"{% endif %}>
<td>{% if loop.last %}&#9492;{% else %}&#9500;{% endif %} {{ subtag.name }}</td> <td>{% if loop.last %}&#9492;{% else %}&#9500;{% endif %} {{ subtag.name }}</td>
<td>{{ make_tag_value(subtag) }}</td> <td>{{ make_tag_value(subtag) }}</td>
</tr> </tr>
{%- endif -%}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
{% endmacro %} {% endmacro %}
{# TODO: tag.interlink and tag.private support #} {# TODO: tag.interlink #}
{% macro make_tag_value(tag) -%} {% macro make_tag_value(tag) -%}
{%- if tag.options.hyperlink -%} {%- if tag.options.hyperlink -%}
<a href="{{ tag.value }}">{{ tag.value }}</a> <a href="{{ tag.value }}">{{ tag.value }}</a>
@ -62,11 +66,13 @@ window.onload = function () {
{%- endif -%} {%- endif -%}
{%- endmacro %} {%- endmacro %}
{# TODO: tab.priority and tab.private support #} {# TODO: tab.priority support #}
{% block page_content %} {% block page_content %}
<div id="tabs"> <div id="tabs">
{%- for tab in document -%} {%- for tab in document -%}
{%- if not tab.options.private -%}
{{ make_content_tab(tab, loop.first) }} {{ make_content_tab(tab, loop.first) }}
{%- endif -%}
{%- endfor -%} {%- endfor -%}
{%- if not index -%} {%- if not index -%}
<div id="index" class="tab tab-right"><a href="/index/">index</a></div> <div id="index" class="tab tab-right"><a href="/index/">index</a></div>