-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add toggles for quick-switching the link display mode from pages (#553)
- Loading branch information
Showing
12 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Traits; | ||
|
||
use App\Models\Link; | ||
use App\Settings\UserSettings; | ||
|
||
trait ConfiguresListDisplay | ||
{ | ||
public function saveNewListDisplay(): void | ||
{ | ||
$newSetting = request()?->input('list-type'); | ||
if ($newSetting === null) { | ||
return; | ||
} | ||
|
||
if (in_array($newSetting, [Link::DISPLAY_LIST_SIMPLE, Link::DISPLAY_LIST_DETAILED, Link::DISPLAY_CARDS])) { | ||
$userSettings = app(UserSettings::class); | ||
$userSettings->link_display_mode = $newSetting; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { debounce } from '../lib/helper'; | ||
|
||
export default class UpdateCheck { | ||
|
||
constructor ($el) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<svg {{ $attributes->merge(['class' => 'icon', 'aria-label' => 'List of Cards']) }} viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<rect width="128" height="128" rx="7" fill="currentColor"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<svg {{ $attributes->merge(['class' => 'icon', 'aria-label' => 'Detailed List']) }} viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<rect width="128" height="55" rx="7" fill="currentColor"/> | ||
<rect y="71" width="128" height="55" rx="7" fill="currentColor"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<svg {{ $attributes->merge(['class' => 'icon', 'aria-label' => 'Simple List']) }} viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<rect width="128" height="34" rx="7" fill="currentColor"/> | ||
<rect y="94" width="128" height="34" rx="7" fill="currentColor"/> | ||
<rect y="47" width="128" height="34" rx="7" fill="currentColor"/> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
resources/views/models/links/partials/list-toggles.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="link-display-toggles"> | ||
<a href="{{ request()->fullUrlWithQuery(['list-type' => Link::DISPLAY_LIST_SIMPLE]) }}" | ||
class="{{ usersettings('link_display_mode') === Link::DISPLAY_LIST_SIMPLE ? 'active' : ''}}" | ||
data-bs-toggle="tooltip" data-bs-placement="bottom" title="Display Links as simple List"> | ||
<x-icon.list-simple/> | ||
</a> | ||
<a href="{{ request()->fullUrlWithQuery(['list-type' => Link::DISPLAY_LIST_DETAILED]) }}" | ||
class="ms-1 {{ usersettings('link_display_mode') === Link::DISPLAY_LIST_DETAILED ? 'active' : ''}}" | ||
data-bs-toggle="tooltip" data-bs-placement="bottom" title="Display Links as detailed List"> | ||
<x-icon.list-detailed/> | ||
</a> | ||
<a href="{{ request()->fullUrlWithQuery(['list-type' => Link::DISPLAY_CARDS]) }}" | ||
class="ms-1 {{ usersettings('link_display_mode') === Link::DISPLAY_CARDS ? 'active' : ''}}" | ||
data-bs-toggle="tooltip" data-bs-placement="bottom" title="Display Links as Cards"> | ||
<x-icon.list-cards/> | ||
</a> | ||
</div> |