% use DateTime; % layout 'project'; % title "Project " . $project->name . " / Jobs";

<%= $project->name %>

% my $jobs = $project->jobs; % my $rexfiles = $project->rexfiles; % my $formulars = $project->formulars; % my $job_count = scalar (@{ $jobs }); % my $rexfile_count = scalar (@{ $rexfiles }); % my $formular_count = scalar (@{ $formulars }); % if($job_count == 0 && $rexfile_count == 0 && $formular_count == 0) {

It seems that you just created this project. To get started you first have to upload/register one or more Rexfiles. After this you can create jobs and formulars.

% }

Jobs

% if ( scalar (@{ $jobs }) == 0 ) {

Currently this project has no jobs.

% } else { % for my $job (@{ $jobs }) {

<%= $job->name %>

Last execution
% if ($job->last_execution == 0) {   % } else { % my $dt = DateTime->from_epoch(epoch => $job->last_execution); <%= $dt->ymd("-") %> <%= $dt->hms(":") %> % }
Last status
<%= $job->last_status %>

Execute Edit
% } % } New Job

Rexfiles

% if ( scalar (@{ $rexfiles }) == 0 ) {

Currently this project has no Rexfiles.

% } else { % for my $rexfile (@{ $project->rexfiles }) {

<%= $rexfile->name %>

Tasks
<%= join(", ", @{ $rexfile->tasks }) %>

Reload
% } % } New Rexfile

Formulars

% if ( scalar (@{ $formulars }) == 0 ) {

Currently this project has no Formulars.

% if ($job_count == 0) {

To create a formular you first have to create a job for it.

% } % } else { % for my $formular (@{ $formulars }) {

<%= $formular->name %>

Job
<%= $formular->job->name %>
Steps
<%= join(", ", map { $_->{label} } @{ $formular->steps }) %>

Run Edit
% } % } New Formular