2016-11-29 18:47:26 +01:00
|
|
|
@extends('header')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
{!! Former::open($url)
|
|
|
|
->addClass('col-md-10 col-md-offset-1 warn-on-exit')
|
|
|
|
->method($method)
|
|
|
|
->rules([
|
|
|
|
'name' => 'required',
|
2016-12-15 13:17:10 +01:00
|
|
|
'client_id' => 'required',
|
2016-11-29 18:47:26 +01:00
|
|
|
]) !!}
|
|
|
|
|
|
|
|
@if ($project)
|
|
|
|
{!! Former::populate($project) !!}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<span style="display:none">
|
|
|
|
{!! Former::text('public_id') !!}
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10 col-md-offset-1">
|
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">{!! trans('texts.project') !!}</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
|
2016-12-15 13:17:10 +01:00
|
|
|
@if ($project)
|
|
|
|
{!! Former::plaintext('client_name')
|
2017-06-04 21:47:21 +02:00
|
|
|
->value($project->client ? $project->client->present()->link : '') !!}
|
2016-12-15 13:17:10 +01:00
|
|
|
@else
|
|
|
|
{!! Former::select('client_id')
|
|
|
|
->addOption('', '')
|
|
|
|
->label(trans('texts.client'))
|
|
|
|
->addGroupClass('client-select') !!}
|
|
|
|
@endif
|
|
|
|
|
2016-11-29 18:47:26 +01:00
|
|
|
{!! Former::text('name') !!}
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<center class="buttons">
|
2017-07-31 21:14:14 +02:00
|
|
|
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/projects'))->appendIcon(Icon::create('remove-circle')) !!}
|
2016-11-29 18:47:26 +01:00
|
|
|
{!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
|
2017-01-15 22:23:46 +01:00
|
|
|
@if ($project && Auth::user()->can('create', ENTITY_TASK))
|
|
|
|
{!! Button::primary(trans('texts.new_task'))->large()
|
2017-03-02 17:23:07 +01:00
|
|
|
->asLinkTo(url('/tasks/create/' . ($project->client ? $project->client->public_id : '0'). '/' . $project->public_id))
|
2017-01-15 22:23:46 +01:00
|
|
|
->appendIcon(Icon::create('plus-sign')) !!}
|
|
|
|
@endif
|
2016-11-29 18:47:26 +01:00
|
|
|
</center>
|
|
|
|
|
|
|
|
{!! Former::close() !!}
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
2017-05-08 21:10:39 +02:00
|
|
|
var clients = {!! $clients !!};
|
2016-11-29 18:47:26 +01:00
|
|
|
|
|
|
|
$(function() {
|
|
|
|
var $clientSelect = $('select#client_id');
|
|
|
|
for (var i=0; i<clients.length; i++) {
|
|
|
|
var client = clients[i];
|
|
|
|
var clientName = getClientDisplayName(client);
|
|
|
|
if (!clientName) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$clientSelect.append(new Option(clientName, client.public_id));
|
|
|
|
}
|
|
|
|
@if ($clientPublicId)
|
|
|
|
$clientSelect.val({{ $clientPublicId }});
|
|
|
|
@endif
|
2016-12-15 13:17:10 +01:00
|
|
|
|
2017-01-16 10:30:31 +01:00
|
|
|
$clientSelect.combobox();
|
|
|
|
|
|
|
|
@if ($clientPublicId)
|
|
|
|
$('#name').focus();
|
|
|
|
@else
|
|
|
|
$('.client-select input.form-control').focus();
|
|
|
|
@endif
|
2016-11-29 18:47:26 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@stop
|