mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 19:22:26 +00:00
frontend: Add timezone fields to calendar forms
This commit is contained in:
@@ -27,6 +27,8 @@ export class CreateCalendarForm extends LitElement {
|
||||
@property()
|
||||
description: string = ''
|
||||
@property()
|
||||
timezone_id: string = ''
|
||||
@property()
|
||||
color: string = ''
|
||||
@property()
|
||||
isSubscription: boolean = false
|
||||
@@ -65,6 +67,11 @@ export class CreateCalendarForm extends LitElement {
|
||||
<input type="text" name="displayname" value=${this.displayname} @change=${e => this.displayname = e.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Timezone (optional)
|
||||
<input type="text" name="timezone" .value=${this.timezone_id} @change=${e => this.timezone_id = e.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Description
|
||||
<input type="text" name="description" @change=${e => this.description = e.target.value} />
|
||||
@@ -125,6 +132,7 @@ export class CreateCalendarForm extends LitElement {
|
||||
<set>
|
||||
<prop>
|
||||
<displayname>${escapeXml(this.displayname)}</displayname>
|
||||
${this.timezone_id ? `<CAL:calendar-timezone-id>${escapeXml(this.timezone_id)}</CAL:calendar-timezone-id>` : ''}
|
||||
${this.description ? `<CAL:calendar-description>${escapeXml(this.description)}</CAL:calendar-description>` : ''}
|
||||
${this.color ? `<ICAL:calendar-color>${escapeXml(this.color)}</ICAL:calendar-color>` : ''}
|
||||
${(this.isSubscription && this.subscriptionUrl) ? `<CS:source><href>${escapeXml(this.subscriptionUrl)}</href></CS:source>` : ''}
|
||||
|
||||
@@ -23,6 +23,8 @@ export class EditCalendarForm extends LitElement {
|
||||
@property()
|
||||
description: string = ''
|
||||
@property()
|
||||
timezone_id: string = ''
|
||||
@property()
|
||||
color: string = ''
|
||||
@property({
|
||||
converter: {
|
||||
@@ -47,6 +49,11 @@ export class EditCalendarForm extends LitElement {
|
||||
<input type="text" name="displayname" .value=${this.displayname} @change=${e => this.displayname = e.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Timezone (optional)
|
||||
<input type="text" name="timezone" .value=${this.timezone_id} @change=${e => this.timezone_id = e.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Description
|
||||
<input type="text" name="description" .value=${this.description} @change=${e => this.description = e.target.value} />
|
||||
@@ -100,6 +107,7 @@ export class EditCalendarForm extends LitElement {
|
||||
<set>
|
||||
<prop>
|
||||
<displayname>${escapeXml(this.displayname)}</displayname>
|
||||
${this.timezone_id ? `<CAL:calendar-timezone-id>${escapeXml(this.timezone_id)}</CAL:calendar-timezone-id>` : ''}
|
||||
${this.description ? `<CAL:calendar-description>${escapeXml(this.description)}</CAL:calendar-description>` : ''}
|
||||
${this.color ? `<ICAL:calendar-color>${escapeXml(this.color)}</ICAL:calendar-color>` : ''}
|
||||
<CAL:supported-calendar-component-set>
|
||||
|
||||
@@ -21,6 +21,7 @@ let CreateCalendarForm = class extends i {
|
||||
this.cal_id = "";
|
||||
this.displayname = "";
|
||||
this.description = "";
|
||||
this.timezone_id = "";
|
||||
this.color = "";
|
||||
this.isSubscription = false;
|
||||
this.subscriptionUrl = "";
|
||||
@@ -57,6 +58,11 @@ let CreateCalendarForm = class extends i {
|
||||
<input type="text" name="displayname" value=${this.displayname} @change=${(e2) => this.displayname = e2.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Timezone (optional)
|
||||
<input type="text" name="timezone" .value=${this.timezone_id} @change=${(e2) => this.timezone_id = e2.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Description
|
||||
<input type="text" name="description" @change=${(e2) => this.description = e2.target.value} />
|
||||
@@ -120,6 +126,7 @@ let CreateCalendarForm = class extends i {
|
||||
<set>
|
||||
<prop>
|
||||
<displayname>${escapeXml(this.displayname)}</displayname>
|
||||
${this.timezone_id ? `<CAL:calendar-timezone-id>${escapeXml(this.timezone_id)}</CAL:calendar-timezone-id>` : ""}
|
||||
${this.description ? `<CAL:calendar-description>${escapeXml(this.description)}</CAL:calendar-description>` : ""}
|
||||
${this.color ? `<ICAL:calendar-color>${escapeXml(this.color)}</ICAL:calendar-color>` : ""}
|
||||
${this.isSubscription && this.subscriptionUrl ? `<CS:source><href>${escapeXml(this.subscriptionUrl)}</href></CS:source>` : ""}
|
||||
@@ -150,6 +157,9 @@ __decorateClass([
|
||||
__decorateClass([
|
||||
n$1()
|
||||
], CreateCalendarForm.prototype, "description", 2);
|
||||
__decorateClass([
|
||||
n$1()
|
||||
], CreateCalendarForm.prototype, "timezone_id", 2);
|
||||
__decorateClass([
|
||||
n$1()
|
||||
], CreateCalendarForm.prototype, "color", 2);
|
||||
|
||||
@@ -16,6 +16,7 @@ let EditCalendarForm = class extends i {
|
||||
super();
|
||||
this.displayname = "";
|
||||
this.description = "";
|
||||
this.timezone_id = "";
|
||||
this.color = "";
|
||||
this.components = /* @__PURE__ */ new Set();
|
||||
this.dialog = e();
|
||||
@@ -35,6 +36,11 @@ let EditCalendarForm = class extends i {
|
||||
<input type="text" name="displayname" .value=${this.displayname} @change=${(e2) => this.displayname = e2.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Timezone (optional)
|
||||
<input type="text" name="timezone" .value=${this.timezone_id} @change=${(e2) => this.timezone_id = e2.target.value} />
|
||||
</label>
|
||||
<br>
|
||||
<label>
|
||||
Description
|
||||
<input type="text" name="description" .value=${this.description} @change=${(e2) => this.description = e2.target.value} />
|
||||
@@ -91,6 +97,7 @@ let EditCalendarForm = class extends i {
|
||||
<set>
|
||||
<prop>
|
||||
<displayname>${escapeXml(this.displayname)}</displayname>
|
||||
${this.timezone_id ? `<CAL:calendar-timezone-id>${escapeXml(this.timezone_id)}</CAL:calendar-timezone-id>` : ""}
|
||||
${this.description ? `<CAL:calendar-description>${escapeXml(this.description)}</CAL:calendar-description>` : ""}
|
||||
${this.color ? `<ICAL:calendar-color>${escapeXml(this.color)}</ICAL:calendar-color>` : ""}
|
||||
<CAL:supported-calendar-component-set>
|
||||
@@ -123,6 +130,9 @@ __decorateClass([
|
||||
__decorateClass([
|
||||
n$1()
|
||||
], EditCalendarForm.prototype, "description", 2);
|
||||
__decorateClass([
|
||||
n$1()
|
||||
], EditCalendarForm.prototype, "timezone_id", 2);
|
||||
__decorateClass([
|
||||
n$1()
|
||||
], EditCalendarForm.prototype, "color", 2);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
<edit-calendar-form
|
||||
principal="{{ calendar.principal }}"
|
||||
cal_id="{{ calendar.id }}"
|
||||
timezone_id="{{ calendar.timezone_id.as_deref().unwrap_or_default() }}"
|
||||
displayname="{{ calendar.displayname.as_deref().unwrap_or_default() }}"
|
||||
description="{{ calendar.description.as_deref().unwrap_or_default() }}"
|
||||
color="{{ calendar.color.as_deref().unwrap_or_default() }}"
|
||||
|
||||
Reference in New Issue
Block a user