-
app/Traits/HasStatus.php
Open in GitHubtrait HasStatus { public function isPinned(): bool { return $this->getStatus() === ContentStatus::PINNED; } }
-
app/File.php
Open in GitHubuse App\Traits\HasStatus; use Illuminate\Database\Eloquent\Model; class File extends Model { use HasStatus; }
-
resources/views/files/file.blade.php
Open in GitHub<div class="py-3 border-gray-300 border-b flex @if ($file->isArchived()) status-archived @endif @if ($file->isPinned()) status-pinned @endif" up-expand> <div class="relative"> @if ($file->isPinned()) <div class="text-xs absolute right-0 w-6 h-6 rounded-full text-white bg-blue-700 flex items-center justify-center border-white border-2 shadow-md "> <i class="fas fa-thumbtack" title="{{__('Pinned')}}"></i> </div> @endif </div> </div>
-
app/Group.php
Open in GitHubuse App\Traits\HasStatus; use Illuminate\Database\Eloquent\Model; class Group extends Model { use HasStatus; }
-
resources/views/groups/group.blade.php
Open in GitHub@if($group->isPinned()) <div class="absolute top-0 left-0 py-1 px-2 bg-gray-700 text-gray-200 capitalize rounded-full m-2 text-xs shadow" title="{{ trans('group.pinned') }}"> <i class="far fa-star"></i> </div> @endif