From 746b5187898c7f61900ef4b8f49029f0989fd1fa Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Mon, 20 Sep 2021 15:45:38 +0000 Subject: [PATCH] refactor: replace ui function components with class components + fix soundbites js --- DEPENDENCIES.md | 2 +- app/Helpers/components_helper.php | 154 ++--------- app/Helpers/form_helper.php | 131 --------- app/Resources/js/modules/Soundbites.ts | 48 ++-- app/Resources/styles/layout.css | 2 +- app/Views/Components/Alert.php | 2 +- app/Views/Components/Forms/Field.php | 15 +- app/Views/Components/Forms/Helper.php | 2 +- app/Views/Components/Forms/Select.php | 8 +- app/Views/Components/IconButton.php | 18 +- .../Admin/Controllers/EpisodeController.php | 48 ++-- .../Install/Controllers/InstallController.php | 2 +- modules/Install/Language/en/Install.php | 1 + modules/Install/Language/fr/Install.php | 1 + themes/cp_admin/contributor/list.php | 37 +-- themes/cp_admin/episode/create.php | 10 +- themes/cp_admin/episode/edit.php | 10 +- themes/cp_admin/episode/list.php | 5 +- themes/cp_admin/episode/persons.php | 18 +- themes/cp_admin/episode/publish.php | 2 +- themes/cp_admin/episode/publish_edit.php | 2 +- themes/cp_admin/episode/soundbites.php | 254 ++++-------------- themes/cp_admin/fediverse/blocked_actors.php | 18 +- themes/cp_admin/fediverse/blocked_domains.php | 16 +- themes/cp_admin/page/create.php | 3 - themes/cp_admin/page/list.php | 38 +-- themes/cp_admin/page/view.php | 5 +- themes/cp_admin/person/create.php | 8 +- themes/cp_admin/person/edit.php | 8 +- themes/cp_admin/person/list.php | 12 +- themes/cp_admin/person/view.php | 12 +- themes/cp_admin/podcast/create.php | 14 +- themes/cp_admin/podcast/edit.php | 26 +- themes/cp_admin/podcast/import.php | 6 +- themes/cp_admin/podcast/list.php | 17 +- themes/cp_admin/podcast/persons.php | 25 +- themes/cp_admin/podcast/platforms.php | 6 +- themes/cp_admin/podcast/view.php | 17 +- themes/cp_admin/user/create.php | 56 ++-- themes/cp_admin/user/edit.php | 27 +- themes/cp_admin/user/list.php | 57 +--- themes/cp_app/embeddable_player.php | 6 +- .../comment_actions_authenticated.php | 8 +- ...omment_actions_from_post_authenticated.php | 8 +- .../comment_reply_actions_authenticated.php | 8 +- .../comment_with_replies_authenticated.php | 47 +--- .../post_with_replies_authenticated.php | 47 +--- .../cp_app/podcast/activity_authenticated.php | 61 ++--- .../cp_app/podcast/episode_authenticated.php | 98 ++----- themes/cp_app/podcast/follow.php | 39 +-- themes/cp_app/podcast/post_remote_action.php | 44 +-- themes/cp_auth/forgot.php | 35 +-- themes/cp_auth/login.php | 46 +--- themes/cp_auth/register.php | 63 ++--- themes/cp_auth/reset.php | 62 ++--- themes/cp_install/_layout.php | 2 +- themes/cp_install/cache_config.php | 49 ++-- themes/cp_install/create_superadmin.php | 66 ++--- themes/cp_install/database_config.php | 106 +++----- themes/cp_install/instance_config.php | 104 +++---- 60 files changed, 507 insertions(+), 1535 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 7819536e..f8bc6771 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -52,7 +52,7 @@ Other: - [Kumbh Sans](https://fonts.google.com/specimen/Kumbh+Sans) ([Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)) -- [Montserrat](https://fonts.google.com/specimen/Montserrat) +- [Inter](https://fonts.google.com/specimen/Inter) ([Open Font License](https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)) - [RemixIcon](https://remixicon.com/) ([Apache License 2.0](https://github.com/Remix-Design/RemixIcon/blob/master/License)) diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php index 45d12a15..a858da80 100644 --- a/app/Helpers/components_helper.php +++ b/app/Helpers/components_helper.php @@ -12,140 +12,6 @@ use App\Entities\Person; use CodeIgniter\I18n\Time; use CodeIgniter\View\Table; -if (! function_exists('button')) { - /** - * Button component - * - * Creates a stylized button or button like anchor tag if the URL is defined. - * - * @param array $customOptions button options: variant, size, iconLeft, iconRight - * @param array $customAttributes Additional attributes - */ - function button( - string $label = '', - string $uri = '', - array $customOptions = [], - array $customAttributes = [] - ): string { - $defaultOptions = [ - 'variant' => 'default', - 'size' => 'base', - 'iconLeft' => null, - 'iconRight' => null, - 'isSquared' => false, - ]; - $options = array_merge($defaultOptions, $customOptions); - - $baseClass = - 'inline-flex items-center font-semibold shadow-xs rounded-full focus:outline-none focus:ring'; - - $variantClass = [ - 'default' => 'text-black bg-gray-300 hover:bg-gray-400', - 'primary' => 'text-white bg-pine-500 hover:bg-pine-800', - 'secondary' => 'text-white bg-gray-700 hover:bg-gray-800', - 'accent' => 'text-white bg-rose-600 hover:bg-rose-800', - 'success' => 'text-white bg-green-600 hover:bg-green-700', - 'danger' => 'text-white bg-red-600 hover:bg-red-700', - 'warning' => 'text-black bg-yellow-500 hover:bg-yellow-600', - 'info' => 'text-white bg-blue-500 hover:bg-blue-600', - ]; - - $sizeClass = [ - 'small' => 'text-xs md:text-sm', - 'base' => 'text-sm md:text-base', - 'large' => 'text-lg md:text-xl', - ]; - - $basePaddings = [ - 'small' => 'px-2 md:px-3 md:py-1', - 'base' => 'px-3 py-1 md:px-4 md:py-2', - 'large' => 'px-3 py-2 md:px-5', - ]; - - $squaredPaddings = [ - 'small' => 'p-1', - 'base' => 'p-2', - 'large' => 'p-3', - ]; - - $buttonClass = - $baseClass . - ' ' . - ($options['isSquared'] - ? $squaredPaddings[$options['size']] - : $basePaddings[$options['size']]) . - ' ' . - $sizeClass[$options['size']] . - ' ' . - $variantClass[$options['variant']]; - - if (array_key_exists('class', $customAttributes)) { - $buttonClass .= ' ' . $customAttributes['class']; - unset($customAttributes['class']); - } - - if ($options['iconLeft']) { - $label = icon((string) $options['iconLeft'], 'mr-2') . $label; - } - - if ($options['iconRight']) { - $label .= icon((string) $options['iconRight'], 'ml-2'); - } - - if ($uri !== '') { - return anchor($uri, $label, array_merge([ - 'class' => $buttonClass, - ], $customAttributes)); - } - - $defaultButtonAttributes = [ - 'type' => 'button', - ]; - $attributes = stringify_attributes(array_merge($defaultButtonAttributes, $customAttributes)); - - return << - {$label} - - CODE_SAMPLE; - } -} - -// ------------------------------------------------------------------------ - -if (! function_exists('icon_button')) { - /** - * Icon Button component - * - * Abstracts the `button()` helper to create a stylized icon button - * - * @param string $icon The button icon - * @param string $title The button label - * @param array $customOptions button options: variant, size, iconLeft, iconRight - * @param array $customAttributes Additional attributes - */ - function icon_button( - string $icon, - string $title, - string $uri = '', - array $customOptions = [], - array $customAttributes = [] - ): string { - $defaultOptions = [ - 'isSquared' => true, - ]; - $options = array_merge($defaultOptions, $customOptions); - - $defaultAttributes = [ - 'title' => $title, - 'data-toggle' => 'tooltip', - 'data-placement' => 'bottom', - ]; - $attributes = array_merge($defaultAttributes, $customAttributes); - - return button(icon($icon), $uri, $options, $attributes); - } -} // ------------------------------------------------------------------------ if (! function_exists('hint_tooltip')) { @@ -296,13 +162,14 @@ if (! function_exists('publication_button')) { break; } - return button($label, $route, [ - 'variant' => $variant, - 'iconLeft' => $iconLeft, - ]); + return <<{$label} + CODE_SAMPLE; } } + // ------------------------------------------------------------------------ + if (! function_exists('episode_numbering')) { /** * Returns relevant translated episode numbering. @@ -354,6 +221,9 @@ if (! function_exists('episode_numbering')) { ''; } } + +// ------------------------------------------------------------------------ + if (! function_exists('location_link')) { /** * Returns link to display from location info @@ -377,7 +247,9 @@ if (! function_exists('location_link')) { ); } } + // ------------------------------------------------------------------------ + if (! function_exists('person_list')) { /** * Returns list of persons images @@ -430,7 +302,9 @@ if (! function_exists('person_list')) { return $personList . ''; } } + // ------------------------------------------------------------------------ + if (! function_exists('play_episode_button')) { /** * Returns play episode button @@ -462,7 +336,9 @@ if (! function_exists('play_episode_button')) { CODE_SAMPLE; } } + // ------------------------------------------------------------------------ + if (! function_exists('audio_player')) { /** * Returns audio player @@ -500,7 +376,9 @@ if (! function_exists('audio_player')) { CODE_SAMPLE; } } + // ------------------------------------------------------------------------ + if (! function_exists('relative_time')) { function relative_time(Time $time, string $class = ''): string { diff --git a/app/Helpers/form_helper.php b/app/Helpers/form_helper.php index 3ff660bd..5b732a2e 100644 --- a/app/Helpers/form_helper.php +++ b/app/Helpers/form_helper.php @@ -8,137 +8,6 @@ declare(strict_types=1); * @link https://castopod.org/ */ -if (! function_exists('form_section')) { - /** - * Form section - * - * Used to produce a responsive form section with a title and subtitle. To close section, use form_section_close() - * - * @param string $title The section title - * @param string $subtitle The section subtitle - * @param array $attributes Additional attributes - */ - function form_section( - string $title = '', - string $subtitle = '', - array $attributes = [], - string $customSubtitleClass = '' - ): string { - $subtitleClass = 'text-sm text-gray-600'; - if ($customSubtitleClass !== '') { - $subtitleClass = $customSubtitleClass; - } - - $section = - '
\n"; - - $info = - '

' . - $title . - '

' . - $subtitle . - '

'; - - return $section . $info . '
'; - } -} - -//-------------------------------------------------------------------- - -if (! function_exists('form_section_close')) { - /** - * Form Section close Tag - */ - function form_section_close(string $extra = ''): string - { - return '
' . $extra; - } -} - -//-------------------------------------------------------------------- - -if (! function_exists('form_switch')) { - /** - * Form Checkbox Switch - * - * Abstracts form_label to stylize it as a switch toggle - * - * @param mixed[] $data - * @param mixed[] $extra - */ - function form_switch( - string $label = '', - array $data = [], - string $value = '', - bool $checked = false, - string $class = '', - array $extra = [] - ): string { - $data['class'] = 'form-switch'; - - return ''; - } -} - -//-------------------------------------------------------------------- - -if (! function_exists('form_label')) { - /** - * Form Label Tag - * - * @param string $text The text to appear onscreen - * @param string $id The id the label applies to - * @param array $attributes Additional attributes - * @param string $hintText Hint text to add next to the label - * @param boolean $isOptional adds an optional text if true - */ - function form_label( - string $text = '', - string $id = '', - array $attributes = [], - string $hintText = '', - bool $isOptional = false - ): string { - $label = ' $val) { - $label .= ' ' . $key . '="' . $val . '"'; - } - } - - $labelContent = $text; - if ($isOptional) { - $labelContent .= - '(' . - lang('Common.optional') . - ')'; - } - - if ($hintText !== '') { - $labelContent .= hint_tooltip($hintText, 'ml-1'); - } - - return $label . '>' . $labelContent . ''; - } -} - //-------------------------------------------------------------------- if (! function_exists('form_dropdown')) { diff --git a/app/Resources/js/modules/Soundbites.ts b/app/Resources/js/modules/Soundbites.ts index 64833bc1..ce17a716 100644 --- a/app/Resources/js/modules/Soundbites.ts +++ b/app/Resources/js/modules/Soundbites.ts @@ -59,36 +59,28 @@ const Soundbites = (): void => { if (soundbitePlayButtons) { for (let i = 0; i < soundbitePlayButtons.length; i++) { const soundbitePlayButton: HTMLButtonElement = soundbitePlayButtons[i]; - soundbitePlayButton.addEventListener("click", () => { - playSoundbite( - audioPlayer, - Number(soundbitePlayButton.dataset.soundbiteStartTime), - Number(soundbitePlayButton.dataset.soundbiteDuration) - ); - }); - } - } - const inputFields: NodeListOf | null = - document.querySelectorAll("input[data-type='soundbite-field']"); - if (inputFields) { - for (let i = 0; i < inputFields.length; i++) { - const inputField: HTMLInputElement = inputFields[i]; - const soundbitePlayButton: HTMLButtonElement | null = - document.querySelector( - `button[data-type="play-soundbite"][data-soundbite-id="${inputField.dataset.soundbiteId}"]` - ); - if (soundbitePlayButton) { - if (inputField.dataset.fieldType == "start-time") { - inputField.addEventListener("input", () => { - soundbitePlayButton.dataset.soundbiteStartTime = inputField.value; - }); - } else if (inputField.dataset.fieldType == "duration") { - inputField.addEventListener("input", () => { - soundbitePlayButton.dataset.soundbiteDuration = inputField.value; - }); + soundbitePlayButton.addEventListener("click", () => { + // get values from inputs to play soundbite + const startTime: HTMLInputElement | null | undefined = + soundbitePlayButton.parentElement?.parentElement?.querySelector( + 'input[data-field-type="start_time"]' + ); + const duration: HTMLInputElement | null | undefined = + soundbitePlayButton.parentElement?.parentElement?.querySelector( + 'input[data-field-type="duration"]' + ); + + console.log(soundbitePlayButton.parentElement); + + if (startTime && duration) { + playSoundbite( + audioPlayer, + parseFloat(startTime.value), + parseFloat(duration.value) + ); } - } + }); } } } diff --git a/app/Resources/styles/layout.css b/app/Resources/styles/layout.css index 8faf449d..61b88e4c 100644 --- a/app/Resources/styles/layout.css +++ b/app/Resources/styles/layout.css @@ -15,7 +15,7 @@ } & .holy-grail__main { - @apply col-start-1 col-end-3 row-start-2 row-end-3; + @apply col-start-1 col-end-3 row-start-2 row-end-4; } & .holy-grail__footer { diff --git a/app/Views/Components/Alert.php b/app/Views/Components/Alert.php index 478c42c2..41cf3bc5 100644 --- a/app/Views/Components/Alert.php +++ b/app/Views/Components/Alert.php @@ -33,7 +33,7 @@ class Alert extends Component $attributes = stringify_attributes($this->attributes); return <<{$glyph}
{$title}{$this->slot}
+ HTML; } } diff --git a/app/Views/Components/Forms/Field.php b/app/Views/Components/Forms/Field.php index 10ec65da..dd70c639 100644 --- a/app/Views/Components/Forms/Field.php +++ b/app/Views/Components/Forms/Field.php @@ -10,20 +10,25 @@ class Field extends FormComponent protected string $label = ''; - protected ?string $helperText = null; + protected ?string $helper = null; - protected ?string $hintText = null; + protected ?string $hint = null; public function render(): string { - $helperText = $this->helperText === null ? '' : '' . $this->helperText . ''; + $helperText = ''; + if ($this->helper !== null) { + $helperId = $this->id . 'Help'; + $helperText = '' . $this->helper . ''; + $this->attributes['aria-describedby'] = $helperId; + } $labelAttributes = [ 'for' => $this->id, 'isOptional' => $this->required ? 'false' : 'true', ]; - if ($this->hintText) { - $labelAttributes['hint'] = $this->hintText; + if ($this->hint) { + $labelAttributes['hint'] = $this->hint; } $labelAttributes = stringify_attributes($labelAttributes); diff --git a/app/Views/Components/Forms/Helper.php b/app/Views/Components/Forms/Helper.php index 158fd3de..866a3b0f 100644 --- a/app/Views/Components/Forms/Helper.php +++ b/app/Views/Components/Forms/Helper.php @@ -16,7 +16,7 @@ class Helper extends FormComponent $class = 'text-gray-600'; return <<{$this->slot} + {$this->slot} HTML; } } diff --git a/app/Views/Components/Forms/Select.php b/app/Views/Components/Forms/Select.php index 2b8f4521..3cfd062e 100644 --- a/app/Views/Components/Forms/Select.php +++ b/app/Views/Components/Forms/Select.php @@ -15,17 +15,17 @@ class Select extends FormComponent public function setOptions(string $value): void { - // dd(json_decode(html_entity_decode(html_entity_decode($value)), true)); $this->options = json_decode(html_entity_decode($value), true); } public function render(): string { $defaultAttributes = [ - 'data-class' => 'border-3 rounded-lg ' . $this->class, + 'class' => 'focus:border-black focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 border-3 rounded-lg border-black ' . $this->class, + 'data-class' => $this->class, ]; - $extra = array_merge($defaultAttributes, $this->attributes); + $extra = array_merge($this->attributes, $defaultAttributes); - return form_dropdown($this->name, $this->options, $this->selected !== '' ? [$this->selected] : [], $extra); + return form_dropdown($this->name, $this->options, old($this->name, $this->selected !== '' ? [$this->selected] : []), $extra); } } diff --git a/app/Views/Components/IconButton.php b/app/Views/Components/IconButton.php index 574cc817..d11199ae 100644 --- a/app/Views/Components/IconButton.php +++ b/app/Views/Components/IconButton.php @@ -12,10 +12,20 @@ class IconButton extends Component public function render(): string { - $attributes = stringify_attributes($this->attributes); + $attributes = [ + 'isSquared' => 'true', + 'title' => $this->slot, + 'data-toggle' => 'tooltip', + 'data-placement' => 'bottom', + ]; - return << - HTML; + $attributes = array_merge($attributes, $this->attributes); + + $attributes['slot'] = icon($this->glyph); + + unset($attributes['glyph']); + + $iconButton = new Button($attributes); + return $iconButton->render(); } } diff --git a/modules/Admin/Controllers/EpisodeController.php b/modules/Admin/Controllers/EpisodeController.php index 8716e641..026a6255 100644 --- a/modules/Admin/Controllers/EpisodeController.php +++ b/modules/Admin/Controllers/EpisodeController.php @@ -722,6 +722,7 @@ class EpisodeController extends BaseController "soundbites.{$soundbite_id}.duration" => 'required|decimal|greater_than_equal_to[0]', ]; } + if (! $this->validate($rules)) { return redirect() ->back() @@ -730,34 +731,33 @@ class EpisodeController extends BaseController } foreach ($soundbites as $soundbite_id => $soundbite) { - if ((int) $soundbite['start_time'] < (int) $soundbite['duration']) { - $data = [ - 'podcast_id' => $this->podcast->id, - 'episode_id' => $this->episode->id, - 'start_time' => (float) $soundbite['start_time'], - 'duration' => (float) $soundbite['duration'], - 'label' => $soundbite['label'], - 'updated_by' => user_id(), + $data = [ + 'podcast_id' => $this->podcast->id, + 'episode_id' => $this->episode->id, + 'start_time' => (float) $soundbite['start_time'], + 'duration' => (float) $soundbite['duration'], + 'label' => $soundbite['label'], + 'updated_by' => user_id(), + ]; + if ($soundbite_id === 0) { + $data += [ + 'created_by' => user_id(), ]; - if ($soundbite_id === 0) { - $data += [ - 'created_by' => user_id(), - ]; - } else { - $data += [ - 'id' => $soundbite_id, - ]; - } + } else { + $data += [ + 'id' => $soundbite_id, + ]; + } - $soundbiteModel = new SoundbiteModel(); - if (! $soundbiteModel->save($data)) { - return redirect() - ->back() - ->withInput() - ->with('errors', $soundbiteModel->errors()); - } + $soundbiteModel = new SoundbiteModel(); + if (! $soundbiteModel->save($data)) { + return redirect() + ->back() + ->withInput() + ->with('errors', $soundbiteModel->errors()); } } + return redirect()->route('soundbites-edit', [$this->podcast->id, $this->episode->id]); } diff --git a/modules/Install/Controllers/InstallController.php b/modules/Install/Controllers/InstallController.php index 63260eeb..59bad8c9 100644 --- a/modules/Install/Controllers/InstallController.php +++ b/modules/Install/Controllers/InstallController.php @@ -130,7 +130,7 @@ class InstallController extends Controller session() ->setFlashdata('error', lang('Install.messages.databaseConnectError')); - return view('database_config'); + return $this->databaseConfig(); } // migrate if no user has been created diff --git a/modules/Install/Language/en/Install.php b/modules/Install/Language/en/Install.php index c70faf69..33101373 100644 --- a/modules/Install/Language/en/Install.php +++ b/modules/Install/Language/en/Install.php @@ -9,6 +9,7 @@ declare(strict_types=1); */ return [ + 'title' => 'Castopod installer', 'manual_config' => 'Manual configuration', 'manual_config_subtitle' => 'Create a `.env` file with your settings and refresh the page to continue installation.', diff --git a/modules/Install/Language/fr/Install.php b/modules/Install/Language/fr/Install.php index 64eebae1..38cc18a7 100644 --- a/modules/Install/Language/fr/Install.php +++ b/modules/Install/Language/fr/Install.php @@ -9,6 +9,7 @@ declare(strict_types=1); */ return [ + 'title' => 'Installeur Castopod', 'manual_config' => 'Configuration manuelle', 'manual_config_subtitle' => 'Créez un fichier `.env` qui contient tous vos paramètres puis rafraichissez la page pour continuer l’installation.', diff --git a/themes/cp_admin/contributor/list.php b/themes/cp_admin/contributor/list.php index f0f3c014..f6e3a6ea 100644 --- a/themes/cp_admin/contributor/list.php +++ b/themes/cp_admin/contributor/list.php @@ -9,10 +9,7 @@ endSection() ?> section('headerRight') ?> -id), [ - 'variant' => 'accent', - 'iconLeft' => 'add', -]) ?> + endSection() ?> @@ -35,36 +32,8 @@ [ 'header' => lang('Common.actions'), 'cell' => function ($contributor, $podcast) { - return button( - lang('Contributor.edit'), - route_to( - 'contributor-edit', - $podcast->id, - $contributor->id, - ), - [ - 'variant' => 'info', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - ], - ) . - button( - lang('Contributor.remove'), - route_to( - 'contributor-remove', - $podcast->id, - $contributor->id, - ), - [ - 'variant' => 'danger', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - ], - ); + return '' . + ''; }, ], ], diff --git a/themes/cp_admin/episode/create.php b/themes/cp_admin/episode/create.php index 34b3e04c..d79993b1 100644 --- a/themes/cp_admin/episode/create.php +++ b/themes/cp_admin/episode/create.php @@ -22,7 +22,7 @@ @@ -30,15 +30,15 @@ @@ -120,7 +120,7 @@ as="MarkdownEditor" name="description_footer" label="" - hintText="" /> + hint="" /> diff --git a/themes/cp_admin/episode/edit.php b/themes/cp_admin/episode/edit.php index 87e4cd18..e82e2aee 100644 --- a/themes/cp_admin/episode/edit.php +++ b/themes/cp_admin/episode/edit.php @@ -26,22 +26,22 @@ @@ -127,7 +127,7 @@ as="MarkdownEditor" name="description_footer" label="" - hintText="" + hint="" value="episode_description_footer_markdown ?? '' ?>" /> diff --git a/themes/cp_admin/episode/list.php b/themes/cp_admin/episode/list.php index 3048ccfb..ec7b2c4d 100644 --- a/themes/cp_admin/episode/list.php +++ b/themes/cp_admin/episode/list.php @@ -9,10 +9,7 @@ endSection() ?> section('headerRight') ?> -id), [ - 'variant' => 'accent', - 'iconLeft' => 'add', -]) ?> + endSection() ?> diff --git a/themes/cp_admin/episode/persons.php b/themes/cp_admin/episode/persons.php index 204f322a..2b64fe3c 100644 --- a/themes/cp_admin/episode/persons.php +++ b/themes/cp_admin/episode/persons.php @@ -50,19 +50,7 @@ [ 'header' => lang('Common.actions'), 'cell' => function ($person): string { - return button( - lang('Person.episode_form.remove'), - route_to( - 'episode-person-remove', - $person->podcast_id, - $person->episode_id, - $person->id, - ), - [ - 'variant' => 'danger', - 'size' => 'small', - ], - ); + return ''; }, ], ], @@ -82,7 +70,7 @@ id="persons" name="persons[]" label="" - hintText="" + hint="" options="" selected="" required="true" @@ -93,7 +81,7 @@ id="roles" name="roles[]" label="" - hintText="" + hint="" options="" selected="" required="true" diff --git a/themes/cp_admin/episode/publish.php b/themes/cp_admin/episode/publish.php index c0c330ba..ab4f51f8 100644 --- a/themes/cp_admin/episode/publish.php +++ b/themes/cp_admin/episode/publish.php @@ -90,7 +90,7 @@ as="DatetimePicker" name="scheduled_publication_date" label="" - hintText="" + hint="" value="published_at ?>" /> diff --git a/themes/cp_admin/episode/publish_edit.php b/themes/cp_admin/episode/publish_edit.php index 75cba864..1c872055 100644 --- a/themes/cp_admin/episode/publish_edit.php +++ b/themes/cp_admin/episode/publish_edit.php @@ -94,7 +94,7 @@ as="DatetimePicker" name="scheduled_publication_date" label="" - hintText="" + hint="" value="published_at ?>" /> diff --git a/themes/cp_admin/episode/soundbites.php b/themes/cp_admin/episode/soundbites.php index a09a950a..d57db65e 100644 --- a/themes/cp_admin/episode/soundbites.php +++ b/themes/cp_admin/episode/soundbites.php @@ -11,215 +11,63 @@ section('content') ?> -id, $episode->id), - [ - 'method' => 'post', - 'class' => 'flex flex-col', - ], -) ?> +
- + - - - - - - - - - - - soundbites as $soundbite): ?> - - - - - - - - - - - - - - - -
-
'number', - 'min' => 0, - 'max' => $episode->audio_file_duration, - 'step' => 'any', - 'id' => "soundbites[{$soundbite->id}][start_time]", - 'name' => "soundbites[{$soundbite->id}][start_time]", - 'class' => 'form-input w-full border-none text-center', - 'value' => $soundbite->start_time, - 'data-type' => 'soundbite-field', - 'data-field-type' => 'start-time', - 'data-soundbite-id' => $soundbite->id, - 'required' => 'required', - ], -) ?> 'number', - 'min' => 0, - 'max' => $episode->audio_file_duration, - 'step' => 'any', - 'id' => "soundbites[{$soundbite->id}][duration]", - 'name' => "soundbites[{$soundbite->id}][duration]", - 'class' => 'form-input w-full border-none text-center', - 'value' => $soundbite->duration, - 'data-type' => 'soundbite-field', - 'data-field-type' => 'duration', - 'data-soundbite-id' => $soundbite->id, - 'required' => 'required', - ], -) ?> "soundbites[{$soundbite->id}][label]", - 'name' => "soundbites[{$soundbite->id}][label]", - 'class' => 'form-input w-full border-none', - 'value' => $soundbite->label, - ], -) ?> 'primary', - ], - [ - 'class' => 'mb-1 mr-1', - 'data-type' => 'play-soundbite', - 'data-soundbite-id' => $soundbite->id, - 'data-soundbite-start-time' => $soundbite->start_time, - 'data-soundbite-duration' => $soundbite->duration, - ], -) ?> - id, - $episode->id, - $soundbite->id, - ), - [ - 'variant' => 'danger', - ], - [], -) ?> -
'number', - 'min' => 0, - 'max' => $episode->audio_file_duration, - 'step' => 'any', - 'id' => 'soundbites[0][start_time]', - 'name' => 'soundbites[0][start_time]', - 'class' => 'form-input w-full border-none text-center', - 'value' => old('start_time'), - 'data-soundbite-id' => '0', - 'data-type' => 'soundbite-field', - 'data-field-type' => 'start-time', - ], -) ?> 'number', - 'min' => 0, - 'max' => $episode->audio_file_duration, - 'step' => 'any', - 'id' => 'soundbites[0][duration]', - 'name' => 'soundbites[0][duration]', - 'class' => 'form-input w-full border-none text-center', - 'value' => old('duration'), - 'data-soundbite-id' => '0', - 'data-type' => 'soundbite-field', - 'data-field-type' => 'duration', - ], -) ?> 'soundbites[0][label]', - 'name' => 'soundbites[0][label]', - 'class' => 'form-input w-full border-none', - 'value' => old('label'), - ], -) ?> 'primary', - ], - [ - 'data-type' => 'play-soundbite', - 'data-soundbite-id' => 0, - 'data-soundbite-start-time' => 0, - 'data-soundbite-duration' => 0, - ], -) ?> - - -
- - 'info', - ], - [ - 'data-type' => 'get-soundbite', - 'data-start-time-field-name' => 'soundbites[0][start_time]', - 'data-duration-field-name' => 'soundbites[0][duration]', - ], -) ?>
+ + $table->setHeading( + lang('Episode.soundbites_form.start_time') . hint_tooltip(lang('Episode.soundbites_form.start_time_hint')), + lang('Episode.soundbites_form.duration') . hint_tooltip(lang('Episode.soundbites_form.duration_hint')), + lang('Episode.soundbites_form.label') . hint_tooltip(lang('Episode.soundbites_form.label_hint')), + '', + '' + ); - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + foreach ($episode->soundbites as $soundbite) { + $table->addRow( + "", + "", + "", + "" . lang('Episode.soundbites_form.play') . '', + 'id, + $episode->id, + $soundbite->id, + ) . " variant='danger' glyph='delete-bin'>" . lang('Episode.soundbites_form.delete') . '' + ); + } - + $table->addRow( + "", + "", + "", + "" . lang('Episode.soundbites_form.play') . '', + ); + + echo $table->generate(); + + ?> + +
+ + +
+ +
+ + + +
endSection() ?> diff --git a/themes/cp_admin/fediverse/blocked_actors.php b/themes/cp_admin/fediverse/blocked_actors.php index beffc5d2..754cacce 100644 --- a/themes/cp_admin/fediverse/blocked_actors.php +++ b/themes/cp_admin/fediverse/blocked_actors.php @@ -12,7 +12,7 @@ section('content') ?>
- + @@ -34,21 +34,7 @@ $blockedActor->id . '" />' . csrf_field() . - button( - lang('Fediverse.list.unblock'), - route_to( - 'fediverse-unblock-actor', - $blockedActor->username, - ), - [ - 'variant' => 'info', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - 'type' => 'submit', - ], - ) . + '' . ''; }, ], diff --git a/themes/cp_admin/fediverse/blocked_domains.php b/themes/cp_admin/fediverse/blocked_domains.php index fe9bc509..65d10ea9 100644 --- a/themes/cp_admin/fediverse/blocked_domains.php +++ b/themes/cp_admin/fediverse/blocked_domains.php @@ -34,21 +34,7 @@ $blockedDomain->name . '" />' . csrf_field() . - button( - lang('Fediverse.list.unblock'), - route_to( - 'fediverse-unblock-domain', - $blockedDomain->name, - ), - [ - 'variant' => 'info', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - 'type' => 'submit', - ], - ) . + '' . ''; }, ], diff --git a/themes/cp_admin/page/create.php b/themes/cp_admin/page/create.php index d816629b..0a13133b 100644 --- a/themes/cp_admin/page/create.php +++ b/themes/cp_admin/page/create.php @@ -11,9 +11,6 @@ section('content') ?> - 'flex flex-col max-w-3xl', -]) ?>
diff --git a/themes/cp_admin/page/list.php b/themes/cp_admin/page/list.php index 60cd46fb..8925a769 100644 --- a/themes/cp_admin/page/list.php +++ b/themes/cp_admin/page/list.php @@ -9,10 +9,7 @@ endSection() ?> section('headerRight') ?> - 'accent', - 'iconLeft' => 'add', -]) ?> + endSection() ?> @@ -33,36 +30,9 @@ [ 'header' => lang('Common.actions'), 'cell' => function ($page) { - return button( - lang('Page.go_to_page'), - route_to('page', $page->slug), - [ - 'variant' => 'secondary', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - ], - ) . - button( - lang('Page.edit'), - route_to('page-edit', $page->id), - [ - 'variant' => 'info', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - ], - ) . - button( - lang('Page.delete'), - route_to('page-delete', $page->id), - [ - 'variant' => 'danger', - 'size' => 'small', - ], - ); + return '' . + '' . + ''; }, ], ], diff --git a/themes/cp_admin/page/view.php b/themes/cp_admin/page/view.php index db28d587..97d8bd35 100644 --- a/themes/cp_admin/page/view.php +++ b/themes/cp_admin/page/view.php @@ -9,10 +9,7 @@ endSection() ?> section('headerRight') ?> -id), [ - 'variant' => 'accent', - 'iconLeft' => 'add', -]) ?> + endSection() ?> section('content') ?> diff --git a/themes/cp_admin/person/create.php b/themes/cp_admin/person/create.php index b33da6e2..dc634870 100644 --- a/themes/cp_admin/person/create.php +++ b/themes/cp_admin/person/create.php @@ -17,7 +17,7 @@ @@ -25,19 +25,19 @@ + hint="" /> diff --git a/themes/cp_admin/person/edit.php b/themes/cp_admin/person/edit.php index 72b41e6c..3288332a 100644 --- a/themes/cp_admin/person/edit.php +++ b/themes/cp_admin/person/edit.php @@ -19,7 +19,7 @@ @@ -27,7 +27,7 @@ name="full_name" value="full_name ?>" label="" - hintText="" + hint="" required="true" data-slugify="title" /> @@ -35,12 +35,12 @@ name="unique_name" value="unique_name ?>" label="" - hintText="" + hint="" required="true" /> diff --git a/themes/cp_admin/person/list.php b/themes/cp_admin/person/list.php index e3761f33..24fbb5e3 100644 --- a/themes/cp_admin/person/list.php +++ b/themes/cp_admin/person/list.php @@ -9,17 +9,7 @@ endSection() ?> section('headerRight') ?> - 'primary', - 'iconLeft' => 'add', - ], - [ - 'class' => 'mr-2', - ], -) ?> + endSection() ?> section('content') ?> diff --git a/themes/cp_admin/person/view.php b/themes/cp_admin/person/view.php index 859b0db1..395b6d44 100644 --- a/themes/cp_admin/person/view.php +++ b/themes/cp_admin/person/view.php @@ -10,17 +10,7 @@ endSection() ?> section('headerRight') ?> -id), - [ - 'variant' => 'secondary', - 'iconLeft' => 'edit', - ], - [ - 'class' => 'mr-2', - ], -) ?> + endSection() ?> section('content') ?> diff --git a/themes/cp_admin/podcast/create.php b/themes/cp_admin/podcast/create.php index 36296815..0ef31938 100644 --- a/themes/cp_admin/podcast/create.php +++ b/themes/cp_admin/podcast/create.php @@ -25,7 +25,7 @@ @@ -121,20 +121,20 @@ + hint="" /> + hint="" /> @@ -162,7 +162,7 @@ + hint="" />
@@ -192,7 +192,7 @@ as="XMLEditor" name="custom_rss" label="" - hintText="" /> + hint="" /> diff --git a/themes/cp_admin/podcast/edit.php b/themes/cp_admin/podcast/edit.php index ddfb2aec..8809d9b5 100644 --- a/themes/cp_admin/podcast/edit.php +++ b/themes/cp_admin/podcast/edit.php @@ -29,14 +29,14 @@ @@ -74,22 +74,22 @@ name="language" label="" selected="language_code ?>" - required="true" - options="" /> + options="" + required="true" /> + options="" + required="true" /> @@ -122,7 +122,7 @@ name="owner_name" label="" value="owner_name ?>" - hintText="" + hint="" required="true" /> + hint="" /> + hint="" /> @@ -168,7 +168,7 @@ name="payment_pointer" label="" value="payment_pointer ?>" - hintText="" /> + hint="" />
@@ -199,7 +199,7 @@ name="custom_rss" label="" value="custom_rss_string ?>" - hintText="" /> + hint="" /> diff --git a/themes/cp_admin/podcast/import.php b/themes/cp_admin/podcast/import.php index 8306c5f9..3b96be3e 100644 --- a/themes/cp_admin/podcast/import.php +++ b/themes/cp_admin/podcast/import.php @@ -22,7 +22,7 @@ @@ -81,13 +81,13 @@ name="season_number" type="number" label="" - hintText="" /> + hint="" /> + hint="" /> diff --git a/themes/cp_admin/podcast/list.php b/themes/cp_admin/podcast/list.php index 91504658..637b40bc 100644 --- a/themes/cp_admin/podcast/list.php +++ b/themes/cp_admin/podcast/list.php @@ -9,21 +9,8 @@ endSection() ?> section('headerRight') ?> - 'accent', - 'iconLeft' => 'add', - ], - [ - 'class' => 'mr-2', - ], -) ?> - 'primary', - 'iconLeft' => 'download', -]) ?> + + endSection() ?> diff --git a/themes/cp_admin/podcast/persons.php b/themes/cp_admin/podcast/persons.php index 44a9f55c..2b2f9c3a 100644 --- a/themes/cp_admin/podcast/persons.php +++ b/themes/cp_admin/podcast/persons.php @@ -9,17 +9,7 @@ endSection() ?> section('headerRight') ?> - 'primary', - 'iconLeft' => 'add', - ], - [ - 'class' => 'mr-2', - ], -) ?> + endSection() ?> section('content') ?> @@ -60,18 +50,7 @@ [ 'header' => lang('Common.actions'), 'cell' => function ($person): string { - return button( - lang('Person.podcast_form.remove'), - route_to( - 'podcast-person-remove', - $person->podcast_id, - $person->id, - ), - [ - 'variant' => 'danger', - 'size' => 'small', - ], - ); + return ''; }, ], ], diff --git a/themes/cp_admin/podcast/platforms.php b/themes/cp_admin/podcast/platforms.php index e8d02020..88313a73 100644 --- a/themes/cp_admin/podcast/platforms.php +++ b/themes/cp_admin/podcast/platforms.php @@ -10,9 +10,7 @@ section('content') ?> -id, $platformType), [ - 'class' => 'flex flex-col max-w-md', -]) ?> + @@ -106,6 +104,6 @@ - + endSection() ?> diff --git a/themes/cp_admin/podcast/view.php b/themes/cp_admin/podcast/view.php index 53bf6dcd..a9b141e3 100644 --- a/themes/cp_admin/podcast/view.php +++ b/themes/cp_admin/podcast/view.php @@ -9,21 +9,8 @@ endSection() ?> section('headerRight') ?> -id), - [ - 'variant' => 'primary', - 'iconLeft' => 'edit', - ], - [ - 'class' => 'mr-2', - ], -) ?> -id), [ - 'variant' => 'accent', - 'iconLeft' => 'add', -]) ?> + + endSection() ?> section('content') ?> diff --git a/themes/cp_admin/user/create.php b/themes/cp_admin/user/create.php index ce2af3a5..6f68d2e9 100644 --- a/themes/cp_admin/user/create.php +++ b/themes/cp_admin/user/create.php @@ -11,49 +11,29 @@ section('content') ?> - 'flex flex-col max-w-sm', -]) ?> +
- - 'email', - 'name' => 'email', - 'class' => 'form-input mb-4', - 'value' => old('email'), - 'type' => 'email', -]) ?> + - - 'username', - 'name' => 'username', - 'class' => 'form-input mb-4', - 'value' => old('username'), -]) ?> + - - 'password', - 'name' => 'password', - 'class' => 'form-input mb-4', - 'type' => 'password', - 'autocomplete' => 'new-password', -]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + - + endSection() ?> diff --git a/themes/cp_admin/user/edit.php b/themes/cp_admin/user/edit.php index b5cb7fe1..1331e237 100644 --- a/themes/cp_admin/user/edit.php +++ b/themes/cp_admin/user/edit.php @@ -15,26 +15,19 @@ section('content') ?> -id), [ - 'class' => 'flex flex-col max-w-sm', -]) ?> +
- - + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + - + endSection() ?> diff --git a/themes/cp_admin/user/list.php b/themes/cp_admin/user/list.php index c5895513..e8d46852 100644 --- a/themes/cp_admin/user/list.php +++ b/themes/cp_admin/user/list.php @@ -9,10 +9,7 @@ endSection() ?> section('headerRight') ?> - 'accent', - 'iconLeft' => 'user-add', -]) ?> + endSection() ?> @@ -34,19 +31,9 @@ 'header' => lang('User.list.roles'), 'cell' => function ($user) { return implode(',', $user->roles) . - icon_button( - 'edit', - lang('User.edit_roles', [ - 'username' => $user->username, - ]), - route_to('user-edit', $user->id), - [ - 'variant' => 'info', - ], - [ - 'class' => 'ml-2', - ], - ); + '' . lang('User.edit_roles', [ + 'username' => $user->username, + ]) . ''; }, ], [ @@ -60,39 +47,9 @@ [ 'header' => lang('Common.actions'), 'cell' => function ($user) { - return button( - lang('User.forcePassReset'), - route_to('user-force_pass_reset', $user->id), - [ - 'variant' => 'secondary', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - ], - ) . - button( - lang('User.' . ($user->isBanned() ? 'unban' : 'ban')), - route_to( - $user->isBanned() ? 'user-unban' : 'user-ban', - $user->id, - ), - [ - 'variant' => 'warning', - 'size' => 'small', - ], - [ - 'class' => 'mr-2', - ], - ) . - button( - lang('User.delete'), - route_to('user-delete', $user->id), - [ - 'variant' => 'danger', - 'size' => 'small', - ], - ); + return '' . + '' . + ''; }, ], ], diff --git a/themes/cp_app/embeddable_player.php b/themes/cp_app/embeddable_player.php index 755b5960..be5efafa 100644 --- a/themes/cp_app/embeddable_player.php +++ b/themes/cp_app/embeddable_player.php @@ -21,8 +21,8 @@ ] ?>; color: ;"> <?= $episode->title ?> -
-
+
+
title ?> - likes_count ?> - handle, $comment->episode->slug, $comment->id), - [ - 'size' => 'small', - ], -) ?> + replies_count): ?> $comment->likes_count, ], ) ?>">likes_count ?> - handle, $comment->id), - [ - 'size' => 'small', - ], -) ?> + replies_count): ?> $reply->likes_count, ], ) ?>">likes_count ?> - handle, $episode->slug, $reply->id), - [ - 'size' => 'small', - ], -) ?> + diff --git a/themes/cp_app/podcast/_partials/comment_with_replies_authenticated.php b/themes/cp_app/podcast/_partials/comment_with_replies_authenticated.php index ac8b9e57..dfd69dcc 100644 --- a/themes/cp_app/podcast/_partials/comment_with_replies_authenticated.php +++ b/themes/cp_app/podcast/_partials/comment_with_replies_authenticated.php @@ -1,46 +1,21 @@ include('podcast/_partials/comment_card_authenticated') ?>
-id, $episode->id, $comment->id), - [ - 'class' => 'bg-gray-50 flex px-6 pt-8 pb-4', - ], -) ?> +
<?= interact_as_actor()
     ->display_name ?>
- 'message', - 'name' => 'message', - 'class' => 'form-textarea mb-4 w-full', - 'required' => 'required', - 'placeholder' => lang('Comment.form.reply_to_placeholder', [ - 'actorUsername' => $comment->actor->username, - ]), - ], - old('message', '', false), - [ - 'rows' => 1, - ], - ) ?> - 'primary', - 'size' => 'small', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - 'name' => 'action', - 'value' => 'reply', - ], - ) ?> + +
- +
replies as $reply): ?> include('podcast/_partials/post_authenticated') ?>
-username, $post->id), - [ - 'class' => 'bg-gray-50 flex px-6 pt-8 pb-4', - ], -) ?> +
<?= interact_as_actor()
     ->display_name ?>
- 'message', - 'name' => 'message', - 'class' => 'form-textarea mb-4 w-full', - 'required' => 'required', - 'placeholder' => lang('Post.form.reply_to_placeholder', [ - 'actorUsername' => $post->actor->username, - ]), - ], - old('message', '', false), - [ - 'rows' => 1, - ], - ) ?> - 'primary', - 'size' => 'small', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - 'name' => 'action', - 'value' => 'reply', - ], - ) ?> + +
- +
has_replies): ?> replies as $reply): ?> diff --git a/themes/cp_app/podcast/activity_authenticated.php b/themes/cp_app/podcast/activity_authenticated.php index 06bec855..0f736605 100644 --- a/themes/cp_app/podcast/activity_authenticated.php +++ b/themes/cp_app/podcast/activity_authenticated.php @@ -43,9 +43,7 @@
-username), [ - 'class' => 'flex p-4 bg-white shadow rounded-xl', -]) ?> +
@@ -54,59 +52,32 @@ ->avatar_image_url ?>" alt="display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
- 'message', - 'name' => 'message', - 'class' => 'form-textarea', - 'required' => 'required', - 'placeholder' => lang('Post.form.message_placeholder'), - ], - old('message', '', false), - [ - 'rows' => 2, - ], - ) ?> - 'episode_url', - 'name' => 'episode_url', - 'class' => 'form-input mb-2', - 'placeholder' => - lang('Post.form.episode_url_placeholder') . - ' (' . - lang('Common.optional') . - ')', - 'type' => 'url', - ]) ?> - - 'primary', - 'size' => 'small', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], - ) ?> + + +
- +

reblog_of_id !== null): ?> $post->reblog_of_post, + 'post' => $post->reblog_of_post, 'podcast' => $podcast, - ]) ?> +]) ?> $post, + 'post' => $post, 'podcast' => $podcast, - ]) ?> +]) ?>
diff --git a/themes/cp_app/podcast/episode_authenticated.php b/themes/cp_app/podcast/episode_authenticated.php index f1a2b79a..b8478828 100644 --- a/themes/cp_app/podcast/episode_authenticated.php +++ b/themes/cp_app/podcast/episode_authenticated.php @@ -88,9 +88,7 @@
- id, $episode->id), [ - 'class' => 'flex p-4', - ]) ?> +
@@ -99,47 +97,23 @@ ->avatar_image_url ?>" alt="display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
- 'message', - 'name' => 'message', - 'class' => 'form-textarea mb-2', - 'required' => 'required', - 'placeholder' => lang( - 'Comment.form.episode_message_placeholder', - ), - ], - old('message', '', false), - [ - 'rows' => 2, - ], - ) ?> - - 'primary', - 'size' => 'small', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], - ) ?> + +
- - comments as $comment): ?> - $comment, - 'podcast' => $podcast, - ]) ?> - +
+ comments as $comment): ?> + $comment, + 'podcast' => $podcast, + ]) ?> +
- handle), [ - 'class' => 'flex p-4 bg-white shadow rounded-xl', - ]) ?> +
@@ -148,41 +122,15 @@ ->avatar_image_url ?>" alt="display_name ?>" class="w-12 h-12 mr-4 rounded-full" />
- 'message', - 'name' => 'message', - 'class' => 'form-textarea mb-2', - 'required' => 'required', - 'placeholder' => lang( - 'Post.form.episode_message_placeholder', - ), - ], - old('message', '', false), - [ - 'rows' => 2, - ], - ) ?> - 'episode_url', - 'name' => 'episode_url', - 'value' => $episode->link, - 'type' => 'hidden', - ]) ?> - 'primary', - 'size' => 'small', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], - ) ?> + + +
- +

posts as $post): ?>
- username), [ - 'method' => 'post', - 'class' => 'flex flex-col', - ]) ?> +
- - 'handle', - 'name' => 'handle', - 'class' => 'form-input mb-4', - 'required' => 'required', - 'type' => 'text', - ]) ?> - - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], - ) ?> - + + +
include('podcast/_partials/post') ?> - id, $action), - [ - 'method' => 'post', - 'class' => 'flex flex-col mt-8', - ], - ) ?> - - +
+ + - - 'handle', - 'name' => 'handle', - 'class' => 'form-input mb-4', - 'required' => 'required', - 'type' => 'text', - ]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], - ) ?> - + + diff --git a/themes/cp_auth/forgot.php b/themes/cp_auth/forgot.php index 5bc1aca1..5491648d 100644 --- a/themes/cp_auth/forgot.php +++ b/themes/cp_auth/forgot.php @@ -10,32 +10,15 @@

- 'flex flex-col', -]) ?> - +
+ - - 'email', - 'name' => 'email', - 'class' => 'form-input mb-4', - 'type' => 'email', - 'required' => 'required', -]) ?> - - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> - - + + + endSection() ?> diff --git a/themes/cp_auth/login.php b/themes/cp_auth/login.php index 62c9f8d7..d70c88db 100644 --- a/themes/cp_auth/login.php +++ b/themes/cp_auth/login.php @@ -8,42 +8,22 @@ section('content') ?> - 'flex flex-col', -]) ?> - +
+ - - 'login', - 'name' => 'login', - 'class' => 'form-input mb-4', - 'required' => 'required', -]) ?> + - - 'password', - 'name' => 'password', - 'class' => 'form-input mb-4', - 'type' => 'password', - 'required' => 'required', -]) ?> + - - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> - - + + endSection() ?> diff --git a/themes/cp_auth/register.php b/themes/cp_auth/register.php index 5bef3813..2be3657e 100644 --- a/themes/cp_auth/register.php +++ b/themes/cp_auth/register.php @@ -8,57 +8,30 @@ section('content') ?> - 'flex flex-col', -]) ?> +
- - 'email', - 'name' => 'email', - 'class' => 'form-input', - 'value' => old('email'), - 'type' => 'email', - 'required' => 'required', - 'aria-describedby' => 'emailHelp', -]) ?> - - - + - - 'username', - 'name' => 'username', - 'class' => 'form-input mb-4', - 'value' => old('username'), - 'required' => 'required', -]) ?> + - - 'password', - 'name' => 'password', - 'class' => 'form-input mb-4', - 'type' => 'password', - 'required' => 'required', - 'autocomplete' => 'new-password', -]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + - + endSection() ?> diff --git a/themes/cp_auth/reset.php b/themes/cp_auth/reset.php index 6493cbce..09c597e6 100644 --- a/themes/cp_auth/reset.php +++ b/themes/cp_auth/reset.php @@ -10,52 +10,30 @@

- 'flex flex-col', -]) ?> +
- - 'token', - 'name' => 'token', - 'class' => 'form-input mb-4', - 'value' => old('token', $token ?? ''), - 'required' => 'required', -]) ?> + + + - - 'email', - 'name' => 'email', - 'class' => 'form-input mb-4', - 'value' => old('email'), - 'required' => 'required', - 'type' => 'email', -]) ?> + - - 'password', - 'name' => 'password', - 'class' => 'form-input mb-4', - 'type' => 'password', - 'required' => 'required', - 'autocomplete' => 'new-password', -]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> - - + endSection() ?> diff --git a/themes/cp_install/_layout.php b/themes/cp_install/_layout.php index 42364926..eccc912f 100644 --- a/themes/cp_install/_layout.php +++ b/themes/cp_install/_layout.php @@ -16,7 +16,7 @@
- Castopod installer +
diff --git a/themes/cp_install/cache_config.php b/themes/cp_install/cache_config.php index c4563b79..21ea7740 100644 --- a/themes/cp_install/cache_config.php +++ b/themes/cp_install/cache_config.php @@ -2,48 +2,33 @@ section('content') ?> - 'flex flex-col max-w-sm w-full', -]) ?> +
-

3/4

+
+
+ 3/4 + +
-

+
- -" + options=" lang('Install.form.cacheHandlerOptions.file'), 'redis' => lang('Install.form.cacheHandlerOptions.redis'), 'predis' => lang('Install.form.cacheHandlerOptions.predis'), - ], - [old('cache_handler', 'file')], - [ - 'id' => 'cache_handler', - 'name' => 'cache_handler', - 'class' => 'form-select mb-6', - 'value' => config('Database') - ->default['DBPrefix'], - ], -) ?> + ])) ?>" + selected="file" + required="true" /> - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + diff --git a/themes/cp_install/create_superadmin.php b/themes/cp_install/create_superadmin.php index 6e2b8299..16771ce1 100644 --- a/themes/cp_install/create_superadmin.php +++ b/themes/cp_install/create_superadmin.php @@ -2,56 +2,34 @@ section('content') ?> - 'flex flex-col max-w-sm w-full', -]) ?> + -

4/4

+
+ 4/4 + +
- - 'email', - 'name' => 'email', - 'class' => 'form-input mb-4', - 'type' => 'email', - 'required' => 'required', - 'value' => old('email'), -]) ?> + - - 'username', - 'name' => 'username', - 'class' => 'form-input mb-4', - 'required' => 'required', - 'value' => old('username'), -]) ?> + - - 'password', - 'name' => 'password', - 'class' => 'form-input mb-4', - 'type' => 'password', - 'required' => 'required', - 'autocomplete' => 'new-password', -]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + - + endSection() ?> diff --git a/themes/cp_install/database_config.php b/themes/cp_install/database_config.php index 425e3100..61b3f249 100644 --- a/themes/cp_install/database_config.php +++ b/themes/cp_install/database_config.php @@ -2,84 +2,58 @@ section('content') ?> - 'flex flex-col max-w-sm w-full', - 'autocomplete' => 'off', -]) ?> +
-

2/4 +
+ 2/4 +

+) ?> +
-

+
- - 'db_hostname', - 'name' => 'db_hostname', - 'class' => 'form-input mb-4', - 'value' => old('db_hostname', config('Database')->default['hostname']), - 'required' => 'required', -]) ?> + - - 'db_name', - 'name' => 'db_name', - 'class' => 'form-input mb-4', - 'value' => old('db_name', config('Database')->default['database']), - 'required' => 'required', -]) ?> + - - 'db_username', - 'name' => 'db_username', - 'class' => 'form-input mb-4', - 'value' => old('db_username', config('Database')->default['username']), - 'required' => 'required', - 'autocomplete' => 'off', -]) ?> + - - 'db_password', - 'name' => 'db_password', - 'class' => 'form-input mb-4', - 'value' => old('db_password', config('Database')->default['password']), - 'type' => 'password', - 'required' => 'required', - 'autocomplete' => 'off', -]) ?> + - - 'db_prefix', - 'name' => 'db_prefix', - 'class' => 'form-input mb-6', - 'value' => old('db_prefix', config('Database')->default['DBPrefix']), -]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> + - + endSection() ?> diff --git a/themes/cp_install/instance_config.php b/themes/cp_install/instance_config.php index 13af10f9..7e8620ac 100644 --- a/themes/cp_install/instance_config.php +++ b/themes/cp_install/instance_config.php @@ -1,84 +1,44 @@ extend('_layout') ?> section('content') ?> -adz -
+ + -

1/4

- - 'hostname', - 'name' => 'hostname', - 'class' => 'form-input mb-4', - 'value' => old( - 'hostname', - host_url() === null ? config('App') - ->baseURL : host_url(), - ), - 'required' => 'required', -]) ?> +
+ 1/4 + +
+ - - 'media_base_url', - 'name' => 'media_base_url', - 'class' => 'form-input mb-4', - 'value' => old('media_base_url', ''), -]) ?> + - - 'admin_gateway', - 'name' => 'admin_gateway', - 'class' => 'form-input mb-4', - 'value' => old('admin_gateway', config('Admin')->gateway), - 'required' => 'required', -]) ?> + - - 'auth_gateway', - 'name' => 'auth_gateway', - 'class' => 'form-input mb-6', - 'value' => old('auth_gateway', config('Auth')->gateway), - 'required' => 'required', -]) ?> + - 'primary', - ], - [ - 'type' => 'submit', - 'class' => 'self-end', - ], -) ?> - - + + endSection() ?>