mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update status edit view
This commit is contained in:
parent
d366adab7d
commit
28bc9c1923
3 changed files with 13 additions and 9 deletions
|
@ -978,6 +978,9 @@ class ApiV1Controller extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$filterClass = in_array($request->input('filter_class'), Filter::classes()) ? $request->input('filter_class') : null;
|
||||
$filterName = in_array($request->input('filter_name'), Filter::names()) ? $request->input('filter_name') : null;
|
||||
|
||||
$monthHash = hash('sha1', date('Y').date('m'));
|
||||
$userHash = hash('sha1', $user->id . (string) $user->created_at);
|
||||
|
||||
|
@ -1001,8 +1004,8 @@ class ApiV1Controller extends Controller
|
|||
$media->size = $photo->getSize();
|
||||
$media->mime = $photo->getMimeType();
|
||||
$media->caption = $request->input('description');
|
||||
$media->filter_class = $request->input('filter_class');
|
||||
$media->filter_name = $request->input('filter_name');
|
||||
$media->filter_class = $filterClass;
|
||||
$media->filter_name = $filterName;
|
||||
$media->save();
|
||||
|
||||
switch ($media->mime) {
|
||||
|
|
|
@ -24,6 +24,7 @@ use App\Transformer\Api\{
|
|||
StatusTransformer
|
||||
};
|
||||
use League\Fractal;
|
||||
use App\Util\Media\Filter;
|
||||
use League\Fractal\Serializer\ArraySerializer;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use App\Jobs\AvatarPipeline\AvatarOptimize;
|
||||
|
@ -231,6 +232,9 @@ class BaseApiController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$filterClass = in_array($request->input('filter_class'), Filter::classes()) ? $request->input('filter_class') : null;
|
||||
$filterName = in_array($request->input('filter_name'), Filter::names()) ? $request->input('filter_name') : null;
|
||||
|
||||
$monthHash = hash('sha1', date('Y').date('m'));
|
||||
$userHash = hash('sha1', $user->id . (string) $user->created_at);
|
||||
|
||||
|
@ -253,8 +257,8 @@ class BaseApiController extends Controller
|
|||
$media->original_sha256 = $hash;
|
||||
$media->size = $photo->getSize();
|
||||
$media->mime = $photo->getMimeType();
|
||||
$media->filter_class = $request->input('filter_class');
|
||||
$media->filter_name = $request->input('filter_name');
|
||||
$media->filter_class = $filterClass;
|
||||
$media->filter_name = $filterName;
|
||||
$media->save();
|
||||
|
||||
$url = URL::temporarySignedRoute(
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
@csrf
|
||||
<input type="hidden" name="media_id" value="{{$media->id}}">
|
||||
<div class="filter-wrapper {{$media->filter_class}}" data-filter="{{$media->filter_class}}">
|
||||
<img class="img-fluid" src="{{$media->thumbnailUrl()}}" width="100%">
|
||||
<img class="img-fluid" src="{{$media->url()}}" width="100%">
|
||||
</div>
|
||||
<div class="p-3">
|
||||
<div class="form-group">
|
||||
|
@ -69,12 +69,9 @@
|
|||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript" src="{{ mix('js/compose.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
new Vue({
|
||||
el: '#content'
|
||||
});
|
||||
App.boot();
|
||||
$('.form-filters').each(function(i,d) {
|
||||
let el = $(d);
|
||||
let filter = el.data('filter');
|
||||
|
|
Loading…
Reference in a new issue