From bb8168c33f9501fe877345a7bbc7b7f7b64cdfc7 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 5 Feb 2013 12:40:42 +0100 Subject: Added a BackupJob scaffold. --- app/views/backup_jobs/_index_core.html.haml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/views/backup_jobs/_index_core.html.haml (limited to 'app/views/backup_jobs/_index_core.html.haml') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml new file mode 100644 index 0000000..6babf3e --- /dev/null +++ b/app/views/backup_jobs/_index_core.html.haml @@ -0,0 +1,17 @@ +%table.table.table-striped + %tr + %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') + + + - for backup_job in backup_jobs + %tr + %td= backup_job.started_at + %td= backup_job.finished_at + %td= backup_job.state + %td= backup_job.directory + %td= backup_job.size_of_the_backup + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => backup_job} \ No newline at end of file -- cgit v1.2.3 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 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'app/views/backup_jobs/_index_core.html.haml') 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 -- 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/backup_jobs/_index_core.html.haml') 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/backup_jobs/_index_core.html.haml') 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 From 5e8237d8a8cf17009189fcf0259fb1b8a50ab429 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 7 Feb 2013 10:49:01 +0100 Subject: Bugfixes. --- app/views/backup_jobs/_index_core.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/backup_jobs/_index_core.html.haml') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml index a706424..9eebefd 100644 --- a/app/views/backup_jobs/_index_core.html.haml +++ b/app/views/backup_jobs/_index_core.html.haml @@ -26,6 +26,6 @@ = l backup_job.finished_at, :format => :short %td= backup_job.state %td - - if !backup_job.size_of_the_backup.blank? - = number_to_human_size(backup_job.size_of_the_backup, :precision => 2) + - if backup_job.backup_file? + = number_to_human_size(backup_job.backup_file.size, :precision => 2) =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => backup_job} \ No newline at end of file -- cgit v1.2.3 From da362f73cf417aa2eda9124d17c66850087ea0f6 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Feb 2013 16:52:24 +0100 Subject: Backup GUI improvements. --- app/views/backup_jobs/_index_core.html.haml | 34 ++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'app/views/backup_jobs/_index_core.html.haml') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml index 9eebefd..9dc0e92 100644 --- a/app/views/backup_jobs/_index_core.html.haml +++ b/app/views/backup_jobs/_index_core.html.haml @@ -1,12 +1,15 @@ %table.table.table-striped %tr %th= t('backup_jobs.index.started_at') - %th= t('backup_jobs.index.finished_at') + %th + %span.hidden-phone + = t('backup_jobs.index.finished_at') %th= t('backup_jobs.index.state') - %th= t('backup_jobs.index.size_of_the_backup') + %th + %span.hidden-phone + = t('backup_jobs.index.size_of_the_backup') %th{:colspan => '2'} - - for backup_job in backup_jobs - if backup_job.state == 'queued' - row_marker = 'warning' @@ -18,14 +21,29 @@ %tr{:class => row_marker} - if backup_job.finished_at.blank? %td{:colspan => '2'} - = time_ago_in_words(backup_job.started_at) + - if (Time.now - 1.day) > backup_job.started_at + = l backup_job.started_at, :format => :short + - else + - case I18n.locale + - when :de + = "vor #{time_ago_in_words(backup_job.started_at)}" + - when :en + = "#{time_ago_in_words(backup_job.started_at)} ago" + - else + = l backup_job.started_at, :format => :short - else %td = l backup_job.started_at, :format => :short %td - = l backup_job.finished_at, :format => :short + %span.hidden-phone + = l backup_job.finished_at, :format => :short %td= backup_job.state %td - - if backup_job.backup_file? - = number_to_human_size(backup_job.backup_file.size, :precision => 2) - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => backup_job} \ No newline at end of file + %span.hidden-phone + - if backup_job.backup_file? + %a{:href => backup_job.backup_file.current_path} + %i{:class => 'icon-download'} + = number_to_human_size(backup_job.backup_file.size, :precision => 2) + - else + = '-' + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => backup_job} -- cgit v1.2.3 From b5cb8b7fa389c0a542825173b058dfcf428f6680 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Feb 2013 17:44:09 +0100 Subject: Fix URL --- app/views/backup_jobs/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/backup_jobs/_index_core.html.haml') diff --git a/app/views/backup_jobs/_index_core.html.haml b/app/views/backup_jobs/_index_core.html.haml index 9dc0e92..0102546 100644 --- a/app/views/backup_jobs/_index_core.html.haml +++ b/app/views/backup_jobs/_index_core.html.haml @@ -41,7 +41,7 @@ %td %span.hidden-phone - if backup_job.backup_file? - %a{:href => backup_job.backup_file.current_path} + %a{:href => backup_job.backup_file.url} %i{:class => 'icon-download'} = number_to_human_size(backup_job.backup_file.size, :precision => 2) - else -- cgit v1.2.3