Add profile
This commit is contained in:
28
app/website/templates/pages/profiles.html
Normal file
28
app/website/templates/pages/profiles.html
Normal file
@ -0,0 +1,28 @@
|
||||
{% load static %}
|
||||
<main id="main" data-scroll-to-top="true">
|
||||
{# List Profiles #}
|
||||
<div style="display: flex; flex-wrap: wrap; justify-content: space-between; ">
|
||||
{% for profile in profiles %}
|
||||
<article style="max-width: 12rem">
|
||||
<header>
|
||||
<h2>
|
||||
{{ profile.full_name }}
|
||||
</h2>
|
||||
<p>
|
||||
<img src="{{ profile.avatar.url }}" alt="{{ profile.full_name }}">
|
||||
</p>
|
||||
</header>
|
||||
<h3>Talks</h3>
|
||||
<ul>
|
||||
{% for talk in profile.talk_profile_set.all %}
|
||||
<li>
|
||||
{{ talk.title }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<footer>Email: {{ profile.email }}</footer>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{# End List talks #}
|
||||
</main>
|
@ -1,3 +1,4 @@
|
||||
{% load static %}
|
||||
{% load slippers %}
|
||||
<main id="main" data-scroll-to-top="true">
|
||||
|
||||
@ -7,12 +8,11 @@
|
||||
<input type="hidden" name="value" value="search-talks">
|
||||
<label>
|
||||
<input
|
||||
autofocus="autofocus"
|
||||
onfocus="const miVal = this.value; this.value= ''; this.value = miVal"
|
||||
id="search"
|
||||
type="search"
|
||||
name="search"
|
||||
hx-ws="send"
|
||||
hx-trigger="keyup changed delay:1000ms"
|
||||
hx-trigger="keyup changed delay:1s"
|
||||
value="{{ search }}"
|
||||
>
|
||||
</label>
|
||||
@ -20,29 +20,33 @@
|
||||
{# End search #}
|
||||
|
||||
{# List talks #}
|
||||
{% for talk in talks %}
|
||||
<form>
|
||||
<input type="hidden" name="action" value="page">
|
||||
<input type="hidden" name="value" value="single-talk">
|
||||
<input type="hidden" name="id" value="{{ talk.id }}">
|
||||
<a href="#" hx-ws="send" hx-trigger="click">
|
||||
<article>
|
||||
<header>
|
||||
<div class="grid">
|
||||
<p>
|
||||
<img width="200" src="{{ talk.image.url }}">
|
||||
</p>
|
||||
<h2>{{ talk.title }}</h2>
|
||||
</div>
|
||||
</header>
|
||||
<p>
|
||||
{{ talk.content|truncatechars:150 }}
|
||||
</p>
|
||||
<footer>Author {{ talk.author.full_name }} - {{ talk.category.name }}</footer>
|
||||
</article>
|
||||
</a>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% if talks %}
|
||||
{% for talk in talks %}
|
||||
<form>
|
||||
<input type="hidden" name="action" value="page">
|
||||
<input type="hidden" name="value" value="single-talk">
|
||||
<input type="hidden" name="id" value="{{ talk.id }}">
|
||||
<a href="#" hx-ws="send" hx-trigger="click">
|
||||
<article>
|
||||
<header>
|
||||
<div class="grid">
|
||||
<p>
|
||||
<img width="200" src="{{ talk.image.url }}">
|
||||
</p>
|
||||
<h2>{{ talk.title }}</h2>
|
||||
</div>
|
||||
</header>
|
||||
<p>
|
||||
{{ talk.content|truncatechars:150 }}
|
||||
</p>
|
||||
<footer>Author {{ talk.author.full_name }} - {{ talk.category.name }}</footer>
|
||||
</article>
|
||||
</a>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<h1>No talks found.</h1>
|
||||
{% endif %}
|
||||
{# End List talks #}
|
||||
|
||||
{# Paginator #}
|
||||
@ -54,4 +58,5 @@
|
||||
{% endif %}
|
||||
{# End Paginator #}
|
||||
|
||||
<script src="{% static "js/talks.js" %}"></script>
|
||||
</main>
|
||||
|
Reference in New Issue
Block a user