From bbd0ff001209b3d18c9b4b304869ef58da5a33b0 Mon Sep 17 00:00:00 2001 From: Kovah Date: Thu, 24 Oct 2019 15:44:03 +0200 Subject: [PATCH 1/6] Reduce number of tags assigned to links in Example seeder --- database/seeds/ExampleSeeder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/seeds/ExampleSeeder.php b/database/seeds/ExampleSeeder.php index 54ac01ce..99c63478 100644 --- a/database/seeds/ExampleSeeder.php +++ b/database/seeds/ExampleSeeder.php @@ -21,7 +21,7 @@ public function run() factory(\App\Models\Link::class, 50)->create()->each(function (\App\Models\Link $link) use ($tags) { if (random_int(0, 1)) { // Attach a random number of tags to the link - $link->tags()->sync($tags->random(random_int(1, 30))->pluck('id')); + $link->tags()->sync($tags->random(random_int(1, 8))->pluck('id')); } }); } From 3a35066bde155217615fd1a65e832f166e5ec06d Mon Sep 17 00:00:00 2001 From: Kovah Date: Thu, 24 Oct 2019 15:44:28 +0200 Subject: [PATCH 2/6] Add an alternative link view as cards, controllable via setting --- resources/lang/en/settings.php | 4 ++ .../settings/partials/app-settings.blade.php | 25 +++++++ resources/views/models/links/index.blade.php | 14 ++-- .../links/partials/single-cards.blade.php | 72 +++++++++++++++++++ 4 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 resources/views/models/links/partials/single-cards.blade.php diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index e900f957..d361a923 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -17,6 +17,10 @@ 'notes_private_default' => 'Private Notes by default', 'notes_private_default_help' => 'Enabling this will make all new notes private by default', + 'display_mode' => 'Display links as', + 'display_mode_standard' => 'rows with much details', + 'display_mode_cards' => 'cards with less details', + 'sharing' => 'Link Sharing', 'sharing_help' => 'Enable all services you want to display for links, to be able to share them easily with one click.', 'sharing_toggle' => 'Toggle all on/off', diff --git a/resources/views/actions/settings/partials/app-settings.blade.php b/resources/views/actions/settings/partials/app-settings.blade.php index a05f1bb2..1a6ed96e 100644 --- a/resources/views/actions/settings/partials/app-settings.blade.php +++ b/resources/views/actions/settings/partials/app-settings.blade.php @@ -162,6 +162,31 @@ class="custom-select{{ $errors->has('listitem_count') ? ' is-invalid' : '' }}"> +
+ +
+ + + @if ($errors->has('link_display_mode')) + + @endif +
+ +
diff --git a/resources/views/models/links/index.blade.php b/resources/views/models/links/index.blade.php index 35b5ed75..d268ac7c 100644 --- a/resources/views/models/links/index.blade.php +++ b/resources/views/models/links/index.blade.php @@ -12,12 +12,18 @@ -