Loading app/Helpers/components_helper.php +4 −4 Original line number Diff line number Diff line Loading @@ -57,14 +57,14 @@ if (! function_exists('data_table')) { 'table_open' => '<table class="w-full whitespace-no-wrap">', 'thead_open' => '<thead class="text-xs font-semibold text-left text-gray-500 uppercase border-b">', '<thead class="text-xs font-semibold text-left text-gray-500 uppercase">', 'heading_cell_start' => '<th class="px-4 py-2">', 'cell_start' => '<td class="px-4 py-2">', 'cell_alt_start' => '<td class="px-4 py-2">', 'row_start' => '<tr class="bg-gray-50 hover:bg-pine-50">', 'row_alt_start' => '<tr class="hover:bg-pine-50">', 'row_start' => '<tr class="border-t hover:bg-pine-50">', 'row_alt_start' => '<tr class="border-t hover:bg-pine-50">', ]; $table->setTemplate($template); Loading @@ -89,7 +89,7 @@ if (! function_exists('data_table')) { return lang('Common.no_data'); } return '<div class="overflow-x-auto bg-white rounded-lg shadow ' . $class . '" >' . return '<div class="overflow-x-auto bg-white rounded-lg border-3 border-pine-100 ' . $class . '" >' . $table->generate() . '</div>'; } Loading app/Language/en/Podcast.php +2 −2 Original line number Diff line number Diff line Loading @@ -11,8 +11,8 @@ declare(strict_types=1); return [ 'all_podcasts' => 'All podcasts', 'no_podcast' => 'No podcast found!', 'create' => 'Create a podcast', 'import' => 'Import a podcast', 'create' => 'Create podcast', 'import' => 'Import podcast', 'new_episode' => 'New Episode', 'feed' => 'RSS', 'view' => 'View podcast', Loading app/Models/PersonModel.php +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ class PersonModel extends Model protected $validationRules = [ 'full_name' => 'required', 'unique_name' => 'required|regex_match[/^[a-z0-9\-]{1,191}$/]|is_unique[persons.unique_name,id,{id}]', 'required|regex_match[/^[a-z0-9\-]{1,32}$/]|is_unique[persons.unique_name,id,{id}]', 'created_by' => 'required', 'updated_by' => 'required', ]; Loading app/Models/PodcastModel.php +18 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ declare(strict_types=1); namespace App\Models; use App\Entities\Actor; use App\Entities\Podcast; use CodeIgniter\Database\Query; use CodeIgniter\HTTP\URI; Loading Loading @@ -88,7 +89,7 @@ class PodcastModel extends Model protected $validationRules = [ 'title' => 'required', 'handle' => 'required|regex_match[/^[a-zA-Z0-9\_]{1,191}$/]|is_unique[podcasts.handle,id,{id}]', 'required|regex_match[/^[a-zA-Z0-9\_]{1,32}$/]|is_unique[podcasts.handle,id,{id}]', 'description_markdown' => 'required', 'image_path' => 'required', 'language_code' => 'required', Loading @@ -102,7 +103,7 @@ class PodcastModel extends Model /** * @var string[] */ protected $beforeInsert = ['createPodcastActor']; protected $beforeInsert = ['setPodcastGUID', 'createPodcastActor']; /** * @var string[] Loading Loading @@ -489,4 +490,19 @@ class PodcastModel extends Model return $data; } /** * @param mixed[] $data * * @return mixed[] */ protected function setPodcastGUID(array $data): array { if (! array_key_exists('guid', $data['data']) || $data['data']['guid'] === null) { helper('misc'); $data['data']['guid'] = podcast_uuid(url_to('podcast_feed', $data['data']['handle'])); } return $data; } } app/Resources/js/modules/markdown-write-preview.ts +34 −6 Original line number Diff line number Diff line import { html, LitElement, TemplateResult } from "lit"; import { css, html, LitElement, TemplateResult } from "lit"; import { customElement, property, queryAssignedNodes } from "lit/decorators.js"; import { MarkdownPreview } from "./markdown-preview"; Loading Loading @@ -28,20 +28,48 @@ export class MarkdownWritePreview extends LitElement { ) as MarkdownPreview; } firstUpdated(): void { this.write(); } write(): void { this._markdownPreview.hide(); this._write[0].classList.add("font-semibold"); this._preview[0].classList.remove("font-semibold"); this._write[0].classList.add("active"); this._preview[0].classList.remove("active"); } preview(): void { this._markdownPreview.show(); this._preview[0].classList.add("font-semibold"); this._write[0].classList.remove("font-semibold"); this._preview[0].classList.add("active"); this._write[0].classList.remove("active"); } static styles = css` ::slotted(button) { opacity: 0.5; } ::slotted(button.active) { position: relative; opacity: 1; } ::slotted(button.active)::after { content: ""; position: absolute; bottom: -2px; left: 0; right: 0; width: 80%; height: 4px; margin: 0 auto; background-color: #009486; border-radius: 9999px; } `; render(): TemplateResult<1> { return html`<slot name="write" @click="${this.write}"></slot> return html`<slot name="write" class="active" @click="${this.write}"></slot> <slot name="preview" @click="${this.preview}"></slot>`; } } Loading
app/Helpers/components_helper.php +4 −4 Original line number Diff line number Diff line Loading @@ -57,14 +57,14 @@ if (! function_exists('data_table')) { 'table_open' => '<table class="w-full whitespace-no-wrap">', 'thead_open' => '<thead class="text-xs font-semibold text-left text-gray-500 uppercase border-b">', '<thead class="text-xs font-semibold text-left text-gray-500 uppercase">', 'heading_cell_start' => '<th class="px-4 py-2">', 'cell_start' => '<td class="px-4 py-2">', 'cell_alt_start' => '<td class="px-4 py-2">', 'row_start' => '<tr class="bg-gray-50 hover:bg-pine-50">', 'row_alt_start' => '<tr class="hover:bg-pine-50">', 'row_start' => '<tr class="border-t hover:bg-pine-50">', 'row_alt_start' => '<tr class="border-t hover:bg-pine-50">', ]; $table->setTemplate($template); Loading @@ -89,7 +89,7 @@ if (! function_exists('data_table')) { return lang('Common.no_data'); } return '<div class="overflow-x-auto bg-white rounded-lg shadow ' . $class . '" >' . return '<div class="overflow-x-auto bg-white rounded-lg border-3 border-pine-100 ' . $class . '" >' . $table->generate() . '</div>'; } Loading
app/Language/en/Podcast.php +2 −2 Original line number Diff line number Diff line Loading @@ -11,8 +11,8 @@ declare(strict_types=1); return [ 'all_podcasts' => 'All podcasts', 'no_podcast' => 'No podcast found!', 'create' => 'Create a podcast', 'import' => 'Import a podcast', 'create' => 'Create podcast', 'import' => 'Import podcast', 'new_episode' => 'New Episode', 'feed' => 'RSS', 'view' => 'View podcast', Loading
app/Models/PersonModel.php +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ class PersonModel extends Model protected $validationRules = [ 'full_name' => 'required', 'unique_name' => 'required|regex_match[/^[a-z0-9\-]{1,191}$/]|is_unique[persons.unique_name,id,{id}]', 'required|regex_match[/^[a-z0-9\-]{1,32}$/]|is_unique[persons.unique_name,id,{id}]', 'created_by' => 'required', 'updated_by' => 'required', ]; Loading
app/Models/PodcastModel.php +18 −2 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ declare(strict_types=1); namespace App\Models; use App\Entities\Actor; use App\Entities\Podcast; use CodeIgniter\Database\Query; use CodeIgniter\HTTP\URI; Loading Loading @@ -88,7 +89,7 @@ class PodcastModel extends Model protected $validationRules = [ 'title' => 'required', 'handle' => 'required|regex_match[/^[a-zA-Z0-9\_]{1,191}$/]|is_unique[podcasts.handle,id,{id}]', 'required|regex_match[/^[a-zA-Z0-9\_]{1,32}$/]|is_unique[podcasts.handle,id,{id}]', 'description_markdown' => 'required', 'image_path' => 'required', 'language_code' => 'required', Loading @@ -102,7 +103,7 @@ class PodcastModel extends Model /** * @var string[] */ protected $beforeInsert = ['createPodcastActor']; protected $beforeInsert = ['setPodcastGUID', 'createPodcastActor']; /** * @var string[] Loading Loading @@ -489,4 +490,19 @@ class PodcastModel extends Model return $data; } /** * @param mixed[] $data * * @return mixed[] */ protected function setPodcastGUID(array $data): array { if (! array_key_exists('guid', $data['data']) || $data['data']['guid'] === null) { helper('misc'); $data['data']['guid'] = podcast_uuid(url_to('podcast_feed', $data['data']['handle'])); } return $data; } }
app/Resources/js/modules/markdown-write-preview.ts +34 −6 Original line number Diff line number Diff line import { html, LitElement, TemplateResult } from "lit"; import { css, html, LitElement, TemplateResult } from "lit"; import { customElement, property, queryAssignedNodes } from "lit/decorators.js"; import { MarkdownPreview } from "./markdown-preview"; Loading Loading @@ -28,20 +28,48 @@ export class MarkdownWritePreview extends LitElement { ) as MarkdownPreview; } firstUpdated(): void { this.write(); } write(): void { this._markdownPreview.hide(); this._write[0].classList.add("font-semibold"); this._preview[0].classList.remove("font-semibold"); this._write[0].classList.add("active"); this._preview[0].classList.remove("active"); } preview(): void { this._markdownPreview.show(); this._preview[0].classList.add("font-semibold"); this._write[0].classList.remove("font-semibold"); this._preview[0].classList.add("active"); this._write[0].classList.remove("active"); } static styles = css` ::slotted(button) { opacity: 0.5; } ::slotted(button.active) { position: relative; opacity: 1; } ::slotted(button.active)::after { content: ""; position: absolute; bottom: -2px; left: 0; right: 0; width: 80%; height: 4px; margin: 0 auto; background-color: #009486; border-radius: 9999px; } `; render(): TemplateResult<1> { return html`<slot name="write" @click="${this.write}"></slot> return html`<slot name="write" class="active" @click="${this.write}"></slot> <slot name="preview" @click="${this.preview}"></slot>`; } }