Skip to content
Snippets Groups Projects
Commit a37f462f authored by David Trattnig's avatar David Trattnig
Browse files

feat: optionally render link in programme table

parent aa4dcf1d
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
export let refreshTime = '60'
export let view = 'card' // 'card' or 'paper'
/* Nested Component Props */
export let renderLinks = true
export let renderhtml = false // Attention: to avoid XSS attack vectors use with trusted API sources only
export let displayCatTitle = false
export let displayCatIcons = false
......@@ -131,6 +132,7 @@
{programme}
{urlEpisodeDetail}
{urlShowDetail}
{renderLinks}
{renderhtml} />
</div>
{:else}
......
......@@ -7,6 +7,7 @@
export let programme = undefined
export let urlEpisodeDetail = undefined
export let urlShowDetail = undefined
export let renderLinks = true
export let renderhtml = false
</script>
......@@ -22,16 +23,17 @@
background-color: var(--mdc-theme-primary);
color: var(--mdc-theme-text-secondary-on-background);
}
.episode.active a {
color: var(--mdc-theme-text-primary-on-background);
}
.episode.active > .episode-time:after {
content: 'NOW';
font-weight: bold;
}
/* SMUI components need to be selected via global namespace */
/* sub-components need to be selected via global namespace */
:global(.episode.active a) {
color: var(--mdc-theme-text-primary-on-background);
}
* :global(.episode.active > .episode-time .time-start) {
display: none;
}
......@@ -60,20 +62,21 @@
<div class="details-wrapper">
<div class="episode-title">
{#if episode.customUrl}
<a href={episode.customUrl}>
<Display value={episode.note_title} {renderhtml} />
</a>
<Display
value={episode.note_title}
url={renderLinks ? episode.customUrl : null}
{renderhtml} />
{:else if hasEpisodeTitle(episode)}
<!-- #FIXME "emmission_ID" should be "timeslot_id", "episode_id" or "id" only -->
<a href={urlEpisodeDetail + episode.emission_ID}>
<Display value={episode.title} {renderhtml} />
</a>
<Display
value={episode.title}
url={renderLinks ? urlEpisodeDetail + episode.emission_ID : null}
{renderhtml} />
{:else}
<a href={urlShowDetail + episode.show.slug}>
<Display
value={episode.show ? episode.show.name : ''}
{renderhtml} />
</a>
<Display
value={episode.show ? episode.show.name : ''}
url={renderLinks ? urlShowDetail + episode.show.slug : null}
{renderhtml} />
{/if}
</div>
<div class="episode-tagline">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment