diff --git a/com/static/bundled/com/components/ics-calendar-index.ts b/com/static/bundled/com/components/ics-calendar-index.ts index 227d4128..f3bb9e9e 100644 --- a/com/static/bundled/com/components/ics-calendar-index.ts +++ b/com/static/bundled/com/components/ics-calendar-index.ts @@ -17,11 +17,12 @@ import { @registerComponent("ics-calendar") export class IcsCalendar extends inheritHtmlElement("div") { - static observedAttributes = ["locale", "can_moderate", "can_delete"]; + static observedAttributes = ["locale", "can_moderate", "can_delete", "ics-help-url"]; private calendar: Calendar; private locale = "en"; private canModerate = false; private canDelete = false; + private helpUrl = ""; attributeChangedCallback(name: string, _oldValue?: string, newValue?: string) { if (name === "locale") { @@ -33,6 +34,10 @@ export class IcsCalendar extends inheritHtmlElement("div") { if (name === "can_delete") { this.canDelete = newValue.toLowerCase() === "true"; } + + if (name === "ics-help-url") { + this.helpUrl = newValue; + } } isMobile() { @@ -335,6 +340,14 @@ export class IcsCalendar extends inheritHtmlElement("div") { }, 1500); }, }, + helpButton: { + text: "?", + click: () => { + if (this.helpUrl) { + window.open(this.helpUrl, "_blank"); + } + }, + }, }, height: "auto", locale: this.locale, diff --git a/com/static/com/components/ics-calendar.scss b/com/static/com/components/ics-calendar.scss index 49713f82..214c52a0 100644 --- a/com/static/com/components/ics-calendar.scss +++ b/com/static/com/components/ics-calendar.scss @@ -114,10 +114,28 @@ ics-calendar { button.text-copied:focus, button.text-copied:hover { transition: 500ms ease-out; + margin-right: 0.5rem; } button.text-copied[tooltip]::before { opacity: 0; transition: opacity 500ms ease-out; } + + .fc .fc-helpButton-button { + border-radius: 70%; + padding-left: 0.5rem; + padding-right: 0.5rem; + background-color: rgba(0, 0, 0, 0.8); + transition: 100ms ease-out; + width: 30px; + height: 30px; + font-size: 11px; + } + + + .fc .fc-helpButton-button:hover, + .fc .fc-helpButton-button:focus { + background-color: rgba(20, 20, 20, 0.6); + } } \ No newline at end of file diff --git a/com/templates/com/news_list.jinja b/com/templates/com/news_list.jinja index 172cc888..e9ff641a 100644 --- a/com/templates/com/news_list.jinja +++ b/com/templates/com/news_list.jinja @@ -192,6 +192,7 @@ @calendar-delete="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.DELETED})" @calendar-unpublish="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.PENDING})" @calendar-publish="$dispatch('news-moderated', {newsId: $event.detail.id, state: AlertState.PUBLISHED})" + ics-help-url="{{ url('core:page', page_name='Index/calendrier')}}" locale="{{ get_language() }}" can_moderate="{{ user.has_perm("com.moderate_news") }}" can_delete="{{ user.has_perm("com.delete_news") }}"