From 3edd6e58ea3f5d25068ea9d47f639ae89e5f2c0c Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 6 Feb 2013 11:07:04 +0100 Subject: Improved the backup. --- app/views/backup_jobs/_index_core.html.haml | 19 +++++++++++++++---- app/views/backup_jobs/show.html.haml | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml index 6babf3e..a1bf0d0 100644 --- a/app/views/backup_jobs/_index_core.html.haml +++ b/app/views/backup_jobs/_index_core.html.haml @@ -8,10 +8,21 @@ - for backup_job in backup_jobs - %tr - %td= backup_job.started_at - %td= backup_job.finished_at + - if backup_job.state == 'queued' + - row_marker = 'warning' + - else + - if backup_job.state == 'failed' + - row_marker = 'error' + - else + - row_marker = '' + %tr{:class => row_marker} + %td + - if backup_job.finished_at.blank? + = time_ago_in_words(backup_job.finished_at) + - else + = l backup_job.started_at, :format => :short + %td= l backup_job.finished_at, :format => :short %td= backup_job.state %td= backup_job.directory - %td= backup_job.size_of_the_backup + %td= number_to_human_size(backup_job.size_of_the_backup, :precision => 2) =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => backup_job} \ No newline at end of file diff --git a/app/views/backup_jobs/show.html.haml b/app/views/backup_jobs/show.html.haml index 7f021bb..65091b8 100644 --- a/app/views/backup_jobs/show.html.haml +++ b/app/views/backup_jobs/show.html.haml @@ -14,6 +14,6 @@ = @backup_job.directory %p %strong= t('backup_jobs.show.size_of_the_backup') + ":" - = @backup_job.size_of_the_backup + = number_to_human_size(@backup_job.size_of_the_backup, :precision => 2) = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @backup_job } \ No newline at end of file -- cgit v1.2.3 From 16a2074982644614f3ef13c15681b5c89feb586b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 6 Feb 2013 11:24:14 +0100 Subject: HTML fix. --- app/views/backup_jobs/_index_core.html.haml | 1 + 1 file changed, 1 insertion(+) (limited to 'app/views') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml index a1bf0d0..aceeb5b 100644 --- a/app/views/backup_jobs/_index_core.html.haml +++ b/app/views/backup_jobs/_index_core.html.haml @@ -5,6 +5,7 @@ %th= t('backup_jobs.index.state') %th= t('backup_jobs.index.directory') %th= t('backup_jobs.index.size_of_the_backup') + %th{:colspan => '2'} - for backup_job in backup_jobs -- cgit v1.2.3 From c26e4b9d27218378f34175ac3410eab5b12a5713 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 6 Feb 2013 12:19:23 +0100 Subject: View improvements. --- app/views/backup_jobs/_index_core.html.haml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'app/views') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml index aceeb5b..a706424 100644 --- a/app/views/backup_jobs/_index_core.html.haml +++ b/app/views/backup_jobs/_index_core.html.haml @@ -3,7 +3,6 @@ %th= t('backup_jobs.index.started_at') %th= t('backup_jobs.index.finished_at') %th= t('backup_jobs.index.state') - %th= t('backup_jobs.index.directory') %th= t('backup_jobs.index.size_of_the_backup') %th{:colspan => '2'} @@ -17,13 +16,16 @@ - else - row_marker = '' %tr{:class => row_marker} - %td - - if backup_job.finished_at.blank? - = time_ago_in_words(backup_job.finished_at) - - else + - if backup_job.finished_at.blank? + %td{:colspan => '2'} + = time_ago_in_words(backup_job.started_at) + - else + %td = l backup_job.started_at, :format => :short - %td= l backup_job.finished_at, :format => :short + %td + = l backup_job.finished_at, :format => :short %td= backup_job.state - %td= backup_job.directory - %td= number_to_human_size(backup_job.size_of_the_backup, :precision => 2) + %td + - if !backup_job.size_of_the_backup.blank? + = number_to_human_size(backup_job.size_of_the_backup, :precision => 2) =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => backup_job} \ No newline at end of file -- cgit v1.2.3