...
 
Commits (6)
This diff is collapsed.
......@@ -12,7 +12,7 @@
"dependencies": {
"base64-js": "^1.3.1",
"body-scroll-toggle": "^0.2.0",
"date-fns": "^2.1.0",
"date-fns": "^2.4.1",
"howler": "^2.1.1",
"idb-keyval": "^3.2.0",
"mem": "^5.1.1",
......@@ -24,7 +24,7 @@
"vue": "^2.6.10",
"vue-clamp": "^0.2.1",
"vue-feather-icons": "^5.0.0",
"vue-i18n": "^8.14.0",
"vue-i18n": "^8.14.1",
"vue-mq": "^1.0.1",
"vue-resize": "^0.4.5",
"vue-router": "^3.1.3",
......@@ -41,7 +41,7 @@
"eslint": "^5.16.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-vue": "^5.0.0",
"sass": "^1.22.10",
"sass": "^1.23.0",
"sass-loader": "^7.3.1",
"stylus": "^0.54.7",
"stylus-loader": "^3.0.1",
......
......@@ -5,7 +5,7 @@ const defaultOrigin = location.origin
const apiOrigin = process.env.VUE_APP_APIORIGIN || defaultOrigin
function retryAPI (origin = apiOrigin) {
return fetch(`${origin}/api/v1/`)
return fetch(`${origin}/api/v1/`, { cache: 'no-cache' })
.then(res => res.json())
.then(
() => ({ apiOrigin: origin }),
......
<template>
<time :datetime="`PT${seconds}S`"><slot/></time>
</template>
<script>
export default {
props: {
seconds: Number
}
}
</script>
<template>
<router-link :to="{ name: 'tag', params: { slug: tag.slug } }" class="tag white mb-2 mr-2"
:title="tag.name" >
<span>#{{ tag.slug }}</span>
<app-image :size="20" :aspect-ratio="1" :src="tag.icon" v-if="tag.icon" auto-size class="ml-1"/>
</router-link>
</template>
<script>
export default {
props: {
tag: Object
}
}
</script>
<style lang="scss">
.tag {
display: inline-flex;
align-items: center;
text-decoration: none;
.image {
border-radius: 50%;
}
}
</style>
......@@ -7,6 +7,7 @@
<template v-slot:footer>
<div class="f-1 opaque-7 mt-1">
<Duration :seconds="duration" :aria-label="$t('recording_duration')">{{ durationLabel }}</Duration> |
<app-time :date="productionDate" use-auto-distance :aria-label="$t('recording_production_date')"/>
</div>
</template>
......@@ -16,8 +17,10 @@
<script>
import { secondsToDuration } from '../../util'
import { recordingTracks } from './mixins'
import Duration from '../generic/Duration'
export default {
components: { Duration },
mixins: [recordingTracks],
props: {
recording: Object
......@@ -27,8 +30,10 @@
return new Date(this.recording.production_date)
},
duration () {
const totalDuration = this.recording.audio.reduce((total, audio) => total + audio.duration || 0, 0)
return secondsToDuration(totalDuration)
return this.recording.audio.reduce((total, audio) => total + audio.duration || 0, 0)
},
durationLabel () {
return secondsToDuration(this.duration)
}
}
}
......
......@@ -7,7 +7,7 @@
<div class="d-flex justify-center">
<a :href="url" v-t="label" v-for="{id, url, label} in links" :key="id"
class="mr-3" target="_blank"></a>
class="mr-3" target="_blank" rel="noopener"></a>
</div>
</footer>
</app-container>
......
......@@ -20,6 +20,7 @@ import Search from './generic/Search'
import Section from './generic/Section'
import Spinner from './generic/Spinner'
import SpinnerArea from './generic/SpinnerArea'
import Tag from './generic/Tag'
import Time from './generic/Time'
Vue.component('app-auto-grid', AutoGrid)
......@@ -41,4 +42,5 @@ Vue.component('app-search', Search)
Vue.component('app-section', Section)
Vue.component('app-spinner', Spinner)
Vue.component('app-spinner-area', SpinnerArea)
Vue.component('app-tag', Tag)
Vue.component('app-time', Time)
......@@ -82,7 +82,7 @@ export const createTrackServiceObservable = async (url, { timeOffsetSec = 0 }) =
observable.metadata = newMetadata ? {
...newMetadata,
id: 'livestream',
collectionId: 'livestream',
collectionId: 'livestream'
} : null
}
},
......
......@@ -25,10 +25,9 @@
</app-markdown>
</div>
<app-field>
<ul class="d-inline hyphens ma-0 pa-0 l-comma opaque-7">
<li v-for="(tagLabel, tagSlug) in recording.tags" :key="tagSlug" class="d-inline ma-0">
<router-link :to="{ name: 'tag', params: { slug: tagSlug } }" class="white"
:title="tagLabel">#{{ tagSlug }}</router-link>
<ul class="d-inline hyphens ma-0 pa-0 opaque-7">
<li v-for="tag in recording.tags" :key="tag.slug" class="d-inline ma-0">
<app-tag :tag="tag"/>
</li>
</ul>
</app-field>
......@@ -80,7 +79,7 @@
computed: {
similarRecordingFilters () {
return {
tags: Object.keys(this.recording.tags).join(','),
tags: this.recording.tags.map(t => t.slug).join(','),
omit: this.recording.id,
is_available: 1
}
......