@extends('header') @section('head') @parent @stop @section('content') @if ($errors->first('time_log'))
  • {{ trans('texts.task_errors') }}
  • @endif {!! Former::open($url) ->addClass('col-lg-10 col-lg-offset-1 warn-on-exit task-form') ->onsubmit('return onFormSubmit(event)') ->method($method) !!} @if ($task) {!! Former::populate($task) !!} {!! Former::populateField('id', $task->public_id) !!} @endif
    @if ($task) {!! Former::text('id') !!} {!! Former::text('invoice_id') !!} @endif {!! Former::text('action') !!} {!! Former::text('time_log') !!}
    @if ($task && $task->invoice_id) {!! Former::plaintext() ->label('client') ->value($task->client->present()->link) !!} @if ($task->project) {!! Former::plaintext() ->label('project') ->value($task->present()->project) !!} @endif @else {!! Former::select('client')->addOption('', '')->addGroupClass('client-select') !!} {!! Former::select('project_id') ->addOption('', '') ->addGroupClass('project-select') ->label(trans('texts.project')) !!} @endif {!! Former::textarea('description')->rows(4) !!} @if ($task) @if ($task->is_running)
    @endif @else {!! Former::radios('task_type')->radios([ trans('texts.timer') => array('name' => 'task_type', 'value' => 'timer'), trans('texts.manual') => array('name' => 'task_type', 'value' => 'manual'), ])->inline()->check('timer')->label(' ') !!} @endif
    @if (Auth::user()->canCreateOrEdit(ENTITY_TASK, $task)) @if (Auth::user()->hasFeature(FEATURE_TASKS)) @if ($task && $task->is_running) {!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!} {!! Button::primary(trans('texts.stop'))->large()->appendIcon(Icon::create('stop'))->withAttributes(['id' => 'stop-button']) !!} @elseif ($task && $task->is_deleted) {!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/tasks'))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::primary(trans('texts.restore'))->large()->withAttributes(['onclick' => 'submitAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!} @elseif ($task && $task->trashed()) {!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/tasks'))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!} {!! Button::primary(trans('texts.restore'))->large()->withAttributes(['onclick' => 'submitAction("restore")'])->appendIcon(Icon::create('cloud-download')) !!} @else {!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/tasks'))->appendIcon(Icon::create('remove-circle')) !!} @if ($task) {!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button']) !!} {!! Button::primary(trans('texts.resume'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'resume-button']) !!} {!! DropdownButton::normal(trans('texts.more_actions')) ->withContents($actions) ->large() ->dropup() !!} @else {!! Button::success(trans('texts.start'))->large()->appendIcon(Icon::create('play'))->withAttributes(['id' => 'start-button']) !!} {!! Button::success(trans('texts.save'))->large()->appendIcon(Icon::create('floppy-disk'))->withAttributes(['id' => 'save-button', 'style' => 'display:none']) !!} @endif @endif @else {!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(HTMLUtils::previousUrl('/tasks'))->appendIcon(Icon::create('remove-circle')) !!} @endif @endif
    {!! Former::close() !!} @stop