current state
This commit is contained in:
85
resources/views/artworks/edit.blade.php
Normal file
85
resources/views/artworks/edit.blade.php
Normal file
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.legacy')
|
||||
|
||||
@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
|
||||
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
|
||||
104
resources/views/artworks/index.blade.php
Normal file
104
resources/views/artworks/index.blade.php
Normal file
@@ -0,0 +1,104 @@
|
||||
@extends('layouts.legacy')
|
||||
|
||||
@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
|
||||
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
|
||||
Reference in New Issue
Block a user