frontend: some changes

This commit is contained in:
Lennart
2024-11-10 13:18:45 +01:00
parent 43ff0c6671
commit 130d8b00ab
9 changed files with 103 additions and 27 deletions

View File

@@ -4,6 +4,11 @@
{% endblock %}
{% block content %}
<h1>Test</h1>
<a href="/frontend/user/{{ owner }}">Back</a>
{% let name = addressbook.displayname.to_owned().unwrap_or(addressbook.id.to_owned()) %}
<h1>{{ name }}</h1>
{% if let Some(description) = addressbook.description %}<p>{{ description }}</p>{% endif%}
<pre>{{ addressbook|yaml }}</pre>
<a href="/frontend/user/{{ addressbook.principal }}">Back</a>
{% endblock %}

View File

@@ -4,6 +4,11 @@
{% endblock %}
{% block content %}
<h1>Test</h1>
{% let name = calendar.displayname.to_owned().unwrap_or(calendar.id.to_owned()) %}
<h1>{{ name }}</h1>
{% if let Some(description) = calendar.description %}<p>{{ description }}</p>{% endif%}
<pre>{{ calendar|yaml }}</pre>
<a href="/frontend/user/{{ calendar.principal }}">Back</a>
{% endblock %}

View File

@@ -48,6 +48,23 @@ li.collection-list-item {
</li>
{% endfor %}
</ul>
{%if !deleted_calendars.is_empty() %}
<h3>Deleted Calendars</h3>
<ul>
{% for calendar in deleted_calendars %}
{% let color = calendar.color.to_owned().unwrap_or("red".to_owned()) %}
<li class="collection-list-item" style="--color: {{ color }}">
<a href="/frontend/user/{{ user_id }}/calendar/{{ calendar.id}}">
<span class="title">{{ calendar.displayname.to_owned().unwrap_or(calendar.id.to_owned()) }}</span>
<span class="description">
{% if let Some(description) = calendar.description %}{{ description }}{% endif %}
</span>
<div class="color-chip"></div>
</a>
</li>
{% endfor %}
</ul>
{% endif %}
<h2>Addressbooks</h2>
<ul>
@@ -62,5 +79,20 @@ li.collection-list-item {
</li>
{% endfor %}
</ul>
{%if !deleted_addressbooks.is_empty() %}
<h3>Deleted Addressbooks</h3>
<ul>
{% for addressbook in deleted_addressbooks %}
<li class="collection-list-item">
<a href="/frontend/user/{{ user_id }}/addressbook/{{ addressbook.id}}">
<span class="title">{{ addressbook.displayname.to_owned().unwrap_or(addressbook.id.to_owned()) }}</span>
<span class="description">
{% if let Some(description) = addressbook.description %}{{ description }}{% endif %}
</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}