Save workspace changes
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
@extends('layouts.nova')
|
||||
|
||||
@section('content')
|
||||
<div class="container legacy-page">
|
||||
<div class="page-header-wrap">
|
||||
<div class="clearfix">
|
||||
<h2 style="margin:0;display:inline-block">Edit Artwork</h2>
|
||||
<a class="btn btn-default btn-xs pull-right" href="{{ route('dashboard.artworks.index') }}" style="margin-top:6px">
|
||||
<i class="fa fa-arrow-left fa-fw"></i> Back to list
|
||||
</a>
|
||||
</div>
|
||||
<div class="text-muted" style="margin-top:6px;font-size:12px">
|
||||
#{{ $artwork->id }} · {{ $artwork->is_public ? 'Public' : 'Private' }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success" role="status">{{ session('status') }}</div>
|
||||
@endif
|
||||
|
||||
@if($errors->any())
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<strong>Please fix the errors below.</strong>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="panel panel-default uploads-panel">
|
||||
<div class="panel-body">
|
||||
<form method="POST" action="{{ route('dashboard.artworks.update', $artwork->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="form-group @error('title') has-error @enderror">
|
||||
<label for="title" class="control-label">Title</label>
|
||||
<input id="title" type="text" name="title" class="form-control" value="{{ old('title', $artwork->title) }}" required>
|
||||
@error('title')
|
||||
<span class="help-block">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="form-group @error('description') has-error @enderror">
|
||||
<label for="description" class="control-label">Description</label>
|
||||
<textarea id="description" name="description" class="form-control" rows="8">{{ old('description', $artwork->description) }}</textarea>
|
||||
@error('description')
|
||||
<span class="help-block">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fa fa-save fa-fw"></i> Save Changes
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<label class="control-label">Preview</label>
|
||||
<div class="thumbnail" style="margin-top:6px">
|
||||
<img
|
||||
src="{{ $artwork->thumb_url ?? $artwork->thumb }}"
|
||||
@if(!empty($artwork->thumb_srcset)) srcset="{{ $artwork->thumb_srcset }}" @endif
|
||||
sizes="(max-width: 992px) 100vw, 400px"
|
||||
class="img-responsive"
|
||||
alt="{{ $artwork->title }}"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="form-group @error('file') has-error @enderror">
|
||||
<label for="file" class="control-label">Replace image (optional)</label>
|
||||
<input id="file" type="file" name="file" class="form-control" accept="image/*">
|
||||
<p class="help-block">Max 100MB. Images only.</p>
|
||||
@error('file')
|
||||
<span class="help-block">{{ $message }}</span>
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<p class="text-muted" style="font-size:12px;margin-bottom:0">
|
||||
Created: {{ optional($artwork->created_at)->format('d.m.Y') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,105 @@
|
||||
@extends('layouts.nova')
|
||||
|
||||
@section('content')
|
||||
<div class="container legacy-page">
|
||||
<div class="page-header-wrap">
|
||||
<div class="clearfix">
|
||||
<h2 style="margin:0;display:inline-block">My Artworks</h2>
|
||||
<span class="text-muted pull-right" style="margin-top:6px">
|
||||
{{ method_exists($artworks, 'total') ? $artworks->total() : $artworks->count() }} items
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-muted" style="margin-top:6px;font-size:12px">Manage and edit your uploads.</div>
|
||||
</div>
|
||||
|
||||
@if(session('status'))
|
||||
<div class="alert alert-success" role="status">{{ session('status') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="panel panel-default uploads-panel">
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover table-advanced" style="margin-bottom:0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:92px">Preview</th>
|
||||
<th>Title</th>
|
||||
<th style="width:120px" class="text-center">Created</th>
|
||||
<th style="width:90px" class="text-center">Public</th>
|
||||
<th style="width:95px" class="text-center">Approved</th>
|
||||
<th style="width:150px" class="text-center">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($artworks as $artwork)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<a href="{{ route('dashboard.artworks.edit', $artwork->id) }}" title="Edit {{ $artwork->title }}">
|
||||
<img
|
||||
src="{{ $artwork->thumb_url ?? $artwork->thumb }}"
|
||||
@if(!empty($artwork->thumb_srcset)) srcset="{{ $artwork->thumb_srcset }}" @endif
|
||||
sizes="70px"
|
||||
alt="{{ $artwork->title }}"
|
||||
class="img-thumbnail"
|
||||
style="width:70px;height:70px;object-fit:cover"
|
||||
>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<div style="font-weight:700;line-height:1.2">
|
||||
<a href="{{ route('dashboard.artworks.edit', $artwork->id) }}">{{ $artwork->title }}</a>
|
||||
</div>
|
||||
<div class="text-muted" style="font-size:12px">#{{ $artwork->id }}</div>
|
||||
@if(!empty($artwork->description))
|
||||
<div class="text-muted" style="margin-top:4px;font-size:12px">
|
||||
{{ str($artwork->description)->stripTags()->limit(120) }}
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">{{ optional($artwork->created_at)->format('d.m.Y') }}</td>
|
||||
<td class="text-center">
|
||||
@if($artwork->is_public)
|
||||
<span class="label label-success">Yes</span>
|
||||
@else
|
||||
<span class="label label-default">No</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if($artwork->is_approved)
|
||||
<span class="label label-primary">Yes</span>
|
||||
@else
|
||||
<span class="label label-warning">No</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group" role="group" aria-label="Actions">
|
||||
<a href="{{ route('dashboard.artworks.edit', $artwork->id) }}" class="btn btn-xs btn-default">
|
||||
<i class="fa fa-pencil fa-fw"></i> Edit
|
||||
</a>
|
||||
|
||||
<form method="POST" action="{{ route('dashboard.artworks.destroy', $artwork->id) }}" style="display:inline-block" onsubmit="return confirm('Delete this artwork?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-xs btn-danger">
|
||||
<i class="fa fa-trash fa-fw"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6">No artworks found.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="paginationMenu text-center">
|
||||
{{ $artworks->links('pagination::bootstrap-3') }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,56 @@
|
||||
@extends('layouts.nova')
|
||||
|
||||
@php
|
||||
$presentMd = $presentMd ?? \App\Services\ThumbnailPresenter::present($artwork, 'md');
|
||||
$presentLg = $presentLg ?? \App\Services\ThumbnailPresenter::present($artwork, 'lg');
|
||||
$presentXl = $presentXl ?? \App\Services\ThumbnailPresenter::present($artwork, 'xl');
|
||||
$presentSq = $presentSq ?? \App\Services\ThumbnailPresenter::present($artwork, 'sq');
|
||||
$canonicalUrl = route('art.show', ['id' => $artwork->id, 'slug' => $artwork->slug]);
|
||||
|
||||
$meta = $meta ?? [
|
||||
'title' => trim((string) ($artwork->title ?? 'Artwork') . ' by ' . (string) ($artwork->user?->name ?? $artwork->user?->username ?? 'Unknown Author') . ' | Skinbase'),
|
||||
'description' => (string) ($artwork->description ?? ''),
|
||||
'canonical' => $canonicalUrl,
|
||||
'og_image' => $presentXl['url'] ?? $presentLg['url'] ?? $presentMd['url'] ?? null,
|
||||
'og_width' => $presentXl['width'] ?? $presentLg['width'] ?? null,
|
||||
'og_height' => $presentXl['height'] ?? $presentLg['height'] ?? null,
|
||||
];
|
||||
|
||||
$artworkData = $artworkData ?? [];
|
||||
$relatedItems = $relatedItems ?? [];
|
||||
$comments = $comments ?? [];
|
||||
$groupSummary = $groupSummary ?? null;
|
||||
$useUnifiedSeo = true;
|
||||
@endphp
|
||||
|
||||
@push('head')
|
||||
@php
|
||||
$preloadSrcset = ($presentMd['url'] ?? '') . ' 640w, ' . ($presentLg['url'] ?? '') . ' 1280w, ' . ($presentXl['url'] ?? '') . ' 1920w';
|
||||
@endphp
|
||||
|
||||
@if(!empty($presentLg['url']))
|
||||
<link rel="preload" as="image"
|
||||
href="{{ $presentLg['url'] }}"
|
||||
imagesrcset="{{ trim($preloadSrcset) }}"
|
||||
imagesizes="(min-width: 1280px) 1200px, (min-width: 768px) 90vw, 100vw">
|
||||
@endif
|
||||
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div id="artwork-page"
|
||||
data-artwork='@json($artworkData)'
|
||||
data-related='@json($relatedItems)'
|
||||
data-present-md='@json($presentMd)'
|
||||
data-present-lg='@json($presentLg)'
|
||||
data-present-xl='@json($presentXl)'
|
||||
data-present-sq='@json($presentSq)'
|
||||
data-cdn='@json(rtrim((string) config("cdn.files_url", "https://files.skinbase.org"), "/"))'
|
||||
data-canonical='@json($meta["canonical"])'
|
||||
data-comments='@json($comments)'
|
||||
data-group-summary='@json($groupSummary)'
|
||||
data-is-authenticated='@json(auth()->check())'>
|
||||
</div>
|
||||
|
||||
@vite(['resources/js/Pages/ArtworkPage.jsx'])
|
||||
@endsection
|
||||
Reference in New Issue
Block a user