diff --git a/config/assets.php b/config/assets.php
index 08232c743..f986ee67a 100644
--- a/config/assets.php
+++ b/config/assets.php
@@ -496,6 +496,12 @@ return [
// Auto-managed by Assets
],
+ 'Vue_PublicSchedule' => [
+ 'order' => 10,
+ 'require' => ['vue-component-common', 'bootstrap-vue', 'moment_base', 'moment_timezone'],
+ // Auto-managed by Assets
+ ],
+
'Vue_PublicWebDJ' => [
'order' => 10,
'require' => ['vue-component-common'],
diff --git a/config/routes/public.php b/config/routes/public.php
index 2ecbd1a1f..2cf84cb90 100644
--- a/config/routes/public.php
+++ b/config/routes/public.php
@@ -33,6 +33,9 @@ return function (App $app) {
$group->get('/ondemand[/{embed:embed}]', Controller\Frontend\PublicPages\OnDemandAction::class)
->setName('public:ondemand');
+ $group->get('/schedule[/{embed:embed}]', Controller\Frontend\PublicPages\ScheduleAction::class)
+ ->setName('public:schedule');
+
$group->get('/podcasts', Controller\Frontend\PublicPages\PodcastsController::class)
->setName('public:podcasts');
diff --git a/frontend/vue/Public/Schedule.vue b/frontend/vue/Public/Schedule.vue
new file mode 100644
index 000000000..adec4c00f
--- /dev/null
+++ b/frontend/vue/Public/Schedule.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
diff --git a/frontend/vue/Stations/Profile/EmbedModal.vue b/frontend/vue/Stations/Profile/EmbedModal.vue
index 7e3284eba..41e63cd17 100644
--- a/frontend/vue/Stations/Profile/EmbedModal.vue
+++ b/frontend/vue/Stations/Profile/EmbedModal.vue
@@ -72,7 +72,8 @@ export const profileEmbedModalProps = {
publicPageEmbedUri: String,
publicOnDemandEmbedUri: String,
publicRequestEmbedUri: String,
- publicHistoryEmbedUri: String
+ publicHistoryEmbedUri: String,
+ publicScheduleEmbedUri: String
}
};
@@ -88,6 +89,10 @@ export default {
{
value: 'history',
text: this.$gettext('History')
+ },
+ {
+ value: 'schedule',
+ text: this.$gettext('Schedule')
}
];
@@ -142,6 +147,9 @@ export default {
case 'requests':
return this.publicRequestEmbedUri;
+ case 'schedule':
+ return this.publicScheduleEmbedUri;
+
case 'player':
default:
return this.publicPageEmbedUri;
@@ -170,6 +178,9 @@ export default {
case 'history':
return '300px';
+ case 'schedule':
+ return '800px'
+
case 'player':
default:
return '150px';
diff --git a/frontend/vue/Stations/Profile/PublicPagesPanel.vue b/frontend/vue/Stations/Profile/PublicPagesPanel.vue
index 3c81ad12f..f768ed2ef 100644
--- a/frontend/vue/Stations/Profile/PublicPagesPanel.vue
+++ b/frontend/vue/Stations/Profile/PublicPagesPanel.vue
@@ -37,6 +37,12 @@
{{ publicPodcastsUri }}
+
+ Schedule |
+
+ {{ publicScheduleUri }}
+ |
+
@@ -85,6 +91,7 @@ export const profilePublicProps = {
publicWebDjUri: String,
publicOnDemandUri: String,
publicPodcastsUri: String,
+ publicScheduleUri: String,
togglePublicPageUri: String
}
};
diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js
index e748026d0..ddbed7baa 100644
--- a/frontend/webpack.config.js
+++ b/frontend/webpack.config.js
@@ -13,6 +13,7 @@ module.exports = {
PublicOnDemand: './vue/Public/OnDemand.vue',
PublicPlayer: './vue/Public/Player.vue',
PublicRequests: './vue/Public/Requests.vue',
+ PublicSchedule: './vue/Public/Schedule.vue',
PublicWebDJ: './vue/Public/WebDJ.vue',
StationsMedia: './vue/Stations/Media.vue',
StationsMounts: './vue/Stations/Mounts.vue',
diff --git a/src/Controller/Frontend/PublicPages/ScheduleAction.php b/src/Controller/Frontend/PublicPages/ScheduleAction.php
new file mode 100644
index 000000000..812b149a2
--- /dev/null
+++ b/src/Controller/Frontend/PublicPages/ScheduleAction.php
@@ -0,0 +1,36 @@
+withHeader('X-Frame-Options', '*');
+
+ $station = $request->getStation();
+
+ if (!$station->getEnablePublicPage()) {
+ throw new StationNotFoundException();
+ }
+
+ return $request->getView()->renderToResponse(
+ $response,
+ 'frontend/public/schedule',
+ [
+ 'embed' => $embed,
+ 'station' => $station,
+ 'station_tz' => $station->getTimezone(),
+ ]
+ );
+ }
+}
diff --git a/templates/frontend/public/schedule.phtml b/templates/frontend/public/schedule.phtml
new file mode 100644
index 000000000..d32da67d0
--- /dev/null
+++ b/templates/frontend/public/schedule.phtml
@@ -0,0 +1,33 @@
+getShortName();
+if ($embed) {
+ $pageClass .= ' embed';
+}
+
+$this->layout(
+ 'minimal',
+ [
+ 'page_class' => $pageClass,
+ 'title' => __('Schedule') . ' - ' . $this->e($station->getName()),
+ 'hide_footer' => true,
+ ]
+);
+
+$props = [
+ 'scheduleUrl' => (string)$router->named('api:stations:schedule', ['station_id' => $station->getId()]),
+ 'stationName' => $station->getName(),
+ 'locale' => substr($customization->getLocale()->getLocale(), 0, 2),
+ 'stationTimeZone' => $station_tz,
+];
+
+/** @var \App\Assets $assets */
+$assets->addVueRender('Vue_PublicSchedule', '#station-schedule', $props);
+?>
+
+
diff --git a/templates/stations/profile/index.phtml b/templates/stations/profile/index.phtml
index 1b00995d7..13b508827 100644
--- a/templates/stations/profile/index.phtml
+++ b/templates/stations/profile/index.phtml
@@ -72,6 +72,12 @@ $props = [
[],
true
),
+ 'publicScheduleUri' => (string)$router->named(
+ 'public:schedule',
+ ['station_id' => $station->getShortName()],
+ [],
+ true
+ ),
'publicOnDemandEmbedUri' => (string)$router->named(
'public:ondemand',
['station_id' => $station->getShortName(), 'embed' => 'embed'],
@@ -90,6 +96,12 @@ $props = [
[],
true
),
+ 'publicScheduleEmbedUri' => (string)$router->named(
+ 'public:schedule',
+ ['station_id' => $station->getShortName(), 'embed' => 'embed'],
+ [],
+ true
+ ),
'togglePublicPageUri' => $router->fromHere(
'stations:profile:toggle',