@extends('header') @section('content') {!! Former::open($url) ->addClass('col-lg-10 col-lg-offset-1 warn-on-exit main-form') ->method($method) ->rules([ 'name' => 'required', 'client_id' => 'required', ]) !!} @if ($project) {!! Former::populate($project) !!} {!! Former::populateField('task_rate', floatval($project->task_rate) ? Utils::roundSignificant($project->task_rate) : '') !!} @endif {!! Former::text('public_id') !!} {!! Former::text('action') !!}

{!! trans('texts.project') !!}

@if ($project) {!! Former::plaintext('client_name') ->value($project->client ? $project->client->present()->link : '') !!} @else {!! Former::select('client_id') ->addOption('', '') ->label(trans('texts.client')) ->addGroupClass('client-select') !!} @endif {!! Former::text('name') !!} {!! Former::text('task_rate') ->placeholder($project && $project->client->task_rate ? $project->client->present()->taskRate : $account->present()->taskRate) ->help('task_rate_help') !!}
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/projects'))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!} @if ($project && Auth::user()->can('create', ENTITY_TASK)) {!! DropdownButton::normal(trans('texts.more_actions')) ->withContents([ [ 'url' => url('/tasks/create/' . ($project->client ? $project->client->public_id : '0'). '/' . $project->public_id), 'label' => trans('texts.new_task'), ], [ 'url' => 'javascript:submitAction("invoice")', 'label' => trans('texts.invoice_project'), ], \DropdownButton::DIVIDER, [ 'url' => 'javascript:submitAction("archive")', 'label' => trans('texts.archive_project') ], [ 'url' => 'javascript:onDeleteClick()', 'label' => trans('texts.delete_project') ], ]) ->large() !!} @endif
{!! Former::close() !!} @stop