Skip to content

Commit

Permalink
fix: issues with new div formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed Sep 25, 2023
1 parent d7c57d5 commit e0895e1
Show file tree
Hide file tree
Showing 13 changed files with 186 additions and 203 deletions.
10 changes: 5 additions & 5 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,6 @@ export class AtomicCalendarReviveEditor extends ScopedRegistryHost(LitElement) i
name: 'compactMode',
label: localize('main.fields.compactMode'),
},
{
type: 'switch',
name: 'hoursOnSameLine',
label: localize('main.fields.hoursOnSameLine'),
},
{
type: 'switch',
name: 'showAllDayEvents',
Expand Down Expand Up @@ -539,6 +534,11 @@ export class AtomicCalendarReviveEditor extends ScopedRegistryHost(LitElement) i
label: localize('event.fields.showAllDayHours'),
default: defaultConfig.showAllDayHours,
},
{
type: 'switch',
name: 'hoursOnSameLine',
label: localize('event.fields.hoursOnSameLine'),
}
],
},
calendar: {
Expand Down
11 changes: 7 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,13 @@ export class AtomicCalendarRevive extends LitElement {
${eventLeft}
<div class="event-right" style="${finishedEventsStyle}">
${currentEventLine}
<div class="event-main">${getTitleHTML(this._config, event)}</div>
<div class="event-location">${getLocationHTML(this._config, event)} ${eventCalName} ${this._config.hoursOnSameLine ? hoursHTML : ''}</div>
${this._config.hoursOnSameLine ? '' : hoursHTML}
${timeUntilRemaining}
<div class="event-right-top">${getTitleHTML(this._config, event)}
<div class="event-location">${getLocationHTML(this._config, event)} ${eventCalName} ${this._config.hoursOnSameLine ? hoursHTML : ''}</div>
</div>
<div class="event-right-bottom">
${this._config.hoursOnSameLine ? '' : hoursHTML}
${timeUntilRemaining}
</div>
${getDescription(this._config, event)}
</div>
${progressBar}
Expand Down
9 changes: 3 additions & 6 deletions src/lib/eventMode.html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,13 @@ export function getLocationHTML(config: atomicCardConfig, event: EventClass) {
if (!event.location || !config.showLocation) {
return html``;
} else if (config.disableLocationLink) {
return html`<div><ha-icon class="event-location-icon" style="--location-icon-color: ${config.locationIconColor}" icon="mdi:map-marker"></ha-icon>&nbsp;${event.address}</div>
`;
return html`<ha-icon class="event-location-icon" style="--location-icon-color: ${config.locationIconColor}" icon="mdi:map-marker"></ha-icon>&nbsp;${event.address}`;
} else {
const loc: string = event.location;
const location: string = loc.startsWith('http') ? loc : 'https://maps.google.com/?q=' + loc;
return html`<div>
<a href=${location} target="${config.linkTarget}" class="location-link" style="--location-link-size: ${config.locationTextSize}%">
return html`<a href=${location} target="${config.linkTarget}" class="location-link" style="--location-link-size: ${config.locationTextSize}%">
<ha-icon class="event-location-icon" style="--location-icon-color: ${config.locationIconColor}" icon="mdi:map-marker"> </ha-icon>&nbsp;${event.address}
</a>
</div>`;
</a>`;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"showMultiDayEventParts": "Vis flere dages begivenhedsdele",
"eventTitle": "Indstil tom begivenhedstitel",
"compactMode": "Aktiver kompakt tilstand",
"hoursOnSameLine": "Vis timer på begivenhedslinjen",
"titleLength": "Max titellængde (0 for ubegrænset)",
"descLength": "Max beskrivelseslængde (0 for ubegrænset)",
"showAllDayEvents": "Vis heldagsbegivenheder",
Expand Down Expand Up @@ -86,7 +85,8 @@
"showEventDate": "Vis dato for arrangementer",
"showDatePerEvent": "Vis dato ud for hver begivenhed",
"showTimeRemaining": "Vis resterende tid",
"showAllDayHours": "Vis Heldagsbegivenhedstekst"
"showAllDayHours": "Vis Heldagsbegivenhedstekst",
"hoursOnSameLine": "Vis timer på begivenhedslinjen"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"showMultiDayEventParts": "Toon meerdaagse evenementonderdelen",
"eventTitle": "Lege evenementtitel instellen",
"compactMode": "Schakel de compacte modus in",
"hoursOnSameLine": "Toon uren op de gebeurtenisregel",
"titleLength": "Maximale titellengte (0 voor onbeperkt)",
"descLength": "Maximale beschrijvingslengte (0 voor onbeperkt)",
"showAllDayEvents": "Toon evenementen die de hele dag duren",
Expand Down Expand Up @@ -85,7 +84,8 @@
"showEventDate": "Toon datum voor evenementen",
"showDatePerEvent": "Toon datum naast elk evenement",
"showTimeRemaining": "Laat de resterende tijd zien",
"showAllDayHours": "Toon de tekst van de hele dag-gebeurtenis"
"showAllDayHours": "Toon de tekst van de hele dag-gebeurtenis",
"hoursOnSameLine": "Toon uren op de gebeurtenisregel"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"showMultiDayEventParts": "Show Multi-Day Event Parts",
"eventTitle": "Set blank event title",
"compactMode": "Enable compact mode",
"hoursOnSameLine": "Show hours on the event line",
"titleLength": "Max title length (0 for unlimited)",
"descLength": "Max description length (0 for unlimited)",
"showAllDayEvents": "Show all day events",
Expand Down Expand Up @@ -86,7 +85,8 @@
"showEventDate": "Show date for events",
"showDatePerEvent": "Show date next to each event",
"showTimeRemaining": "Show time remaining",
"showAllDayHours": "Show All Day event text"
"showAllDayHours": "Show All Day event text",
"hoursOnSameLine": "Show hours on the event line"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/et.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"showMultiDayEventParts": "Näita mitmepäevaste sündmuste osi",
"eventTitle": "Määra tühi sündmuse pealkiri",
"compactMode": "Kompaktrežiimi lubamine",
"hoursOnSameLine": "Näidake sündmuse reale tundi",
"titleLength": "Pealkirja maksimaalne pikkus (0 piiramatu jaoks)",
"descLength": "Kirjelduse maksimaalne pikkus (0 piiramatu puhul)",
"showAllDayEvents": "Näita kogu päeva sündmusi",
Expand Down Expand Up @@ -84,7 +83,8 @@
"showEventDate": "Näita sündmuste kuupäeva",
"showDatePerEvent": "Kuva kuupäev iga sündmuse kõrval",
"showTimeRemaining": "Näita järelejäänud aega",
"showAllDayHours": "Näita kogu päeva sündmuse teksti"
"showAllDayHours": "Näita kogu päeva sündmuse teksti",
"hoursOnSameLine": "Näidake sündmuse reale tundi"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"showMultiDayEventParts": "Näytä usean päivän tapahtuman osat",
"eventTitle": "Aseta tyhjä tapahtuman otsikko",
"compactMode": "Ota kompakti tila käyttöön",
"hoursOnSameLine": "Näytä tunnit tapahtumarivillä",
"titleLength": "Otsikon enimmäispituus (0 rajattomasti)",
"descLength": "Kuvauksen enimmäispituus (0 rajattomasti)",
"showAllDayEvents": "Näytä koko päivän tapahtumat",
Expand Down Expand Up @@ -86,7 +85,8 @@
"showEventDate": "Näytä tapahtumien päivämäärä",
"showDatePerEvent": "Näytä päivämäärä jokaisen tapahtuman vieressä",
"showTimeRemaining": "Näytä jäljellä oleva aika",
"showAllDayHours": "Näytä koko päivän tapahtuman teksti"
"showAllDayHours": "Näytä koko päivän tapahtuman teksti",
"hoursOnSameLine": "Näytä tunnit tapahtumarivillä"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"showMultiDayEventParts": "Afficher les parties de l'événement sur plusieurs jours",
"eventTitle": "Définir un titre d'événement vide",
"compactMode": "Activer le mode compact",
"hoursOnSameLine": "Afficher les heures sur la ligne de l'événement",
"titleLength": "Longueur maximale du titre (0 pour illimité)",
"descLength": "Longueur maximale de la description (0 pour illimité)",
"showAllDayEvents": "Afficher les événements de la journée",
Expand Down Expand Up @@ -86,7 +85,8 @@
"showEventDate": "Afficher la date des événements",
"showDatePerEvent": "Afficher la date à côté de chaque événement",
"showTimeRemaining": "Afficher le temps restant",
"showAllDayHours": "Afficher le texte de l'événement toute la journée"
"showAllDayHours": "Afficher le texte de l'événement toute la journée",
"hoursOnSameLine": "Afficher les heures sur la ligne de l'événement"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"showMultiDayEventParts": "Vis flerdagers arrangementsdeler",
"eventTitle": "Angi en tom hendelsestittel",
"compactMode": "Aktiver kompakt modus",
"hoursOnSameLine": "Vis timer på arrangementslinjen",
"titleLength": "Maks tittellengde (0 for ubegrenset)",
"descLength": "Maks beskrivelseslengde (0 for ubegrenset)",
"showAllDayEvents": "Vis heldagsbegivenheter",
Expand Down Expand Up @@ -86,7 +85,8 @@
"showEventDate": "Vis dato for arrangementer",
"showDatePerEvent": "Vis dato ved siden av hvert arrangement",
"showTimeRemaining": "Vis gjenværende tid",
"showAllDayHours": "Vis tekst for hele dagen"
"showAllDayHours": "Vis tekst for hele dagen",
"hoursOnSameLine": "Vis timer på arrangementslinjen"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"showMultiDayEventParts": "Prikaži dele večdnevnega dogodka",
"eventTitle": "Nastavite prazen naslov dogodka",
"compactMode": "Omogoči kompaktni način",
"hoursOnSameLine": "Prikaži ure na vrstici dogodkov",
"titleLength": "Največja dolžina naslova (0 za neomejeno)",
"descLength": "Največja dolžina opisa (0 za neomejeno)",
"showAllDayEvents": "Pokaži celodnevne dogodke",
Expand Down Expand Up @@ -86,7 +85,8 @@
"showEventDate": "Pokaži datum za dogodke",
"showDatePerEvent": "Prikažite datum poleg vsakega dogodka",
"showTimeRemaining": "Pokaži preostali čas",
"showAllDayHours": "Prikaži besedilo celodnevnega dogodka"
"showAllDayHours": "Prikaži besedilo celodnevnega dogodka",
"hoursOnSameLine": "Prikaži ure na vrstici dogodkov"
}
},
"calendar": {
Expand Down
4 changes: 2 additions & 2 deletions src/localize/languages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"showMultiDayEventParts": "Visa flerdagarsevenemangsdelar",
"eventTitle": "Ange tom händelsetitel",
"compactMode": "Aktivera kompakt läge",
"hoursOnSameLine": "Visa öppettider på evenemangsraden",
"titleLength": "Max titellängd (0 för obegränsat)",
"descLength": "Max beskrivningslängd (0 för obegränsat)",
"showAllDayEvents": "Visa heldagshändelser",
Expand Down Expand Up @@ -85,7 +84,8 @@
"showEventDate": "Visa datum för evenemang",
"showDatePerEvent": "Visa datum bredvid varje evenemang",
"showTimeRemaining": "Visa återstående tid",
"showAllDayHours": "Visa heldagshändelsetext"
"showAllDayHours": "Visa heldagshändelsetext",
"hoursOnSameLine": "Visa öppettider på evenemangsraden"
}
},
"calendar": {
Expand Down
Loading

0 comments on commit e0895e1

Please sign in to comment.