blue-twilight/resources/views/themes/base/admin/create_storage.blade.php

99 lines
4.5 KiB
PHP
Raw Normal View History

@extends('themes.base.layout')
@section('title', trans('admin.create_storage'))
@section('breadcrumb')
<li class="breadcrumb-item"><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
<li class="breadcrumb-item"><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
<li class="breadcrumb-item"><a href="{{ route('storage.index') }}">@lang('navigation.breadcrumb.storage')</a></li>
<li class="breadcrumb-item active">@lang('navigation.breadcrumb.create_storage')</li>
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col">
<h1>@lang('admin.create_storage')</h1>
<p>@lang('admin.create_storage_intro')</p>
<hr/>
<form action="{{ route('storage.store') }}" method="post" id="storage-options">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('name') ? ' has-danger' : '' }}">
<label class="form-control-label" for="storage-name">@lang('forms.name_label')</label>
<input type="text" class="form-control" id="storage-name" name="name" value="{{ old('name') }}">
@if ($errors->has('name'))
<div class="form-control-feedback">
<strong>{{ $errors->first('name') }}</strong>
</div>
@endif
</div>
<div class="form-group">
<div class="form-group{{ $errors->has('source') ? ' has-danger' : '' }}">
<label class="form-control-label" for="storage-source">@lang('forms.storage_driver_label')</label>
<select id="storage-source" name="source" class="form-control" v-model="storage_driver">
@foreach ($album_sources as $key => $value)
<option value="{{ $key }}"{{ old('source') == $key ? ' selected="selected"' : '' }}>{{ $value }}</option>
@endforeach
</select>
@if ($errors->has('source'))
<div class="form-control-feedback">
<strong>{{ $errors->first('source') }}</strong>
</div>
@endif
</div>
</div>
<div v-if="storage_driver == 'LocalFilesystemSource'">
@include(Theme::viewName('partials.admin_storages_filesystem_options'))
</div>
<div v-if="storage_driver == 'OpenStackV1Source'">
@include(Theme::viewName('partials.admin_storages_openstack_v1_options'))
</div>
<div v-if="storage_driver == 'OpenStackSource'">
@include(Theme::viewName('partials.admin_storages_openstack_options'))
</div>
<div v-if="storage_driver == 'AmazonS3Source'">
@include(Theme::viewName('partials.admin_storages_amazon_s3_options'))
</div>
<div v-if="storage_driver == 'RackspaceSource'">
@include(Theme::viewName('partials.admin_storages_rackspace_options'))
</div>
<div class="form-check">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="is_default">
@lang('forms.default_storage_label')
</label>
</div>
<div class="text-right">
<a href="{{ route('storage.index') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
<button type="submit" class="btn btn-success"><i class="fa fa-fw fa-check"></i> @lang('forms.create_action')</button>
</div>
</form>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(function()
{
var viewModel = new StorageLocationViewModel();
var app = new Vue(viewModel);
@if (strlen(old('source')) > 0)
app.storage_driver = '{{ old('source') }}';
@endif
});
</script>
@endpush