From 84b0898ed685bb7b53b9bc76be10f22077bb177e Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Sun, 7 Jun 2020 20:30:13 +0100 Subject: [PATCH 01/14] Seed published articles --- database/seeds/ArticleSeeder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/database/seeds/ArticleSeeder.php b/database/seeds/ArticleSeeder.php index 06e2368f5..0e208da2d 100644 --- a/database/seeds/ArticleSeeder.php +++ b/database/seeds/ArticleSeeder.php @@ -7,6 +7,10 @@ class ArticleSeeder extends Seeder { public function run() { - factory(Article::class, 50)->create(['author_id' => 1]); + factory(Article::class, 50)->create([ + 'author_id' => 1, + 'submitted_at' => now(), + 'approved_at' => now(), + ]); } } From 66199a97a7cb718e1f2c855154a642c153f20db7 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Sun, 7 Jun 2020 20:49:16 +0100 Subject: [PATCH 02/14] Add spacing around banner ads --- resources/views/admin/articles.blade.php | 2 +- resources/views/admin/overview.blade.php | 2 +- resources/views/articles/show.blade.php | 2 +- resources/views/livewire/show-articles.blade.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/admin/articles.blade.php b/resources/views/admin/articles.blade.php index dfe8ca52b..d32627d9c 100644 --- a/resources/views/admin/articles.blade.php +++ b/resources/views/admin/articles.blade.php @@ -13,7 +13,7 @@ -
+
diff --git a/resources/views/admin/overview.blade.php b/resources/views/admin/overview.blade.php index 1819e4f78..22a8a51cf 100644 --- a/resources/views/admin/overview.blade.php +++ b/resources/views/admin/overview.blade.php @@ -13,7 +13,7 @@ -
+
diff --git a/resources/views/articles/show.blade.php b/resources/views/articles/show.blade.php index d0368bd14..d0b1780ae 100644 --- a/resources/views/articles/show.blade.php +++ b/resources/views/articles/show.blade.php @@ -7,7 +7,7 @@ @endpush @section('content') -
+

{{ $article->title() }}

@if ($article->isNotPublished()) diff --git a/resources/views/livewire/show-articles.blade.php b/resources/views/livewire/show-articles.blade.php index 28d34ff34..67d830cdf 100644 --- a/resources/views/livewire/show-articles.blade.php +++ b/resources/views/livewire/show-articles.blade.php @@ -1,4 +1,4 @@ -
+
Loading... From 0c7138895cd3f35d2834a979e75bca5c0de4ebc0 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Sun, 7 Jun 2020 20:51:29 +0100 Subject: [PATCH 03/14] Rename nav link --- resources/views/layouts/_nav.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/layouts/_nav.blade.php b/resources/views/layouts/_nav.blade.php index 4dad8b14f..03a1beb99 100644 --- a/resources/views/layouts/_nav.blade.php +++ b/resources/views/layouts/_nav.blade.php @@ -109,7 +109,7 @@ Dashboard - Articles + My Articles Settings @@ -203,7 +203,7 @@ Dashboard - Articles + My Articles Settings From 5289a02b3eded49a5ea386b1b578bedc35b4bb3c Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Sun, 7 Jun 2020 20:52:14 +0100 Subject: [PATCH 04/14] Fix typo --- resources/lang/en/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/en/admin.php b/resources/lang/en/admin.php index e8190cf06..bc5268c95 100644 --- a/resources/lang/en/admin.php +++ b/resources/lang/en/admin.php @@ -6,5 +6,5 @@ 'users.unbanned' => ':0 was unbanned!', 'users.deleted' => ':0 was deleted and all of their content was removed!', 'articles.approved' => 'The article has been approved and is live on the site.', - 'articles.approved' => 'The article has been disapproved and removed from the site.', + 'articles.disapproved' => 'The article has been disapproved and removed from the site.', ]; From e9978d7fc4ee67245d700285231e59d3d0fef7e2 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Mon, 8 Jun 2020 08:40:50 +0100 Subject: [PATCH 05/14] Remove latest articles --- .../views/users/_latest_articles.blade.php | 70 ------------------- resources/views/users/dashboard.blade.php | 7 -- 2 files changed, 77 deletions(-) delete mode 100644 resources/views/users/_latest_articles.blade.php diff --git a/resources/views/users/_latest_articles.blade.php b/resources/views/users/_latest_articles.blade.php deleted file mode 100644 index 521c98319..000000000 --- a/resources/views/users/_latest_articles.blade.php +++ /dev/null @@ -1,70 +0,0 @@ -
-
- @forelse ($user->latestArticles(5) as $article) -
- - -
-
-
-
- @if ($article->isPublished()) - Published {{ $article->submittedAt()->diffForHumans() }} - @else - @if($article->isAwaitingApproval()) - Awaiting Approval - @else - Drafted {{ $article->updatedAt()->diffForHumans() }} - @endif - @endif -
-
- - @if (count($article->tags())) -
- @foreach ($article->tags() as $tag) - - {{ $tag->name() }} - - @endforeach -
- @endif -
-
-
- @empty -

- {{ $user->name() }} has not posted any articles yet -

- @endforelse -
-
diff --git a/resources/views/users/dashboard.blade.php b/resources/views/users/dashboard.blade.php index 9be2e8038..d76e38f4b 100644 --- a/resources/views/users/dashboard.blade.php +++ b/resources/views/users/dashboard.blade.php @@ -24,9 +24,6 @@ Latest Replies - - Latest Articles -
@@ -43,10 +40,6 @@
@include('users._latest_replies', ['user' => Auth::user()])
- -
- @include('users._latest_articles', ['user' => Auth::user()]) -
From 366f2da24f63d0673618c4cab18c3fe0ed73db35 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Mon, 8 Jun 2020 08:55:07 +0100 Subject: [PATCH 06/14] Remove hover state on labels --- resources/css/labels.css | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/resources/css/labels.css b/resources/css/labels.css index d3bc960d1..cb0946ff0 100644 --- a/resources/css/labels.css +++ b/resources/css/labels.css @@ -2,15 +2,21 @@ @apply px-2 py-1 rounded text-xs uppercase bg-gray-300 text-gray-700 px-2 py-1 cursor-pointer; } -.label:hover { - @apply bg-gray-400; +a.label:hover, +button.label:hover { + @apply bg-gray-400 no-underline; +} + +span.label:hover { + @apply cursor-auto; } .label-primary { @apply bg-green-primary text-white; } -.label-primary:hover { +a.label-primary:hover, +button.label-primary:hover { @apply bg-green-dark; } @@ -18,10 +24,7 @@ @apply bg-red-primary text-white; } -.label-danger:hover { +a.label-danger:hover, +button.label-danger:hover { @apply bg-red-dark; } - -a.label:hover { - @apply no-underline; -} From 69c109fa5d3b873f6213c96dbc88b01a48a6ec0c Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Mon, 8 Jun 2020 21:25:33 +0100 Subject: [PATCH 07/14] Refactor active helper --- resources/css/custom.css | 28 +++++++++++++++++++ resources/helpers.php | 2 +- .../admin/partials/_navigation.blade.php | 4 +-- resources/views/layouts/_nav.blade.php | 8 +++--- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/resources/css/custom.css b/resources/css/custom.css index baad0b68d..8297d9b0c 100644 --- a/resources/css/custom.css +++ b/resources/css/custom.css @@ -38,6 +38,34 @@ nav.dashboard-nav a.active { @apply border-green-primary text-green-primary; } +.nav a { + @apply border-transparent text-gray-500; +} + +.nav a:hover { + @apply text-gray-700 border-green-primary; +} + +.nav a.active { + @apply border-green-primary text-gray-900 +} + +.nav a.active:focus { + @apply border-green-dark; +} + +.nav .dropdown a { + @apply block px-4 py-2 text-sm leading-5 text-gray-700 transition duration-150 ease-in-out; +} + +.nav .dropdown a:hover { + @apply bg-gray-100 +} + +.nav .dropdown a:focus { + @apply outline-none bg-gray-100; +} + a > span > em { @apply bg-green-light; } diff --git a/resources/helpers.php b/resources/helpers.php index 8fb86d788..11103d76e 100644 --- a/resources/helpers.php +++ b/resources/helpers.php @@ -6,7 +6,7 @@ */ function active($routes, bool $condition = true): string { - return call_user_func_array([app('router'), 'is'], (array) $routes) && $condition ? ' border-green-primary focus:border-green-dark text-gray-900' : ' border-transparent text-gray-500 hover:text-gray-700 hover:border-green-primary'; + return call_user_func_array([app('router'), 'is'], (array) $routes) && $condition ? 'active' : ''; } } diff --git a/resources/views/admin/partials/_navigation.blade.php b/resources/views/admin/partials/_navigation.blade.php index 161e5a08a..0dd2fe8e0 100644 --- a/resources/views/admin/partials/_navigation.blade.php +++ b/resources/views/admin/partials/_navigation.blade.php @@ -1,10 +1,10 @@