mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 21:42:26 +00:00
frontend calendar list
This commit is contained in:
@@ -5,31 +5,44 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<style>
|
<style>
|
||||||
li {
|
li.calendar-list-item {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
display: block;
|
display: grid;
|
||||||
margin: 12px;
|
margin: 12px;
|
||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
background: #EEE;
|
background: #EEE;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
grid-template-areas:
|
||||||
|
"title color-chip"
|
||||||
|
"description color-chip";
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
grid-template-columns: auto 50px;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: contents;
|
||||||
|
|
||||||
|
.color-chip {
|
||||||
|
background: var(--color);
|
||||||
|
grid-area: color-chip;
|
||||||
|
border-radius: 0 12px 12px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<h2>Welcome {{ user_id }}!</h2>
|
<h2>Welcome {{ user_id }}!</h2>
|
||||||
<ul>
|
<ul>
|
||||||
{% for calendar in calendars %}
|
{% for calendar in calendars %}
|
||||||
<li>
|
{% let color = calendar.color.to_owned().unwrap_or("red".to_owned()) %}
|
||||||
{% if let Some(name) = calendar.displayname %}
|
<li class="calendar-list-item" style="--color: {{ color }}">
|
||||||
{{ name }}
|
<a href="/frontend/user/{{ user_id }}/{{ calendar.id}}">
|
||||||
{% else %}
|
<span class="title">{{ calendar.displayname.to_owned().unwrap_or(calendar.id.to_owned()) }}</span>
|
||||||
{{ calendar.id }}
|
<span class="description">
|
||||||
{% endif %}
|
{% if let Some(description) = calendar.description %}{{ description }}{% endif %}
|
||||||
{% let color = calendar.color.to_owned().unwrap_or("red".to_owned()) %}
|
</span>
|
||||||
<p style="color: {{ color }}">
|
<div class="color-chip"></div>
|
||||||
{% if let Some(description) = calendar.description %}{{ description }}{% endif %}
|
</a>
|
||||||
</p>
|
|
||||||
<!-- <a href="{{ calendar.id}}">Test</a> -->
|
|
||||||
<a href="/frontend/user/{{ user_id }}/{{ calendar.id}}">Test</a>
|
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user