diff options
Diffstat (limited to 'pyblackbird_cc/templates')
5 files changed, 170 insertions, 35 deletions
diff --git a/pyblackbird_cc/templates/base.html b/pyblackbird_cc/templates/base.html index 1eb9966..ce0a4ca 100644 --- a/pyblackbird_cc/templates/base.html +++ b/pyblackbird_cc/templates/base.html @@ -18,27 +18,27 @@ {% block extra_css %} {% endblock extra_css %} {% block css %} - <!-- Latest compiled and minified Bootstrap CSS --> - {# <link rel="stylesheet"#} - {# href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css"#} - {# integrity="sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA=="#} - {# crossorigin="anonymous"#} - {# referrerpolicy="no-referrer" />#} + <!--Latest compiled and minified Bootstrap CSS --> + <link rel="stylesheet" + href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css" + integrity="sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA==" + crossorigin="anonymous" + referrerpolicy="no-referrer" /> <!-- Your stuff: Third-party CSS libraries go here --> <!-- This file stores project-specific CSS --> - <!-- <link href="{% static 'css/project.css' %}" rel="stylesheet" /> --> - <link rel="stylesheet" href="{% static "css/wrapper.css" %}" type="text/css" media="screen" charset="utf-8" /> + <link href="{% static 'css/project.css' %}" rel="stylesheet" /> + {# <link rel="stylesheet" href="{% static "css/wrapper.css" %}" type="text/css" media="screen" charset="utf-8" />#} {% endblock css %} <!-- Le javascript - ================================================== --> + ================================================== --> {# Placed at the top of the document so pages load faster with defer #} {% block javascript %} <!-- Bootstrap JS --> - {#<script defer#} - {# src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.min.js"#} - {# integrity="sha512-1/RvZTcCDEUjY/CypiMz+iqqtaoQfAITmNSJY17Myp4Ms5mdxPS5UV7iOfdZoxcGhzFbOm6sntTKJppjvuhg4g=="#} - {# crossorigin="anonymous"#} - {# referrerpolicy="no-referrer"></script>#} + <script defer + src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.min.js" + integrity="sha512-1/RvZTcCDEUjY/CypiMz+iqqtaoQfAITmNSJY17Myp4Ms5mdxPS5UV7iOfdZoxcGhzFbOm6sntTKJppjvuhg4g==" + crossorigin="anonymous" + referrerpolicy="no-referrer"></script> <!-- Your stuff: Third-party javascript libraries go here --> <!-- place project specific Javascript in this file --> <script defer src="{% static 'js/project.js' %}"></script> @@ -47,32 +47,32 @@ </head> <body> <header> - <div class="inner-header"> + <div class="container text-center"> <div> </div> - <div class="info"> - <h1>Joanna Lemon Learning</h1> - <p> - Experienced primary school teacher, dedicated to creating colourful and - clear educational learning resources. - </p> + <div class="row"> + <div class="col"> + <h1>Joanna Lemon Learning</h1> + <p> + Experienced primary school teacher, dedicated to creating colourful and + clear educational learning resources. + </p> + </div> </div> - <div> </div> - <div> </div> - <div class="info"> + <div class="row"> <p> For information: please contact <a href="mailto:joanna@joannalemon.com">joanna@joannalemon.com</a> </p> - <div class="jumplist"> - <div align="center"> - <a href="https://www.tes.com/teaching-resources/shop/joannalemon" - target="_blank">TES Shop</a> - </div> - <div align="center"> - <a href="https://joannalemon.etsy.com/" target="_blank">Etsy</a> - </div> - <div align="center"> - <a href="https://blog.joannalemon.com" target="_blank">Blog</a> - </div> + </div> + <div class="row"> + <div class="col"> + <a href="https://www.tes.com/teaching-resources/shop/joannalemon" + target="_blank">TES Shop</a> + </div> + <div class="col"> + <a href="https://joannalemon.etsy.com/" target="_blank">Etsy</a> + </div> + <div class="col"> + <a href="https://blog.joannalemon.com" target="_blank">Blog</a> </div> </div> </div> diff --git a/pyblackbird_cc/templates/resources/hx_download_button.html b/pyblackbird_cc/templates/resources/hx_download_button.html new file mode 100644 index 0000000..1c956a5 --- /dev/null +++ b/pyblackbird_cc/templates/resources/hx_download_button.html @@ -0,0 +1,3 @@ +<p> + <a href="{{ pdf_url }}">Download the resource</a> +</p> diff --git a/pyblackbird_cc/templates/resources/resource_create.html b/pyblackbird_cc/templates/resources/resource_create.html new file mode 100644 index 0000000..03a192a --- /dev/null +++ b/pyblackbird_cc/templates/resources/resource_create.html @@ -0,0 +1,21 @@ +{% extends "base.html" %} + +{% load static %} +{% load crispy_forms_tags %} + +{# {% block extra_css %}#} +{# <link rel="stylesheet" href="{% static 'css/forms.css' %}">#} +{# {% endblock %}#} +{% block content %} + <div class="container"> + <h2>Upload a new resource</h2> + <p>{% lorem %}</p> + <form action="{% url 'resources:create_resource' %}" + method="post" + enctype="multipart/form-data"> + {% csrf_token %} + {{ form|crispy }} + <input type="submit" class="btn btn-primary" value="Upload" /> + </form> + </div> +{% endblock content %} diff --git a/pyblackbird_cc/templates/resources/resource_detail.html b/pyblackbird_cc/templates/resources/resource_detail.html new file mode 100644 index 0000000..61d9265 --- /dev/null +++ b/pyblackbird_cc/templates/resources/resource_detail.html @@ -0,0 +1,50 @@ +{% extends 'base.html' %} + +{% block content %} + <div class="resource-metadata-panel"> + <div> + <h1 class="resource-title">{{ resource.name }}</h1> + </div> + <div class="resource-details"> + <div>Subject: {{ resource.main_resource_category }}</div> + <div>Age range: {{ resource.age_range }}</div> + <div>Resource type: {{ resource.resource_type }}</div> + </div> + </div> + <div> + <h3 class="feature-pdf-page-title">Feature images</h3> + <div class="resource-img-detail"> + {% for tn_url, tn_filename in resource.thumbnails %}<img src="{{ tn_url }}" alt="{{ tn_filename }}" />{% endfor %} + </div> + <h3 class="feature-pdf-page-title">Resource preview</h3> + <div class="resource-img-detail"> + {% for snapshot_filename, snapshot_urls in resource.snapshot_urls.items %} + <div> + <h4>{{ snapshot_filename }}</h4> + </div> + <div> + {% for snapshot_url in snapshot_urls %}<img src="{{ snapshot_url }}" alt="{{ snapshot_filename }}"{% endfor %} </div /> + {% endfor %} + </div> + <div class="resource-description-panel"> + <h3>What's included?</h3> + <div>{{ resource.description }}</div> + <h3>What's it for?</h3> + <div>{% lorem %}</div> + <h3>Resource Details</h3> + <div>{% lorem %}</div> + </div> + <div class="resource-download-panel"> + <h4>Download the resource</h4> + <div> + Click + <button hx-get="/hx-download-btn?rn={{ resource.pdf_filename }}" + hx-target="next #download-reveal">here</button> + to download the resource + </div> + <div id="download-reveal"></div> + </div> + </div> + </div> + <div>Logged in as {{ request.user.username }}</div> + {% endblock content %} diff --git a/pyblackbird_cc/templates/resources/resource_list.html b/pyblackbird_cc/templates/resources/resource_list.html new file mode 100644 index 0000000..5b11ff6 --- /dev/null +++ b/pyblackbird_cc/templates/resources/resource_list.html @@ -0,0 +1,61 @@ +{% extends "base.html" %} + +{% block title %} + Joanna Lemon Resources - Resource List +{% endblock title %} +{% block content %} + <div class="cella"> + {% if request.user.is_authenticated %} + <div class="admin-links"> + <div> + <a href="{% url 'resources:create_resource' %} ">Add a new resource</a> + </div> + <div> + <form action="{% url 'account_logout' %}" method="post"> + {% csrf_token %} + <button type="submit">Log out</button> + </form> + </div> + </div> + {% endif %} + {% if resource_list %} + {% for resource in resource_list %} + <div class="resource-metadata-panel"> + <div> + <a class="no-underline" + href="{% url 'resources:resource_detail' resource_id=resource.id %}"> + <h1 class="resource-title">{{ resource.name }}</h1> + </a> + </div> + <div> + <div>Main category: {{ resource.main_resource_category_name }}</div> + {% if resource.additional_resource_category_name %} + <div>Additional category: {{ resource.additional_resource_category_name }}</div> + {% endif %} + </div> + </div> + <div> + <div class="resource-img-detail"> + {% for img in resource.thumbnail_urls %} + <img style="max-height: 400px; + width: auto" + src="{{ img }}" + alt="{{ resource.thumbnail_filename }}" /> + {% endfor %} + </div> + <div> + Click + <button hx-get="/hx-download-btn?rn={{ resource.pdf_filename }}" + hx-target="next #download-reveal">here</button> + to download the resource + </div> + <div id="download-reveal"></div> + <hr /> + </div> + {% endfor %} + {% else %} + <p>There are no resources</p> + {% endif %} + </div> + <div>Logged in as {{ request.user.username }}</div> +{% endblock content %} |