Rename block sub_list > subscriptions

This commit is contained in:
Matthew Crossman 2021-01-30 19:47:30 +11:00
parent 11e4ff42ed
commit ef5a1cd66e
No known key found for this signature in database
GPG Key ID: C6B942B019794CC2
8 changed files with 10 additions and 11 deletions

View File

@ -23,13 +23,11 @@
<span id="version">v{{ env!("CARGO_PKG_VERSION") }}</span> <span id="version">v{{ env!("CARGO_PKG_VERSION") }}</span>
<a id="settings_link" href="/settings">settings</a> <a id="settings_link" href="/settings">settings</a>
</p> </p>
{% block subscriptions %}{% endblock %}
{% block search %}{% endblock %} {% block search %}{% endblock %}
<a id="code" href="https://github.com/spikecodes/libreddit">code</a> <a id="code" href="https://github.com/spikecodes/libreddit">code</a>
</nav> </nav>
{% block sub_list %}
{% endblock %}
<!-- MAIN CONTENT --> <!-- MAIN CONTENT -->
{% block body %} {% block body %}
<main> <main>

View File

@ -13,7 +13,7 @@
<meta name="author" content="u/{{ post.author.name }}"> <meta name="author" content="u/{{ post.author.name }}">
{% endblock %} {% endblock %}
{% block sub_list %} {% block subscriptions %}
{% call utils::sub_list(post.community.as_str()) %} {% call utils::sub_list(post.community.as_str()) %}
{% endblock %} {% endblock %}

View File

@ -3,7 +3,7 @@
{% block title %}Libreddit: search results - {{ params.q }}{% endblock %} {% block title %}Libreddit: search results - {{ params.q }}{% endblock %}
{% block sub_list %} {% block subscriptions %}
{% call utils::sub_list("") %} {% call utils::sub_list("") %}
{% endblock %} {% endblock %}

View File

@ -7,7 +7,7 @@
{% call utils::search("".to_owned(), "", "") %} {% call utils::search("".to_owned(), "", "") %}
{% endblock %} {% endblock %}
{% block sub_list %} {% block subscriptions %}
{% call utils::sub_list("") %} {% call utils::sub_list("") %}
{% endblock %} {% endblock %}

View File

@ -11,7 +11,7 @@
{% call utils::search(["/r/", sub.name.as_str()].concat(), "") %} {% call utils::search(["/r/", sub.name.as_str()].concat(), "") %}
{% endblock %} {% endblock %}
{% block sub_list %} {% block subscriptions %}
{% call utils::sub_list(sub.name.as_str()) %} {% call utils::sub_list(sub.name.as_str()) %}
{% endblock %} {% endblock %}

View File

@ -7,7 +7,7 @@
{% block title %}{{ user.name.replace("u/", "") }} (u/{{ user.name }}) - Libreddit{% endblock %} {% block title %}{{ user.name.replace("u/", "") }} (u/{{ user.name }}) - Libreddit{% endblock %}
{% block sub_list %} {% block subscriptions %}
{% call utils::sub_list("") %} {% call utils::sub_list("") %}
{% endblock %} {% endblock %}

View File

@ -42,12 +42,13 @@
{% macro sub_list(current) -%} {% macro sub_list(current) -%}
{% if prefs.subs.len() > 0 %} {% if prefs.subs.len() > 0 %}
<div id="subscriptions"> <details id="subscriptions">
<summary>subscribed</summary>
<div id="sub_list"> <div id="sub_list">
{% for sub in prefs.subs %} {% for sub in prefs.subs %}
<a href="/r/{{ sub }}" {% if sub == current %}class="selected"{% endif %}>{{ sub }}</a> <a href="/r/{{ sub }}" {% if sub == current %}class="selected"{% endif %}>{{ sub }}</a>
{% endfor %} {% endfor %}
</div> </div>
</div> </details>
{% endif %} {% endif %}
{%- endmacro %} {%- endmacro %}

View File

@ -10,7 +10,7 @@
{% call utils::search(["/r/", sub.as_str()].concat(), "") %} {% call utils::search(["/r/", sub.as_str()].concat(), "") %}
{% endblock %} {% endblock %}
{% block sub_list %} {% block subscriptions %}
{% call utils::sub_list(sub.as_str()) %} {% call utils::sub_list(sub.as_str()) %}
{% endblock %} {% endblock %}