|
8 | 8 | <div class="edit-calendar-modal"> |
9 | 9 | <h3 class="edit-calendar-modal__header"> |
10 | 10 | {{ $t('calendar', 'Edit calendar') }} |
| 11 | + <span class="edit-calendar-modal__header_subtitle"> |
| 12 | + {{ description }} |
| 13 | + </span> |
11 | 14 | </h3> |
12 | 15 |
|
13 | 16 | <div class="edit-calendar-modal__name-and-color"> |
|
83 | 86 |
|
84 | 87 | <script> |
85 | 88 | import { showError } from '@nextcloud/dialogs' |
| 89 | +import { getLanguage } from '@nextcloud/l10n' |
86 | 90 | import { NcAppNavigationSpacer, NcButton, NcCheckboxRadioSwitch, NcColorPicker, NcModal } from '@nextcloud/vue' |
87 | 91 | import { mapStores } from 'pinia' |
88 | 92 | import CheckIcon from 'vue-material-design-icons/Check.vue' |
@@ -167,6 +171,39 @@ export default { |
167 | 171 | downloadUrl() { |
168 | 172 | return this.calendar.url + '?export' |
169 | 173 | }, |
| 174 | +
|
| 175 | + /** |
| 176 | + * Description about supported component types. |
| 177 | + * |
| 178 | + * @return {string} |
| 179 | + */ |
| 180 | + description() { |
| 181 | + const supportedTypes = [] |
| 182 | + if (this.calendar.supportsEvents) { |
| 183 | + supportedTypes.push(this.$t('calendar', 'events')) |
| 184 | + } |
| 185 | + if (this.calendar.supportsTasks) { |
| 186 | + supportedTypes.push(this.$t('calendar', 'tasks')) |
| 187 | + } |
| 188 | + if (this.calendar.supportsJournals) { |
| 189 | + // TRANSLATORS "notes" would be more user-friendly. "journal entries" (from RFC 5545) was used to avoid confusion with notes from the Notes app. |
| 190 | + supportedTypes.push(this.$t('calendar', 'journal entries')) |
| 191 | + } |
| 192 | +
|
| 193 | + if (supportedTypes.lenght === 0) { |
| 194 | + return this.$t('calendar', 'This calendar supports neither events, tasks nor journal entries.') |
| 195 | + } |
| 196 | +
|
| 197 | + const formatter = new Intl.ListFormat(getLanguage(), { type: 'conjunction' }) |
| 198 | + const localizedTypes = formatter.format(supportedTypes) |
| 199 | + return this.$n( |
| 200 | + 'calendar', |
| 201 | + 'This calendar supports only {types}.', |
| 202 | + 'This calendar supports {types}.', |
| 203 | + supportedTypes.length, |
| 204 | + { types: localizedTypes }, |
| 205 | + ) |
| 206 | + }, |
170 | 207 | }, |
171 | 208 |
|
172 | 209 | watch: { |
@@ -295,6 +332,13 @@ export default { |
295 | 332 | font-size: 21px; |
296 | 333 | } |
297 | 334 |
|
| 335 | + &__header_subtitle { |
| 336 | + display: block; |
| 337 | + color: var(--color-text-maxcontrast); |
| 338 | + font-size: 1rem; |
| 339 | + font-weight: normal; |
| 340 | + } |
| 341 | +
|
298 | 342 | &__name-and-color { |
299 | 343 | display: flex; |
300 | 344 | align-items: center; |
|
0 commit comments