diff --git a/app/Resources/icons/broadcast.svg b/app/Resources/icons/broadcast.svg new file mode 100644 index 00000000..3477f898 --- /dev/null +++ b/app/Resources/icons/broadcast.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/Resources/icons/money-dollar-circle.svg b/app/Resources/icons/money-dollar-circle.svg new file mode 100644 index 00000000..2910102a --- /dev/null +++ b/app/Resources/icons/money-dollar-circle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/Admin/Config/Routes.php b/modules/Admin/Config/Routes.php index dc32143a..126d4f13 100644 --- a/modules/Admin/Config/Routes.php +++ b/modules/Admin/Config/Routes.php @@ -179,6 +179,14 @@ $routes->group( ], ); }); + $routes->get('monetization-other', 'PodcastController::monetizationOther/$1', [ + 'as' => 'podcast-monetization-other', + 'filter' => 'permission:podcast#.edit', + ]); + $routes->post('monetization-other', 'PodcastController::monetizationOtherAction/$1', [ + 'as' => 'podcast-monetization-other', + 'filter' => 'permission:podcast#.edit', + ]); $routes->group('analytics', static function ($routes): void { $routes->get('/', 'PodcastController::viewAnalytics/$1', [ 'as' => 'podcast-analytics', diff --git a/modules/Admin/Controllers/PodcastController.php b/modules/Admin/Controllers/PodcastController.php index 3eece8b7..ea650a5a 100644 --- a/modules/Admin/Controllers/PodcastController.php +++ b/modules/Admin/Controllers/PodcastController.php @@ -198,15 +198,6 @@ class PodcastController extends BaseController ->with('errors', $this->validator->getErrors()); } - if ( - ($partnerId = $this->request->getPost('partner_id')) === '' || - ($partnerLinkUrl = $this->request->getPost('partner_link_url')) === '' || - ($partnerImageUrl = $this->request->getPost('partner_image_url')) === '') { - $partnerId = null; - $partnerLinkUrl = null; - $partnerImageUrl = null; - } - $db = db_connect(); $db->transStart(); @@ -231,13 +222,7 @@ class PodcastController extends BaseController 'location' => $this->request->getPost('location_name') === '' ? null : new Location( $this->request->getPost('location_name') ), - 'payment_pointer' => $this->request->getPost( - 'payment_pointer' - ) === '' ? null : $this->request->getPost('payment_pointer'), 'custom_rss_string' => $this->request->getPost('custom_rss'), - 'partner_id' => $partnerId, - 'partner_link_url' => $partnerLinkUrl, - 'partner_image_url' => $partnerImageUrl, 'is_blocked' => $this->request->getPost('block') === 'yes', 'is_completed' => $this->request->getPost('complete') === 'yes', 'is_locked' => $this->request->getPost('lock') === 'yes', @@ -311,15 +296,6 @@ class PodcastController extends BaseController ->with('errors', $this->validator->getErrors()); } - if ( - ($partnerId = $this->request->getPost('partner_id')) === '' || - ($partnerLinkUrl = $this->request->getPost('partner_link_url')) === '' || - ($partnerImageUrl = $this->request->getPost('partner_image_url')) === '') { - $partnerId = null; - $partnerLinkUrl = null; - $partnerImageUrl = null; - } - $this->podcast->updated_by = (int) user_id(); $this->podcast->title = $this->request->getPost('title'); @@ -341,16 +317,11 @@ class PodcastController extends BaseController $this->podcast->location = $this->request->getPost('location_name') === '' ? null : new Location( $this->request->getPost('location_name') ); - $this->podcast->payment_pointer = $this->request->getPost( - 'payment_pointer' - ) === '' ? null : $this->request->getPost('payment_pointer'); $this->podcast->custom_rss_string = $this->request->getPost('custom_rss'); $this->podcast->new_feed_url = $this->request->getPost('new_feed_url') === '' ? null : $this->request->getPost( 'new_feed_url' ); - $this->podcast->partner_id = $partnerId; - $this->podcast->partner_link_url = $partnerLinkUrl; - $this->podcast->partner_image_url = $partnerImageUrl; + $this->podcast->is_blocked = $this->request->getPost('block') === 'yes'; $this->podcast->is_completed = $this->request->getPost('complete') === 'yes'; @@ -395,6 +366,53 @@ class PodcastController extends BaseController ); } + public function monetizationOther(): string + { + helper('form'); + + $data = [ + 'podcast' => $this->podcast, + ]; + + replace_breadcrumb_params([ + 0 => $this->podcast->at_handle, + ]); + return view('podcast/monetization_other', $data); + } + + public function monetizationOtherAction(): RedirectResponse + { + if ( + ($partnerId = $this->request->getPost('partner_id')) === '' || + ($partnerLinkUrl = $this->request->getPost('partner_link_url')) === '' || + ($partnerImageUrl = $this->request->getPost('partner_image_url')) === '') { + $partnerId = null; + $partnerLinkUrl = null; + $partnerImageUrl = null; + } + + $this->podcast->payment_pointer = $this->request->getPost( + 'payment_pointer' + ) === '' ? null : $this->request->getPost('payment_pointer'); + + $this->podcast->partner_id = $partnerId; + $this->podcast->partner_link_url = $partnerLinkUrl; + $this->podcast->partner_image_url = $partnerImageUrl; + + $podcastModel = new PodcastModel(); + if (! $podcastModel->update($this->podcast->id, $this->podcast)) { + return redirect() + ->back() + ->withInput() + ->with('errors', $podcastModel->errors()); + } + + return redirect()->route('podcast-monetization-other', [$this->podcast->id])->with( + 'message', + lang('Podcast.messages.editSuccess') + ); + } + public function deleteBanner(): RedirectResponse { if (! $this->podcast->banner instanceof Image) { diff --git a/modules/Admin/Language/en/Common.php b/modules/Admin/Language/en/Common.php index 596c8bcd..74addcf2 100644 --- a/modules/Admin/Language/en/Common.php +++ b/modules/Admin/Language/en/Common.php @@ -40,6 +40,7 @@ return [ ], 'upload_file' => 'Upload a file', 'remote_url' => 'Remote URL', + 'save' => 'Save', ], 'play_episode_button' => [ 'play' => 'Play', diff --git a/modules/Admin/Language/en/PodcastNavigation.php b/modules/Admin/Language/en/PodcastNavigation.php index ef7ce917..f9c1fdc3 100644 --- a/modules/Admin/Language/en/PodcastNavigation.php +++ b/modules/Admin/Language/en/PodcastNavigation.php @@ -27,14 +27,15 @@ return [ 'podcast-analytics-players' => 'Players', 'podcast-analytics-listening-time' => 'Listening time', 'podcast-analytics-time-periods' => 'Time periods', - 'premium' => 'Premium', + 'monetization' => 'Monetization', 'subscription-list' => 'All subscriptions', 'subscription-create' => 'Add subscription', 'contributors' => 'Contributors', 'contributor-list' => 'All contributors', 'contributor-add' => 'Add contributor', - 'platforms' => 'External platforms', - 'platforms-podcasting' => 'Podcasting', + 'broadcast' => 'Broadcast', + 'platforms-podcasting' => 'Podcasting apps', 'platforms-social' => 'Social networks', - 'platforms-funding' => 'Funding', + 'platforms-funding' => 'Funding links', + 'podcast-monetization-other' => 'Other', ]; diff --git a/modules/Auth/Config/Routes.php b/modules/Auth/Config/Routes.php index ff718079..d2a69999 100644 --- a/modules/Auth/Config/Routes.php +++ b/modules/Auth/Config/Routes.php @@ -84,7 +84,7 @@ $routes->group( 'as' => 'contributor-list', 'filter' => 'permission:podcast#.manage-contributors', ]); - $routes->get('add', 'ContributorController::add/$1', [ + $routes->get('add', 'ContributorController::create/$1', [ 'as' => 'contributor-add', 'filter' => 'permission:podcast#.manage-contributors', ]); diff --git a/themes/cp_admin/_layout.php b/themes/cp_admin/_layout.php index 865465fc..aa452113 100644 --- a/themes/cp_admin/_layout.php +++ b/themes/cp_admin/_layout.php @@ -32,8 +32,8 @@ $isEpisodeArea = isset($podcast) && isset($episode); include('_partials/_nav_header') ?> include('_partials/_nav_aside') ?>
-
-
+
+
@@ -42,14 +42,15 @@ $isEpisodeArea = isset($podcast) && isset($episode); is_premium) ? lang('PremiumPodcasts.episode_is_premium') : lang('PremiumPodcasts.podcast_is_premium') ?> renderSection('pageTitle') ?>
- + renderSection('pageTitle') ?> - + renderSection('headerLeft') ?>
renderSection('headerRight') ?>
+ renderSection('subtitle') ?>
get('Import.current') === $podcast->handle): ?> diff --git a/themes/cp_admin/episode/create.php b/themes/cp_admin/episode/create.php index 90aff523..5c032152 100644 --- a/themes/cp_admin/episode/create.php +++ b/themes/cp_admin/episode/create.php @@ -216,9 +216,10 @@ hint="" /> + + - diff --git a/themes/cp_admin/episode/edit.php b/themes/cp_admin/episode/edit.php index 015e5d8e..43042c89 100644 --- a/themes/cp_admin/episode/edit.php +++ b/themes/cp_admin/episode/edit.php @@ -274,10 +274,10 @@ content="custom_rss_string) ?>" /> - - + + published_at === null): ?> diff --git a/themes/cp_admin/podcast/_sidebar.php b/themes/cp_admin/podcast/_sidebar.php index b0b02291..ef3c9e19 100644 --- a/themes/cp_admin/podcast/_sidebar.php +++ b/themes/cp_admin/podcast/_sidebar.php @@ -12,11 +12,6 @@ $podcastNavigation = [ 'count' => $podcast->getEpisodesCount(), 'count-route' => 'episode-list', ], - 'premium' => [ - 'icon' => 'exchange-dollar', - 'add-cta' => 'subscription-create', - 'items' => ['subscription-list', 'subscription-create'], - ], 'analytics' => [ 'icon' => 'line-chart', 'items' => [ @@ -29,6 +24,23 @@ $podcastNavigation = [ 'podcast-analytics-webpages', ], ], + 'broadcast' => [ + 'icon' => 'broadcast', + 'items' => [ + 'platforms-podcasting', + 'platforms-social', + ], + ], + 'monetization' => [ + 'icon' => 'money-dollar-circle', + 'add-cta' => 'subscription-create', + 'items' => [ + 'subscription-list', + 'subscription-create', + 'platforms-funding', + 'podcast-monetization-other', + ], + ], 'contributors' => [ 'icon' => 'group', 'items' => ['contributor-list', 'contributor-add'], @@ -36,14 +48,6 @@ $podcastNavigation = [ 'count' => count($podcast->contributors), 'count-route' => 'contributor-list', ], - 'platforms' => [ - 'icon' => 'link', - 'items' => [ - 'platforms-podcasting', - 'platforms-social', - 'platforms-funding', - ], - ], ]; ?> diff --git a/themes/cp_admin/podcast/create.php b/themes/cp_admin/podcast/create.php index 4615021e..a14f0950 100644 --- a/themes/cp_admin/podcast/create.php +++ b/themes/cp_admin/podcast/create.php @@ -177,34 +177,6 @@ - - - - -
- -
-
- - -
-
- - -
-
-
- - -
-
-
- diff --git a/themes/cp_admin/podcast/edit.php b/themes/cp_admin/podcast/edit.php index 9afbf98e..80332bfd 100644 --- a/themes/cp_admin/podcast/edit.php +++ b/themes/cp_admin/podcast/edit.php @@ -207,35 +207,6 @@ - - - - -
- -
-
- - -
-
- - -
-
-
- - -
-
-
- diff --git a/themes/cp_admin/podcast/monetization_other.php b/themes/cp_admin/podcast/monetization_other.php new file mode 100644 index 00000000..333f9ee3 --- /dev/null +++ b/themes/cp_admin/podcast/monetization_other.php @@ -0,0 +1,47 @@ +extend('_layout') ?> + +section('title') ?> + +endSection() ?> + +section('pageTitle') ?> + +endSection() ?> + +section('content') ?> + +
+ + + + + +
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ + + +
+endSection() ?> diff --git a/themes/cp_admin/podcast/platforms.php b/themes/cp_admin/podcast/platforms.php index 667db4da..02674fda 100644 --- a/themes/cp_admin/podcast/platforms.php +++ b/themes/cp_admin/podcast/platforms.php @@ -12,6 +12,10 @@ endSection() ?> +section('subtitle') ?> +

Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quod ex corporis sed et tenetur, doloremque nihil autem odio! Similique nemo in est magnam aspernatur temporibus a architecto quod cupiditate vitae!

+endSection() ?> + section('content') ?>