From dbb4f374d7ed60873c4920d675aa955a87c852a0 Mon Sep 17 00:00:00 2001 From: Dzmitry Plashchynski Date: Sun, 12 Apr 2015 03:55:39 +0300 Subject: [PATCH] Facelift --- web/views/dashboard.haml | 66 +++++++++++++++++++++------------------- web/views/job.haml | 21 +++++++------ web/views/layout.haml | 14 ++++----- 3 files changed, 52 insertions(+), 49 deletions(-) diff --git a/web/views/dashboard.haml b/web/views/dashboard.haml index ad00c1e..5999469 100644 --- a/web/views/dashboard.haml +++ b/web/views/dashboard.haml @@ -1,32 +1,36 @@ -%h2 Running Jobs -%table.bordered#job_list - %tr - %th Job - %th Last performed at - %th Status - %th - - @jobs.each do |job| - %tr - %td= job.job_id - %td= job.last_performed_at || 'Never performed yet' - %td - - if job.last_performed_at.nil? - %span.grey-text.darken-3{ title: 'This job has never been performed yet.' } - %i.mdi-device-access-time - Pending - - elsif job.healthy - %a{ href: url("/job/#{job.id}") } - %span.green-text.darken-3{ title: 'This job was performed successfully.' } - %i.mdi-action-done - Success - - else - %a{ href: url("/job/#{job.id}") } - %span.red-text{ title: 'There were problems with this job. Follow the link to check the log.' } - %i.mdi-alert-warning - Error +%header.container.blue-grey.lighten-4.grey-text.text-darken-4 + %h2 Running Jobs - %td - - if job.last_performed_at - %a{ href: url("/job/#{job.id}") } - Log - %i.mdi-navigation-chevron-right +%main + .container.blue-grey.lighten-4.grey-text.text-darken-4 + %table.bordered#job_list + %tr + %th Job + %th Last performed at + %th Status + %th + - @jobs.each do |job| + %tr + %td= job.job_id + %td= job.last_performed_at || 'Never performed yet' + %td + - if job.last_performed_at.nil? + %span.grey-text.darken-3{ title: 'This job has never been performed yet.' } + %i.mdi-device-access-time + Pending + - elsif job.healthy + %a{ href: url("/job/#{job.id}") } + %span.green-text.darken-3{ title: 'This job was performed successfully.' } + %i.mdi-action-done + Success + - else + %a{ href: url("/job/#{job.id}") } + %span.red-text{ title: 'There were problems with this job. Follow the link to check the log.' } + %i.mdi-alert-warning + Error + + %td + - if job.last_performed_at + %a{ href: url("/job/#{job.id}") } + Log + %i.mdi-navigation-chevron-right diff --git a/web/views/job.haml b/web/views/job.haml index 997a485..5e96ef6 100644 --- a/web/views/job.haml +++ b/web/views/job.haml @@ -1,12 +1,13 @@ -%a{ href: url('/') } - %i.mdi-navigation-chevron-left - Back to Home +%header.container.blue-grey.lighten-4.grey-text.text-darken-4 + %a{ href: url('/') } + %i.mdi-navigation-chevron-left + Back to Home + %h4 "#{@job.job_id}" Log: -%h4 "#{@job.job_id}" Log: +%main.container.blue-grey.lighten-4.grey-text.text-darken-4 + - if @job.healthy == false + .alert.alert-danger{ role: 'alert' } + An error occurs during the last execution of this job. + Check the log below for details. -- if @job.healthy == false - .alert.alert-danger{ role: 'alert' } - An error occurs during the last execution of this job. - Check the log below for details. - -%pre= @job.log + %pre= @job.log diff --git a/web/views/layout.haml b/web/views/layout.haml index 6a302cd..9cb3edd 100644 --- a/web/views/layout.haml +++ b/web/views/layout.haml @@ -11,18 +11,16 @@ %link{ href: "#{env['SCRIPT_NAME']}/custom.css", rel: 'stylesheet' } %body.blue-grey.darken-2 - %header - .container.blue-grey.white-text - %h1 Crono Dashboard + %nav.container.blue-grey.white-text + .nav-wrapper + %a.brand-logo{ href: url('/') } Crono Dashboard - %main - .container.blue-grey.lighten-4.grey-text.text-darken-4 - = yield + = yield %footer.page-footer.blue-grey.darken-2 .footer-copyright.blue-grey.darken-2 - .container.blue-grey.lighten-4.grey-text.text-darken-4 - Crono #{Crono::VERSION} + .container.blue-grey.white-text + Crono v#{Crono::VERSION} %a.right{ href: 'https://github.com/plashchynski/crono', target: '_blank' } Documentation