mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 19:22:26 +00:00
88 lines
3.9 KiB
HTML
88 lines
3.9 KiB
HTML
<h2>{{ user.id }}'s Calendars</h2>
|
|
<ul class="collection-list">
|
|
{% for (meta, calendar) in calendars %}
|
|
{% let color = calendar.meta.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 }}"></a>
|
|
<div class="inner">
|
|
<span class="title">
|
|
{%- if calendar.principal != user.id -%}{{ calendar.principal }}/{%- endif -%}
|
|
{{ calendar.meta.displayname.to_owned().unwrap_or(calendar.id.to_owned()) }}
|
|
<div class="comps">
|
|
{% for comp in calendar.components %}
|
|
<span>{{ comp }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
</span>
|
|
<span class="description">
|
|
{% if let Some(description) = calendar.meta.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_") %}
|
|
<edit-calendar-form
|
|
principal="{{ calendar.principal }}"
|
|
cal_id="{{ calendar.id }}"
|
|
timezone_id="{{ calendar.timezone_id.as_deref().unwrap_or_default() }}"
|
|
displayname="{{ calendar.meta.displayname.as_deref().unwrap_or_default() }}"
|
|
description="{{ calendar.meta.description.as_deref().unwrap_or_default() }}"
|
|
color="{{ calendar.meta.color.as_deref().unwrap_or_default() }}"
|
|
components="{{ calendar.components | json }}"
|
|
></edit-calendar-form>
|
|
<delete-button trash href="/caldav/principal/{{ calendar.principal }}/{{ calendar.id }}"></delete-button>
|
|
{% endif %}
|
|
</div>
|
|
<div class="metadata">
|
|
{{ meta.len }} ({{ meta.size | filesizeformat }}) objects, {{ meta.deleted_len }} ({{ meta.deleted_size | filesizeformat }}) deleted objects
|
|
</div>
|
|
<div class="color-chip"></div>
|
|
</div>
|
|
</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 (meta, calendar) in deleted_calendars %}
|
|
{% let color = calendar.meta.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}}"></a>
|
|
<div class="inner">
|
|
<span class="title">
|
|
{%- if calendar.principal != user.id -%}{{ calendar.principal }}/{%- endif -%}
|
|
{{ calendar.meta.displayname.to_owned().unwrap_or(calendar.id.to_owned()) }}
|
|
<div class="comps">
|
|
{% for comp in calendar.components %}
|
|
<span>{{ comp }}</span>
|
|
{% endfor %}
|
|
</div>
|
|
</span>
|
|
<span class="description">
|
|
{% if let Some(description) = calendar.meta.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="metadata">
|
|
{{ meta.len }} ({{ meta.size | filesizeformat }}) objects, {{ meta.deleted_len }} ({{ meta.deleted_size | filesizeformat }}) deleted objects
|
|
</div>
|
|
<div class="color-chip"></div>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
<create-calendar-form user="{{ user.id }}"></create-calendar-form>
|
|
<import-calendar-form user="{{ user.id }}"></import-calendar-form>
|