diff --git a/index.php b/index.php
index fffab37..2f1b400 100644
--- a/index.php
+++ b/index.php
@@ -1,14 +1,18 @@
smarty();
-
-$page = new HandBrakeCluster_Page($smarty, $main->request());
-$page->evaluate();
-
-$smarty->assign('page_content', $smarty->fetch($page->template_filename()));
-
-$smarty->display('index.tpl');
+try {
+ $main = HandBrakeCluster_Main::instance();
+ $smarty = $main->smarty();
+
+ $page = new HandBrakeCluster_Page($smarty, $main->request());
+ $page->evaluate();
+
+ $smarty->assign('page_content', $smarty->fetch($page->template_filename()));
+
+ $smarty->display('index.tpl');
+} catch (HandBrakeCluster_Exception $e) {
+ die("Uncaught Exception: " . $e->getMessage());
+}
?>
diff --git a/pages/home.php b/pages/home.php
index 7fb848a..08fc7b0 100644
--- a/pages/home.php
+++ b/pages/home.php
@@ -1,11 +1,11 @@
smarty->assign('running_jobs', $running_jobs);
- $this->smarty->assign('completed_jobs;', $completed_jobs);
+ $this->smarty->assign('completed_jobs', $completed_jobs);
+ $this->smarty->assign('failed_jobs', $failed_jobs);
?>
diff --git a/pages/job-details.php b/pages/job-details.php
index 6637f57..6942e72 100644
--- a/pages/job-details.php
+++ b/pages/job-details.php
@@ -1,8 +1,13 @@
request->get('id');
-$job = new HandBrakeCluster_Job($job_id);
-
+$job = HandBrakeCluster_Job::fromId($job_id);
$this->smarty->assign('job', $job);
+$client_log_entries = HandBrakeCluster_ClientLogEntry::recentForJob($job_id, 30);
+$worker_log_entries = HandBrakeCluster_WorkerLogEntry::recentForJob($job_id, 30);
+$this->smarty->assign('client_log_entries', $client_log_entries);
+$this->smarty->assign('worker_log_entries', $worker_log_entries);
+
+
?>
diff --git a/pages/jobs.php b/pages/jobs.php
index e69de29..a31e23a 100644
--- a/pages/jobs.php
+++ b/pages/jobs.php
@@ -0,0 +1,6 @@
+database());
+$this->smarty->assign('jobs', $jobs);
+
+?>
diff --git a/pages/logs.php b/pages/logs.php
index e69de29..1e77d61 100644
--- a/pages/logs.php
+++ b/pages/logs.php
@@ -0,0 +1,9 @@
+smarty->assign('client_log_entries', $client_log_entries);
+$this->smarty->assign('worker_log_entries', $worker_log_entries);
+
+?>
diff --git a/templates/home.tpl b/templates/home.tpl
index 244dfd3..f9c1417 100644
--- a/templates/home.tpl
+++ b/templates/home.tpl
@@ -10,7 +10,7 @@
There are no currently running jobs.
{/if}
-
Completed Jobs
+Recently Completed Jobs
{if $completed_jobs}
@@ -22,3 +22,15 @@
There are no recently completed jobs.
{/if}
+Recently Failed Jobs
+
+{if $failed_jobs}
+
+{else}
+ There are no recently failed jobs.
+{/if}
+
diff --git a/templates/job-details.tpl b/templates/job-details.tpl
index da10d23..d760c02 100644
--- a/templates/job-details.tpl
+++ b/templates/job-details.tpl
@@ -1 +1,57 @@
-This is Job {$job->id()}...
+Job Details
+
+Summary
+
+Summary details here
+
+Recent Client Logs
+
+{if $client_log_entries}
+
+
+
+ | Level |
+ Time |
+ Message |
+
+
+
+ {foreach from=$client_log_entries item=log_entry}
+
+ | {$log_entry->level()} |
+ {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
+ {$log_entry->message()} |
+
+ {/foreach}
+
+
+{else}
+ There are no client log entries.
+{/if}
+
+
+Recent Worker Logs
+
+{if $worker_log_entries}
+
+
+
+ | Level |
+ Time |
+ Message |
+
+
+
+ {foreach from=$worker_log_entries item=log_entry}
+
+ | {$log_entry->level()} |
+ {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
+ {$log_entry->message()} |
+
+ {/foreach}
+
+
+{else}
+ There are no worker log entries.
+{/if}
+
diff --git a/templates/jobs.tpl b/templates/jobs.tpl
index 6789b01..a67dc77 100644
--- a/templates/jobs.tpl
+++ b/templates/jobs.tpl
@@ -1 +1,27 @@
-Jobs
+Jobs
+
+{if $jobs}
+
+
+
+ | Name |
+ Destination |
+ Title |
+ Status |
+
+
+
+ {foreach from=$jobs item=job}
+ {assign var=current_status value=$job->currentStatus()}
+
+ | {$job->name()} |
+ {$job->destination()} |
+ {$job->title()} |
+ {$current_status->statusName()} |
+
+ {/foreach}
+
+
+{else}
+ There are no jobs
+{/if}
diff --git a/templates/logs.tpl b/templates/logs.tpl
index c74a514..7b99db8 100644
--- a/templates/logs.tpl
+++ b/templates/logs.tpl
@@ -1 +1,59 @@
-Logs...
+Recent Client Logs
+
+{if $client_log_entries}
+
+
+
+ | Job |
+ Level |
+ Time |
+ Hostname |
+ Message |
+
+
+
+ {foreach from=$client_log_entries item=log_entry}
+
+ | {$log_entry->jobId()} |
+ {$log_entry->level()} |
+ {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
+ {$log_entry->hostname()} |
+ {$log_entry->message()} |
+
+ {/foreach}
+
+
+{else}
+ There are no client log entries.
+{/if}
+
+
+Recent Worker Logs
+
+{if $worker_log_entries}
+
+
+
+ | Job |
+ Level |
+ Time |
+ Hostname |
+ Message |
+
+
+
+ {foreach from=$worker_log_entries item=log_entry}
+
+ | {$log_entry->jobId()} |
+ {$log_entry->level()} |
+ {$log_entry->ctime()|date_format:"%Y-%m-%d %H:%M:%S"} |
+ {$log_entry->hostname()} |
+ {$log_entry->message()} |
+
+ {/foreach}
+
+
+{else}
+ There are no worker log entries.
+{/if}
+