diff --git a/app/Controllers/Admin/Podcast.php b/app/Controllers/Admin/Podcast.php index 10c153a699bbc0eb9c38a3696d78fad0a2c7a20e..359bee6162189fb9ec16bbc53ef6c8f9e0cd37a4 100644 --- a/app/Controllers/Admin/Podcast.php +++ b/app/Controllers/Admin/Podcast.php @@ -161,6 +161,7 @@ class Podcast extends BaseController 'publisher' => $this->request->getPost('publisher'), 'type' => $this->request->getPost('type'), 'copyright' => $this->request->getPost('copyright'), + 'payment_pointer' => $this->request->getPost('payment_pointer'), 'is_blocked' => $this->request->getPost('is_blocked') === 'yes', 'is_completed' => $this->request->getPost('complete') === 'yes', 'is_locked' => $this->request->getPost('lock') === 'yes', @@ -253,6 +254,9 @@ class Podcast extends BaseController $this->podcast->owner_email = $this->request->getPost('owner_email'); $this->podcast->type = $this->request->getPost('type'); $this->podcast->copyright = $this->request->getPost('copyright'); + $this->podcast->payment_pointer = $this->request->getPost( + 'payment_pointer' + ); $this->podcast->is_blocked = $this->request->getPost('is_blocked') === 'yes'; $this->podcast->is_completed = diff --git a/app/Database/Migrations/2020-05-30-101500_add_podcasts.php b/app/Database/Migrations/2020-05-30-101500_add_podcasts.php index 3ba966f8d378fc19b3b74252c53422a4d1a0b28e..30ba95eda53643c70c1f13432c211fca6a8356fd 100644 --- a/app/Database/Migrations/2020-05-30-101500_add_podcasts.php +++ b/app/Database/Migrations/2020-05-30-101500_add_podcasts.php @@ -117,6 +117,12 @@ class AddPodcasts extends Migration 'The RSS new feed URL if this podcast is moving out, NULL otherwise.', 'null' => true, ], + 'payment_pointer' => [ + 'type' => 'VARCHAR', + 'constraint' => 128, + 'comment' => 'Wallet address for Web Monetization payments', + 'null' => true, + ], 'created_by' => [ 'type' => 'INT', 'unsigned' => true, diff --git a/app/Entities/Podcast.php b/app/Entities/Podcast.php index d86851c541900c6f40bd3cbcc42efd582647010c..8b8076b5b43defbda3b63b32619f958e25e7c227 100644 --- a/app/Entities/Podcast.php +++ b/app/Entities/Podcast.php @@ -96,6 +96,7 @@ class Podcast extends Entity 'is_locked' => 'boolean', 'imported_feed_url' => '?string', 'new_feed_url' => '?string', + 'payment_pointer' => '?string', 'created_by' => 'integer', 'updated_by' => 'integer', ]; diff --git a/app/Helpers/rss_helper.php b/app/Helpers/rss_helper.php index e7bc4ffbdab5458198cfb62d0b08ffabae02db18..8b9f9adc06d9d28ceb91d23d9b67404aee960148 100644 --- a/app/Helpers/rss_helper.php +++ b/app/Helpers/rss_helper.php @@ -65,6 +65,14 @@ function get_rss_feed($podcast, $serviceName = '') $itunes_image = $channel->addChild('image', null, $itunes_namespace); $itunes_image->addAttribute('href', $podcast->image->original_url); $channel->addChild('language', $podcast->language_code); + + if (!empty($podcast->payment_pointer)) { + $channel->addChild( + 'monetization', + $podcast->payment_pointer, + $podcast_namespace + ); + } $channel ->addChild( 'locked', diff --git a/app/Language/en/Podcast.php b/app/Language/en/Podcast.php index acf88d9f22b71a4f0a3ce886ee44cfa404c20440..7e7c7378d2db8ed3c061ff82cbdd1b063d4fdf06 100644 --- a/app/Language/en/Podcast.php +++ b/app/Language/en/Podcast.php @@ -61,6 +61,12 @@ return [ 'publisher_hint' => 'The group responsible for creating the show. Often refers to the parent company or network of a podcast. This field is sometimes labeled as ’Author’.', 'copyright' => 'Copyright', + 'monetization_section_title' => 'Monetization', + 'monetization_section_subtitle' => + 'Earn money thanks to your audience.', + 'payment_pointer' => 'Payment Pointer for Web Monetization', + 'payment_pointer_hint' => + 'This is your where you will receive money thanks to Web Monetization', 'status_section_title' => 'Status', 'status_section_subtitle' => 'Dead or alive?', 'block' => 'Podcast should be hidden from all platforms', diff --git a/app/Language/fr/Podcast.php b/app/Language/fr/Podcast.php index 117a8bb789dc0267e0313c39cb3e178268ad2a46..754d3af776583bd5e67ebe86d72d57df07c4ed11 100644 --- a/app/Language/fr/Podcast.php +++ b/app/Language/fr/Podcast.php @@ -62,6 +62,13 @@ return [ 'publisher_hint' => 'Le groupe responsable de la création du podcast. Fait souvent référence à la société mère ou au réseau d’un podcast. Ce champ est parfois appelé « Auteur ».', 'copyright' => 'Droit d’auteur', + 'monetization_section_title' => 'Monétisation', + 'monetization_section_subtitle' => + 'Gagnez de l’argent grâce à votre audience.', + 'payment_pointer' => + 'Adresse de paiement (Payment Pointer) pour Web Monetization', + 'payment_pointer_hint' => + 'L’adresse où vous recevrez de l’argent grâce à Web Monetization', 'status_section_title' => 'Statut', 'status_section_subtitle' => 'Vivant ou mort ?', 'block' => 'Le podcast doit être masqué sur toutes les plateformes', diff --git a/app/Models/PodcastModel.php b/app/Models/PodcastModel.php index 7ac59412d69fdf68437168d4fb50cd1ff496c289..ee14d835d82aaa72ada396194ac458389877d115 100644 --- a/app/Models/PodcastModel.php +++ b/app/Models/PodcastModel.php @@ -37,6 +37,7 @@ class PodcastModel extends Model 'is_blocked', 'is_completed', 'is_locked', + 'payment_pointer', 'created_by', 'updated_by', ]; diff --git a/app/Views/admin/podcast/create.php b/app/Views/admin/podcast/create.php index 0196b6fb0ea3b7386d47d6085db937aa42e65ca5..8ee46f8faa00a97abd457577911677a0154eb865 100644 --- a/app/Views/admin/podcast/create.php +++ b/app/Views/admin/podcast/create.php @@ -241,6 +241,24 @@ <?= form_section_close() ?> +<?= form_section( + lang('Podcast.form.monetization_section_title'), + lang('Podcast.form.monetization_section_subtitle') +) ?> + +<?= form_label( + lang('Podcast.form.payment_pointer'), + 'payment_pointer', + [], + lang('Podcast.form.payment_pointer_hint') +) ?> +<?= form_input([ + 'id' => 'payment_pointer', + 'name' => 'payment_pointer', + 'class' => 'form-input mb-4', + 'value' => old('payment_pointer'), +]) ?> +<?= form_section_close() ?> <?= form_section( lang('Podcast.form.status_section_title'), @@ -249,10 +267,7 @@ <?= form_switch( lang('Podcast.form.block'), - [ - 'id' => 'block', - 'name' => 'block', - ], + ['id' => 'block', 'name' => 'block'], 'yes', old('block', false), 'mb-2' @@ -260,10 +275,7 @@ <?= form_switch( lang('Podcast.form.complete'), - [ - 'id' => 'complete', - 'name' => 'complete', - ], + ['id' => 'complete', 'name' => 'complete'], 'yes', old('complete', false), 'mb-2' @@ -279,7 +291,6 @@ <?= form_section_close() ?> - <?= button( lang('Podcast.form.submit_create'), null, diff --git a/app/Views/admin/podcast/edit.php b/app/Views/admin/podcast/edit.php index 664bfd05afc014c9b5bdaba3222260f2c97ccd9e..2dc632901e6b4e226e753e225c509a015b67ccfd 100644 --- a/app/Views/admin/podcast/edit.php +++ b/app/Views/admin/podcast/edit.php @@ -251,6 +251,24 @@ <?= form_section_close() ?> +<?= form_section( + lang('Podcast.form.monetization_section_title'), + lang('Podcast.form.monetization_section_subtitle') +) ?> + +<?= form_label( + lang('Podcast.form.payment_pointer'), + 'payment_pointer', + [], + lang('Podcast.form.payment_pointer_hint') +) ?> +<?= form_input([ + 'id' => 'payment_pointer', + 'name' => 'payment_pointer', + 'class' => 'form-input mb-4', + 'value' => old('payment_pointer', $podcast->payment_pointer), +]) ?> +<?= form_section_close() ?> <?= form_section( lang('Podcast.form.status_section_title'), diff --git a/app/Views/episode.php b/app/Views/episode.php index f97ff3872ca7ab6c56f0ca1212eef0017269e8f3..4b04a7d3b78e792b67cc7e7421cc64fe977bc1cd 100644 --- a/app/Views/episode.php +++ b/app/Views/episode.php @@ -7,6 +7,10 @@ <title><?= $episode->title ?></title> <meta name="description" content="<?= $episode->description ?>"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> +<?php if ( + !empty($podcast->payment_pointer) +): ?> <meta name="monetization" content="<?= $podcast->payment_pointer ?>"> +<?php endif; ?> <link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="stylesheet" href="/assets/index.css"/> <link rel="canonical" href="<?= current_url() ?>" /> diff --git a/app/Views/podcast.php b/app/Views/podcast.php index e8f5d659d22c43548bef34c091428ebbc4c4e14e..3d013d0d42d6cb9b7710a115f8a0a6adccaadf94 100644 --- a/app/Views/podcast.php +++ b/app/Views/podcast.php @@ -8,6 +8,10 @@ <title><?= $podcast->title ?></title> <meta name="description" content="<?= $podcast->description ?>"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> +<?php if ( + !empty($podcast->payment_pointer) +): ?> <meta name="monetization" content="<?= $podcast->payment_pointer ?>"> +<?php endif; ?> <link rel="shortcut icon" type="image/png" href="/favicon.ico" /> <link rel="stylesheet" href="/assets/index.css"/> <link rel="canonical" href="<?= current_season_url() ?>" /> diff --git a/sha1sum b/sha1sum deleted file mode 100644 index 9daeafb9864cf43055ae93beb0afd6c7d144bfa4..0000000000000000000000000000000000000000 --- a/sha1sum +++ /dev/null @@ -1 +0,0 @@ -test