created basic link list template
parent
242235cf69
commit
31ee32097f
|
|
@ -0,0 +1,48 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
{% if object_list %}
|
||||
{# <div class="text-center">#}
|
||||
{# <p class="text-lg font-semibold">Filter by category group:</p>#}
|
||||
{# <a class="font-mono" href="{% url 'links:list' %}">All</a>#}
|
||||
{# {% for cat in category_groups %}#}
|
||||
{# •#}
|
||||
{# <a class="font-mono" href="{% url 'links:list_category' category=cat %}">{{ cat.title }}</a>#}
|
||||
{# {% endfor %}#}
|
||||
{# </div>#}
|
||||
{# <hr class="mx-8">#}
|
||||
<div class="grid gap-12 grid-cols-1 md:grid-cols-2 lg:grid-cols-3 m-8">
|
||||
{% for cat in object_list %}
|
||||
<div class="pb-8 break-inside-avoid-column">
|
||||
<h5 class="text-3xl font-semibold">{{ cat.title }}</h5>
|
||||
<hr class="my-2">
|
||||
{% for subcat in cat.children.all %}
|
||||
<div>
|
||||
<h6 class="text-2xl italic">{{ subcat.title }}</h6>
|
||||
<hr class="my-2">
|
||||
{% for link in subcat.links.all %}
|
||||
<div class="mb-4">
|
||||
<a class="text-xl font-semibold hover:text-red-400" href="{% url 'links:open_link' title=link.title %}" target="_blank">{{ link.title }}</a>
|
||||
{% if link.introduction %}
|
||||
<p class="text-justify">{{ link.introduction|linebreaksbr }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="text-center m-8">
|
||||
<h3 class="text-4xl mb-4">Oh No!</h3>
|
||||
<h5 class="text-lg">I haven't added any links yet.</h5>
|
||||
<p class="text-neutral-400">(sorry not sorry)</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if page_obj.has_previous or page_obj.has_next %}
|
||||
{% include 'pagination.html' %}
|
||||
{% endif %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
Loading…
Reference in New Issue