From be5a28787fdb180b64d9bf570120eff7072ab9aa Mon Sep 17 00:00:00 2001
From: Yassine Doghri
Date: Mon, 18 Oct 2021 16:44:07 +0000
Subject: [PATCH] fix(layouts): replace holy-grail layout with tailwind config
+ widen public podcast layout
- add rounded classes with conditional border-radius depending on screen width
- add ring-castopod
class to use on focus states
---
app/Helpers/components_helper.php | 2 +-
app/Language/en/Common.php | 1 -
app/Language/en/Episode.php | 2 +-
app/Resources/js/modules/xml-editor.ts | 2 +-
app/Resources/styles/breadcrumb.css | 4 +
app/Resources/styles/choices.css | 2 +-
app/Resources/styles/custom.css | 20 +
app/Resources/styles/index.css | 2 +-
app/Resources/styles/layout.css | 36 -
app/Resources/styles/radioBtn.css | 14 +-
app/Resources/styles/switch.css | 2 +-
app/Views/Components/Button.php | 2 +-
app/Views/Components/DropdownMenu.php | 2 +-
app/Views/Components/Forms/Checkbox.php | 2 +-
app/Views/Components/Forms/DatetimePicker.php | 4 +-
app/Views/Components/Forms/Input.php | 2 +-
app/Views/Components/Forms/MarkdownEditor.php | 24 +-
app/Views/Components/Forms/MultiSelect.php | 1 +
app/Views/Components/Forms/Radio.php | 2 +-
app/Views/Components/Forms/Select.php | 2 +-
app/Views/Components/Forms/Textarea.php | 2 +-
app/Views/errors/html/error_404.php | 2 +-
package-lock.json | 7831 +++++------------
package.json | 18 +-
tailwind.config.js | 7 +-
themes/cp_admin/_layout.php | 27 +-
themes/cp_admin/_partials/_nav_aside.php | 16 +
themes/cp_admin/_partials/_nav_header.php | 8 +-
themes/cp_admin/_sidebar.php | 4 +-
themes/cp_admin/episode/_sidebar.php | 8 +-
themes/cp_admin/episode/list.php | 11 +-
themes/cp_admin/episode/persons.php | 74 +-
themes/cp_admin/episode/publish.php | 4 +-
themes/cp_admin/episode/publish_edit.php | 4 +-
themes/cp_admin/podcast/_sidebar.php | 6 +-
themes/cp_admin/podcast/latest_episodes.php | 10 +-
themes/cp_admin/podcast/list.php | 2 +-
themes/cp_admin/podcast/persons.php | 68 +-
themes/cp_admin/user/list.php | 26 +-
themes/cp_app/_admin_navbar.php | 6 +-
themes/cp_app/_persons_modal.php | 2 +-
themes/cp_app/embeddable_player.php | 9 +-
themes/cp_app/episode/_layout.php | 8 +-
themes/cp_app/episode/_partials/card.php | 48 +-
themes/cp_app/episode/_partials/comment.php | 2 +-
.../cp_app/episode/_partials/comment_card.php | 2 +-
.../_partials/comment_with_replies.php | 2 +-
.../cp_app/episode/_partials/navigation.php | 4 +-
themes/cp_app/episode/activity.php | 15 +-
themes/cp_app/episode/comments.php | 10 +-
themes/cp_app/podcast/_layout.php | 8 +-
.../cp_app/podcast/_partials/navigation.php | 4 +-
themes/cp_app/podcast/_partials/sidebar.php | 2 +-
themes/cp_app/podcast/about.php | 60 +-
themes/cp_app/podcast/activity.php | 9 +-
themes/cp_app/podcast/episodes.php | 56 +-
themes/cp_app/post/_partials/actions.php | 2 +-
themes/cp_app/post/_partials/card.php | 2 +-
themes/cp_app/post/_partials/reblog.php | 2 +-
.../cp_app/post/_partials/reply_actions.php | 2 +-
60 files changed, 2434 insertions(+), 6077 deletions(-)
create mode 100644 app/Resources/styles/custom.css
delete mode 100644 app/Resources/styles/layout.css
create mode 100644 themes/cp_admin/_partials/_nav_aside.php
diff --git a/app/Helpers/components_helper.php b/app/Helpers/components_helper.php
index 6a85dbf3..2fd41ade 100644
--- a/app/Helpers/components_helper.php
+++ b/app/Helpers/components_helper.php
@@ -26,7 +26,7 @@ if (! function_exists('hint_tooltip')) {
$tooltip =
' 'text-black bg-gray-300 hover:bg-gray-400',
diff --git a/app/Views/Components/DropdownMenu.php b/app/Views/Components/DropdownMenu.php
index 62a0997c..17038786 100644
--- a/app/Views/Components/DropdownMenu.php
+++ b/app/Views/Components/DropdownMenu.php
@@ -29,7 +29,7 @@ class DropdownMenu extends Component
switch ($item['type']) {
case 'link':
$menuItems .= anchor($item['uri'], $item['title'], [
- 'class' => 'px-4 py-1 hover:bg-gray-100' . (array_key_exists('class', $item) ? ' ' . $item['class'] : ''),
+ 'class' => 'px-4 py-1 hover:bg-gray-100 focus:ring-castopod focus:ring-inset' . (array_key_exists('class', $item) ? ' ' . $item['class'] : ''),
]);
break;
case 'html':
diff --git a/app/Views/Components/Forms/Checkbox.php b/app/Views/Components/Forms/Checkbox.php
index 02f3af06..69973dc6 100644
--- a/app/Views/Components/Forms/Checkbox.php
+++ b/app/Views/Components/Forms/Checkbox.php
@@ -21,7 +21,7 @@ class Checkbox extends FormComponent
[
'id' => $this->value,
'name' => $this->name,
- 'class' => 'form-checkbox text-pine-500 border-black border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 w-6 h-6',
+ 'class' => 'form-checkbox text-pine-500 border-black border-3 focus:ring-castopod w-6 h-6',
],
'yes',
old($this->name) ? old($this->name) === $this->value : $this->isChecked,
diff --git a/app/Views/Components/Forms/DatetimePicker.php b/app/Views/Components/Forms/DatetimePicker.php
index 19229b28..c11c1bd8 100644
--- a/app/Views/Components/Forms/DatetimePicker.php
+++ b/app/Views/Components/Forms/DatetimePicker.php
@@ -18,9 +18,9 @@ class DatetimePicker extends FormComponent
$closeIcon = icon('close');
return <<
+
{$dateInput}
-
diff --git a/app/Views/Components/Forms/Input.php b/app/Views/Components/Forms/Input.php
index 2b1cb5e4..20738194 100644
--- a/app/Views/Components/Forms/Input.php
+++ b/app/Views/Components/Forms/Input.php
@@ -10,7 +10,7 @@ class Input extends FormComponent
public function render(): string
{
- $class = 'px-3 py-2 bg-white border-black rounded-lg focus:border-black border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 ' . $this->class;
+ $class = 'px-3 py-2 bg-white border-black rounded-lg focus:border-black border-3 focus:ring-castopod ' . $this->class;
$this->attributes['class'] = $class;
diff --git a/app/Views/Components/Forms/MarkdownEditor.php b/app/Views/Components/Forms/MarkdownEditor.php
index 5307742d..63f9276a 100644
--- a/app/Views/Components/Forms/MarkdownEditor.php
+++ b/app/Views/Components/Forms/MarkdownEditor.php
@@ -8,9 +8,9 @@ class MarkdownEditor extends FormComponent
{
public function render(): string
{
- $editorClass = 'w-full flex flex-col bg-white border-3 border-black rounded-lg overflow-hidden focus-within:ring-2 focus-within:ring-offset-2 focus-withing:ring-offset-pine-100 focus-within:ring-pine-500 ' . $this->class;
+ $editorClass = 'w-full flex flex-col bg-white border-3 border-black rounded-lg overflow-hidden focus-within:ring-castopod ' . $this->class;
- $this->attributes['class'] = 'border-none outline-none focus:border-none focus:outline-none focus:ring-0 w-full h-full';
+ $this->attributes['class'] = 'border-none focus:border-none focus:outline-none focus:ring-0 w-full h-full';
$this->attributes['rows'] = 6;
$textarea = form_textarea($this->attributes, old($this->name, html_entity_decode($this->value), null));
@@ -39,23 +39,23 @@ class MarkdownEditor extends FormComponent
- {$translations['write']}
- {$translations['preview']}
+ {$translations['write']}
+ {$translations['preview']}
- {$icons['heading']}
- {$icons['bold']}
- {$icons['italic']}
+ {$icons['heading']}
+ {$icons['bold']}
+ {$icons['italic']}
- {$icons['list-unordered']}
- {$icons['list-ordered']}
+ {$icons['list-unordered']}
+ {$icons['list-ordered']}
- {$icons['quote']}
- {$icons['link']}
- {$icons['image-add']}
+ {$icons['quote']}
+ {$icons['link']}
+ {$icons['image-add']}
diff --git a/app/Views/Components/Forms/MultiSelect.php b/app/Views/Components/Forms/MultiSelect.php
index 276f8d41..3cfe35d2 100644
--- a/app/Views/Components/Forms/MultiSelect.php
+++ b/app/Views/Components/Forms/MultiSelect.php
@@ -37,6 +37,7 @@ class MultiSelect extends FormComponent
'data-no-choices-text' => lang('Common.forms.multiSelect.noChoicesText'),
'data-max-item-text' => lang('Common.forms.multiSelect.maxItemText'),
];
+ $this->attributes['class'] .= ' border-3 border-black rounded-lg';
$extra = array_merge($defaultAttributes, $this->attributes);
return form_dropdown($this->name, $this->options, $this->selected, $extra);
diff --git a/app/Views/Components/Forms/Radio.php b/app/Views/Components/Forms/Radio.php
index cdbcd650..fa1010fd 100644
--- a/app/Views/Components/Forms/Radio.php
+++ b/app/Views/Components/Forms/Radio.php
@@ -19,7 +19,7 @@ class Radio extends FormComponent
[
'id' => $this->value,
'name' => $this->name,
- 'class' => 'text-pine-500 border-black border-3 focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 w-6 h-6',
+ 'class' => 'text-pine-500 border-black border-3 focus:ring-castopod w-6 h-6',
],
$this->value,
old($this->name) ? old($this->name) === $this->value : $this->isChecked,
diff --git a/app/Views/Components/Forms/Select.php b/app/Views/Components/Forms/Select.php
index ee8ed277..5a439614 100644
--- a/app/Views/Components/Forms/Select.php
+++ b/app/Views/Components/Forms/Select.php
@@ -21,7 +21,7 @@ class Select extends FormComponent
public function render(): string
{
$defaultAttributes = [
- '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,
+ 'class' => 'focus:border-black focus:ring-castopod border-3 rounded-lg border-black ' . $this->class,
'data-class' => $this->class,
'data-select-text' => lang('Common.forms.multiSelect.selectText'),
'data-loading-text' => lang('Common.forms.multiSelect.loadingText'),
diff --git a/app/Views/Components/Forms/Textarea.php b/app/Views/Components/Forms/Textarea.php
index 31bc45de..744861fe 100644
--- a/app/Views/Components/Forms/Textarea.php
+++ b/app/Views/Components/Forms/Textarea.php
@@ -17,7 +17,7 @@ class Textarea extends FormComponent
{
unset($this->attributes['value']);
- $this->attributes['class'] = 'focus:border-black focus:ring-2 focus:ring-pine-500 focus:ring-offset-2 focus:ring-offset-pine-100 rounded-lg border-3 border-black ' . $this->class;
+ $this->attributes['class'] = 'focus:border-black focus:ring-castopod rounded-lg border-3 border-black ' . $this->class;
$textarea = form_textarea(
$this->attributes,
diff --git a/app/Views/errors/html/error_404.php b/app/Views/errors/html/error_404.php
index e036b59a..f9567ddb 100644
--- a/app/Views/errors/html/error_404.php
+++ b/app/Views/errors/html/error_404.php
@@ -19,7 +19,7 @@
Sorry! Cannot seem to find the page you were looking for.
- = lang('Common.go_back') ?>
+ = lang('Common.go_back') ?>