aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-08-01 19:10:30 +0100
committerMatthew Lemon <y@yulqen.org>2024-08-02 14:24:42 +0100
commit27576670437e9edd139bae93efc5bd9577f83e35 (patch)
tree7e28ff29ba6bef3f0f06e02c6f5da25c7463c31a
parent2949dc4a515e1bc07afc4f7ffd8747f01e1a6ebf (diff)
wip: trying to fix fucked divs on index page
More to come - going to have to redo all the HTML on this page.
-rw-r--r--pyblackbird_cc/templates/resources/resource_list.html279
1 files changed, 140 insertions, 139 deletions
diff --git a/pyblackbird_cc/templates/resources/resource_list.html b/pyblackbird_cc/templates/resources/resource_list.html
index d60ac61..2f137e0 100644
--- a/pyblackbird_cc/templates/resources/resource_list.html
+++ b/pyblackbird_cc/templates/resources/resource_list.html
@@ -4,157 +4,158 @@
{% load markdown_extras %}
{% block title %}
- Joanna Lemon Learning - Resource List
+ Joanna Lemon Learning - Resource List
{% endblock title %}
{% block content %}
- {# admin block #}
- {% if request.user.is_authenticated and request.user.is_staff %}
- <div class="row bg-white p-4 rounded border border-success border-opacity-25">
- <h5 class="text-decoration-underline">Admin bar</h5>
- <p>
- Only you will see this bar - normal users will not see it. It allows us to
- include buttons for adding new resources, etc.
- </p>
- <div class="col">
- <div class="d-flex flex-row flex-wrap justify-content-between">
- <div>
- <a class="btn btn-primary my-md-2"
- href="{% url 'resources:create_resource' %} ">Add a new resource</a>
- </div>
- <div class="bg-danger p-2 my-2 text-dark bg-white border border-1 border-danger">
- Logged in as
- <strong>{{ request.user.email }}</strong>
- </div>
- <div class="my-md-2">
- <form action="{% url 'account_logout' %}" method="post">
- {% csrf_token %}
- <button type="submit" class="btn btn-primary">Log out</button>
- </form>
- </div>
- </div>
- </div>
+ {# admin block #}
+ {% if request.user.is_authenticated and request.user.is_staff %}
+ <div class="row bg-white p-4 rounded border border-success border-opacity-25">
+ <h5 class="text-decoration-underline">Admin bar</h5>
+ <p>
+ Only you will see this bar - normal users will not see it. It allows us to
+ include buttons for adding new resources, etc.
+ </p>
+ <div class="col">
+ <div class="d-flex flex-row flex-wrap justify-content-between">
+ <div>
+ <a class="btn btn-primary my-md-2"
+ href="{% url 'resources:create_resource' %} ">Add a new resource</a>
+ </div>
+ <div class="bg-danger p-2 my-2 text-dark bg-white border border-1 border-danger">
+ Logged in as
+ <strong>{{ request.user.email }}</strong>
+ </div>
+ <div class="my-md-2">
+ <form action="{% url 'account_logout' %}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-primary">Log out</button>
+ </form>
+ </div>
</div>
- {% endif %}
+ </div>
+ </div>
+ {% endif %}
- {# featured resources#}
- <div class="row my-4">
- <div class="col">
- {% if featured_resources %}
- <div class="row my-4 text-center">
- <div class="col">
- <h5 class="display-6">Featured resources</h5>
- </div>
- </div>
- <div class="d-flex flex-row justify-content-between flex-wrap">
- {% for resource in featured_resources %}
- {% if featured_resources|length == 1 %}
- <div class="col-lg-12 col-md-12 col-sm-12 mb-4">
- {% elif featured_resources|length == 2 %}
- <div class="col-lg-6 col-md-6 col-sm-12 mb-4">
+ {# featured resources#}
+ <div class="row my-4">
+ <div class="col">
+ {% if featured_resources %}
+ <div class="row my-4 text-center">
+ <div class="col">
+ <h5 class="display-6">Featured resources</h5>
+ </div>
+ </div>
+ <div class="d-flex flex-row justify-content-between flex-wrap">
+ {% for resource in featured_resources %}
+ {% if featured_resources|length == 1 %}
+ <div class="col-lg-12 col-md-12 col-sm-12 mb-4">
+ {% elif featured_resources|length == 2 %}
+ <div class="col-lg-6 col-md-6 col-sm-12 mb-4">
+ {% else %}
+ <div class="col-lg-4 col-md-6 col-sm-12 mb-4">
+ {% endif %}
+ <div class="card mx-2 mt-2 shadow-sm h-100"
+ style="border-color: {{ resource.main_resource_category_colour_css_class }}; border-width: 5px;">
+ <img class="card-img-top"
+ src="{{ resource.thumbnail_urls|first }}"
+ alt="{{ resource.thumbnail_filename }}"/>
+ <div class="card-body">
+ <h5 class="card-title"><a
+ href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a></h5>
+ <div class="d-flex flex-row justify-content-start align-content-center">
+ <div>
+ {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %}
+ <span class="badge me-2"
+ style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span>
{% else %}
- <div class="col-lg-4 col-md-6 col-sm-12 mb-4">
+ <span class="badge me-2"
+ style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span>
{% endif %}
- <div class="card mx-2 mt-2 shadow-sm h-100"
- style="border-color: {{ resource.main_resource_category_colour_css_class }}; border-width: 5px;">
- <img class="card-img-top"
- src="{{ resource.thumbnail_urls|first }}"
- alt="{{ resource.thumbnail_filename }}"/>
- <div class="card-body">
- <h5 class="card-title"><a
- href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a>
- </h5>
- <div class="d-flex flex-row justify-content-start align-content-center">
- <div>
- {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %}
- <span class="badge me-2"
- style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span>
- {% else %}
- <span class="badge me-2"
- style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span>
- {% endif %}
- </div>
- <div>
- <span class="badge bg-secondary me-2">{{ resource.age_range }}</span>
- </div>
- {% if request.user.is_authenticated and request.user.is_staff %}
- <div>
- <span class="badge bg-info me-2">Feature slot: {{ resource.feature_slot }}</span>
- </div>
- {% endif %}
- </div>
- {% if resource.card_description %}
- <p class="card-text my-3">{{ resource.card_description | markdown | safe }}</p>
- {% else %}
- <p class="card-text my-3">{{ resource.description | markdown | safe }}</p>
- {% endif %}
- </div>
- {% if request.user.is_authenticated and request.user.is_staff %}
- <div class="card-footer">
- <a href="{% url "resources:resource_update_metadata" resource.id %}"
- class="btn btn-outline-primary btn-sm">Edit</a>
- {% endif %}
- </div>
+ </div>
+ <div>
+ <span class="badge bg-secondary me-2">{{ resource.age_range }}</span>
+ </div>
+ {% if request.user.is_authenticated and request.user.is_staff %}
+ <div>
+ <span class="badge bg-info me-2">Feature slot: {{ resource.feature_slot }}</span>
</div>
- {% endfor %}
- {% else %}
- <p>There are no featured resources</p>
- {% endif %}
+ {% endif %}
+ </div>
+ {% if resource.card_description %}
+ <p class="card-text my-3">{{ resource.card_description | markdown | safe }}</p>
+ {% else %}
+ <p class="card-text my-3">{{ resource.description | markdown | safe }}</p>
+ {% endif %}
+ </div>
+ {% if request.user.is_authenticated and request.user.is_staff %}
+ <div class="card-footer">
+ <a href="{% url "resources:resource_update_metadata" resource.id %}"
+ class="btn btn-outline-primary btn-sm">Edit</a>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ {% else %}
+ <p>There are no featured resources</p>
+ {% endif %}
+</div>
</div>
- {# standard resources #}
- <div class="d-flex flex-row justify-content-between flex-wrap">
+{# standard resources #}
+<div class="d-flex flex-row justify-content-between flex-wrap">
+ <div class="col">
+ {% if resource_list %}
+ <div class="row my-4 text-center">
<div class="col">
- {% if resource_list %}
- <div class="row my-4 text-center">
- <div class="col">
- <h5 class="display-6">Standard resources</h5>
- </div>
+ <h5 class="display-6">Standard resources</h5>
+ </div>
+ </div>
+ <div class="d-flex flex-row justify-content-start flex-wrap">
+ {% for resource in resource_list %}
+ {# <div class="card mx-4 mt-4 border border-width-1" style="width: 17rem;">#}
+ <div class="card mx-2 mt-2 shadow-sm border-width-1"
+ style="width: 19rem; border-color: {{ resource.main_resource_category_colour_css_class }}; border-width: 4px;">
+ <img class="card-img-top"
+ src="{{ resource.thumbnail_urls|first }}"
+ alt="{{ resource.thumbnail_filename }}"/>
+ <div class="card-body">
+ <h5 class="card-title"><a
+ href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a></h5>
+ <div class="d-flex flex-row justify-content-start align-content-center">
+ <div>
+ {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %}
+ <span class="badge me-2"
+ style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span>
+ {% else %}
+ <span class="badge me-2"
+ style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span>
+ {% endif %}
</div>
- <div class="d-flex flex-row justify-content-start flex-wrap">
- {% for resource in resource_list %}
- {# <div class="card mx-4 mt-4 border border-width-1" style="width: 17rem;">#}
- <div class="card mx-2 mt-2 shadow-sm border-width-1"
- style="width: 19rem; border-color: {{ resource.main_resource_category_colour_css_class }}; border-width: 4px;">
- <img class="card-img-top"
- src="{{ resource.thumbnail_urls|first }}"
- alt="{{ resource.thumbnail_filename }}"/>
- <div class="card-body">
- <h5 class="card-title"><a
- href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a>
- </h5>
- <div class="d-flex flex-row justify-content-start align-content-center">
- <div>
- {% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %}
- <span class="badge me-2"
- style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span>
- {% else %}
- <span class="badge me-2"
- style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span>
- {% endif %}
- </div>
- <div>
- <span class="badge bg-secondary me-2">{{ resource.age_range }}</span>
- </div>
- </div>
- {% if resource.card_description %}
- <p class="card-text my-3">{{ resource.card_description | markdown | safe }}</p>
- {% else %}
- <p class="card-text my-3">{{ resource.description | markdown | safe }}</p>
- {% endif %}
- </div>
- {% if request.user.is_authenticated and request.user.is_staff %}
- <div class="card-footer">
- <a href="{% url "resources:resource_update_metadata" resource.id %}"
- class="btn btn-outline-primary btn-sm">Edit</a>
- {% endif %}
- </div>
- {% endfor %}
- </div>
+ <div>
+ <span class="badge bg-secondary me-2">{{ resource.age_range }}</span>
</div>
- {% else %}
- <p>There are no resources</p>
+ </div>
+ {% if resource.card_description %}
+ <p class="card-text my-3">{{ resource.card_description | markdown | safe }}</p>
+ {% else %}
+ <p class="card-text my-3">{{ resource.description | markdown | safe }}</p>
+ {% endif %}
+ </div>
+ {% if request.user.is_authenticated and request.user.is_staff %}
+ <div class="card-footer">
+ <a href="{% url "resources:resource_update_metadata" resource.id %}"
+ class="btn btn-outline-primary btn-sm">Edit</a>
{% endif %}
- </div>
- </div>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ {% else %}
+ <p>There are no resources</p>
+ {% endif %}
+</div>
+</div>
{% endblock content %}