mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 13:32:16 +00:00
71 lines
2.8 KiB
HTML
71 lines
2.8 KiB
HTML
<h2>{{ user.id }}'s Calendars</h2>
|
|
<ul class="collection-list">
|
|
{% for calendar in calendars %}
|
|
{% let color = calendar.color.to_owned().unwrap_or("transparent".to_owned()) %}
|
|
<li class="collection-list-item" style="--color: {{ color }}">
|
|
<a href="/frontend/user/{{ calendar.principal }}/calendar/{{ calendar.id }}">
|
|
<span class="title">
|
|
{%- if calendar.principal != user.id -%}{{ calendar.principal }}/{%- endif -%}
|
|
{{ calendar.displayname.to_owned().unwrap_or(calendar.id.to_owned()) }}
|
|
</span>
|
|
<div class="comps">
|
|
{% for comp in calendar.components %}
|
|
<span>{{ comp }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
<span class="description">
|
|
{% if let Some(description) = calendar.description %}{{ description }}{% endif %}
|
|
</span>
|
|
{% if let Some(subscription_url) = calendar.subscription_url %}
|
|
<span class="subscription-url">{{ subscription_url }}</span>
|
|
{% endif %}
|
|
<div class="actions">
|
|
<form action="/caldav/principal/{{ calendar.principal }}/{{ calendar.id }}" target="_blank" method="GET">
|
|
<button type="submit">Download</button>
|
|
</form>
|
|
{% if !calendar.id.starts_with("_birthdays_") %}
|
|
<delete-button trash href="/caldav/principal/{{ calendar.principal }}/{{ calendar.id }}"></delete-button>
|
|
{% endif %}
|
|
</div>
|
|
<div class="color-chip"></div>
|
|
</a>
|
|
</li>
|
|
{% else %}
|
|
You do not have any calendars yet
|
|
{% endfor %}
|
|
</ul>
|
|
{%if !deleted_calendars.is_empty() %}
|
|
<h3>Deleted Calendars</h3>
|
|
<ul class="collection-list">
|
|
{% for calendar in deleted_calendars %}
|
|
{% let color = calendar.color.to_owned().unwrap_or("transparent".to_owned()) %}
|
|
<li class="collection-list-item" style="--color: {{ color }}">
|
|
<a href="/frontend/user/{{ calendar.principal }}/calendar/{{ calendar.id}}">
|
|
<span class="title">
|
|
{%- if calendar.principal != user.id -%}{{ calendar.principal }}/{%- endif -%}
|
|
{{ calendar.displayname.to_owned().unwrap_or(calendar.id.to_owned()) }}
|
|
</span>
|
|
<div class="comps">
|
|
{% for comp in calendar.components %}
|
|
<span>{{ comp }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
<span class="description">
|
|
{% if let Some(description) = calendar.description %}{{ description }}{% endif %}
|
|
</span>
|
|
<div class="actions">
|
|
<form action="/frontend/user/{{ calendar.principal }}/calendar/{{ calendar.id}}/restore" method="POST"
|
|
class="restore-form">
|
|
<button type="submit">Restore</button>
|
|
</form>
|
|
<delete-button href="/caldav/principal/{{ calendar.principal }}/{{ calendar.id }}"></delete-button>
|
|
</div>
|
|
<div class="color-chip"></div>
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
<create-calendar-form user="{{ user.id }}"></create-calendar-form>
|
|
|