mirror of
https://github.com/redlib-org/redlib.git
synced 2025-05-14 05:52:53 +00:00
Display sub list from list in cookie.
Very basic sub list setup. Cookie must be manually added in devtools.
This commit is contained in:
parent
49a6168607
commit
75bbcefbec
10 changed files with 95 additions and 2 deletions
|
@ -26,6 +26,10 @@
|
|||
{% block search %}{% endblock %}
|
||||
<a id="code" href="https://github.com/spikecodes/libreddit">code</a>
|
||||
</nav>
|
||||
|
||||
<!-- SUBSCRIBED SUBREDDITS -->
|
||||
{% block sub_list %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- MAIN CONTENT -->
|
||||
{% block body %}
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
<meta name="author" content="u/{{ post.author.name }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block sub_list %}
|
||||
{% call utils::sub_list(post.community.as_str()) %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- OPEN COMMENT MACRO -->
|
||||
{% macro comment(item) -%}
|
||||
<div id="{{ item.id }}" class="comment">
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
{% block title %}Libreddit: search results - {{ params.q }}{% endblock %}
|
||||
|
||||
{% block sub_list %}
|
||||
{% call utils::sub_list("") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="column_one">
|
||||
<form id="search_sort">
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
{% call utils::search("".to_owned(), "", "") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block sub_list %}
|
||||
{% call utils::sub_list("") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form id="settings" action="/settings" method="POST">
|
||||
<div id="prefs">
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
{% call utils::search(["/r/", sub.name.as_str()].concat(), "") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block sub_list %}
|
||||
{% call utils::sub_list(sub.name.as_str()) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<main>
|
||||
<div id="column_one">
|
||||
|
@ -121,6 +125,13 @@
|
|||
<div>{{ sub.members }}</div>
|
||||
<div>{{ sub.active }}</div>
|
||||
</div>
|
||||
<div id="sub_subscription">
|
||||
{% if prefs.subs.contains(sub.name) %}
|
||||
<a class="subscribe remove">Unsubscribe</a>
|
||||
{% else %}
|
||||
<a class="subscribe add">Subscribe</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<details class="panel" id="sidebar">
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
|
||||
{% block title %}{{ user.name.replace("u/", "") }} (u/{{ user.name }}) - Libreddit{% endblock %}
|
||||
|
||||
{% block sub_list %}
|
||||
{% call utils::sub_list("") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<main>
|
||||
<div id="column_one">
|
||||
|
|
|
@ -39,3 +39,15 @@
|
|||
{% else if flair_part.flair_part_type == "text" %}<span>{{ flair_part.value }}</span>{% endif %}
|
||||
{% endfor %}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro sub_list(current) -%}
|
||||
{% if prefs.subs.len() > 0 %}
|
||||
<div id="sub_list">
|
||||
<div id="subs">
|
||||
{% for sub in prefs.subs %}
|
||||
<a href="/r/{{ sub }}" {% if sub == current %}class="selected"{% endif %}>{{ sub }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{%- endmacro %}
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
{% call utils::search(["/r/", sub.as_str()].concat(), "") %}
|
||||
{% endblock %}
|
||||
|
||||
{% block sub_list %}
|
||||
{% call utils::sub_list(sub.as_str()) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<main>
|
||||
<div class="panel" id="column_one">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue