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

196 lines
10 KiB
PHP
Raw Normal View History

@extends('themes.base.layout')
@section('title', trans('admin.create_storage'))
@section('breadcrumb')
<div class="breadcrumb">
<div class="container">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-fw fa-home"></i></a></li>
<li><a href="{{ route('admin') }}">@lang('navigation.breadcrumb.admin')</a></li>
<li><a href="{{ route('storage.index') }}">@lang('navigation.breadcrumb.storage')</a></li>
<li class="active">@lang('navigation.breadcrumb.create_storage')</li>
</ol>
</div>
</div>
@endsection
@section('content')
<div class="container">
<div class="row">
<div class="col-xs-12">
<h1>@lang('admin.create_storage')</h1>
<p>@lang('admin.create_storage_intro')</p>
<hr/>
{!! Form::open(['route' => 'storage.store', 'method' => 'POST']) !!}
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
{!! Form::label('name', trans('forms.name_label'), ['class' => 'control-label']) !!}
{!! Form::text('name', old('name'), ['class' => 'form-control']) !!}
@if ($errors->has('name'))
<span class="help-block">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
</div>
<div class="form-group">
{!! Form::label('source', trans('forms.storage_driver_label'), ['class' => 'control-label']) !!}
{!! Form::select('source', $album_sources, old('source'), ['class' => 'form-control', 'data-bind' => 'value: selectedLocation']) !!}
</div>
<div id="storage-options">
<div data-bind="visible: selectedLocation() == 'LocalFilesystemSource'">
<div class="form-group{{ $errors->has('location') ? ' has-error' : '' }}">
{!! Form::label('location', trans('forms.storage_location_label'), ['class' => 'control-label']) !!}
{!! Form::text('location', old('location', $filesystem_default_location), ['class' => 'form-control']) !!}
@if ($errors->has('location'))
<span class="help-block">
<strong>{{ $errors->first('location') }}</strong>
</span>
@endif
</div>
</div>
<div data-bind="visible: selectedLocation() == 'OpenStackV1Source'">
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('auth_url') ? ' has-error' : '' }}">
{!! Form::label('auth_url', trans('forms.storage_auth_url_label'), ['class' => 'control-label']) !!}
{!! Form::text('auth_url', old('auth_url'), ['class' => 'form-control']) !!}
@if ($errors->has('auth_url'))
<span class="help-block">
<strong>{{ $errors->first('auth_url') }}</strong>
</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group{{ $errors->has('tenant_name') ? ' has-error' : '' }}">
{!! Form::label('tenant_name', trans('forms.storage_tenant_name_label'), ['class' => 'control-label']) !!}
{!! Form::text('tenant_name', old('tenant_name'), ['class' => 'form-control']) !!}
@if ($errors->has('tenant_name'))
<span class="help-block">
<strong>{{ $errors->first('tenant_name') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
{!! Form::label('username', trans('forms.username_label'), ['class' => 'control-label']) !!}
{!! Form::text('username', old('username'), ['class' => 'form-control']) !!}
@if ($errors->has('username'))
<span class="help-block">
<strong>{{ $errors->first('username') }}</strong>
</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
{!! Form::label('password', trans('forms.password_label'), ['class' => 'control-label']) !!}
{!! Form::text('password', old('password'), ['class' => 'form-control']) !!}
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group{{ $errors->has('service_name') ? ' has-error' : '' }}">
{!! Form::label('service_name', trans('forms.storage_service_name_label'), ['class' => 'control-label']) !!}
{!! Form::text('service_name', old('service_name'), ['class' => 'form-control']) !!}
@if ($errors->has('service_name'))
<span class="help-block">
<strong>{{ $errors->first('service_name') }}</strong>
</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group{{ $errors->has('service_region') ? ' has-error' : '' }}">
{!! Form::label('service_region', trans('forms.storage_service_region_label'), ['class' => 'control-label']) !!}
{!! Form::text('service_region', old('service_region'), ['class' => 'form-control']) !!}
@if ($errors->has('service_region'))
<span class="help-block">
<strong>{{ $errors->first('service_region') }}</strong>
</span>
@endif
</div>
</div>
</div>
<div class="form-group{{ $errors->has('container_name') ? ' has-error' : '' }}">
{!! Form::label('container_name', trans('forms.storage_container_name_label'), ['class' => 'control-label']) !!}
{!! Form::text('container_name', old('container_name'), ['class' => 'form-control']) !!}
@if ($errors->has('container_name'))
<span class="help-block">
<strong>{{ $errors->first('container_name') }}</strong>
</span>
@endif
</div>
<div class="form-group{{ $errors->has('cdn_url') ? ' has-error' : '' }}">
{!! Form::label('cdn_url', trans('forms.storage_cdn_url_label'), ['class' => 'control-label']) !!}
{!! Form::text('cdn_url', old('cdn_url'), ['class' => 'form-control']) !!}
@if ($errors->has('cdn_url'))
<span class="help-block">
<strong>{{ $errors->first('cdn_url') }}</strong>
</span>
@endif
</div>
</div>
<div data-bind="visible: selectedLocation() == 'OpenStackSource'">
@include(Theme::viewName('partials.admin_storages_openstack_options'))
</div>
<div data-bind="visible: selectedLocation() == 'AmazonS3Source'">
@include(Theme::viewName('partials.admin_storages_amazon_s3_options'))
</div>
<div data-bind="visible: selectedLocation() == 'RackspaceSource'">
@include(Theme::viewName('partials.admin_storages_rackspace_options'))
</div>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="is_default">
<strong>@lang('forms.default_storage_label')</strong>
</label>
</div>
<div class="form-actions">
<a href="{{ route('storage.index') }}" class="btn btn-default">@lang('forms.cancel_action')</a>
{!! Form::submit(trans('forms.create_action'), ['class' => 'btn btn-success']) !!}
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
var viewModel = new StorageLocationsViewModel();
ko.applyBindings(viewModel);
</script>
@endpush