summaryrefslogtreecommitdiff
path: root/app/views/backup_jobs
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/backup_jobs')
-rw-r--r--app/views/backup_jobs/_form.html.haml7
-rw-r--r--app/views/backup_jobs/_form_core.html.haml5
-rw-r--r--app/views/backup_jobs/_index_core.html.haml49
-rw-r--r--app/views/backup_jobs/edit.html.haml3
-rw-r--r--app/views/backup_jobs/index.html.haml6
-rw-r--r--app/views/backup_jobs/new.html.haml3
-rw-r--r--app/views/backup_jobs/show.html.haml22
7 files changed, 95 insertions, 0 deletions
diff --git a/app/views/backup_jobs/_form.html.haml b/app/views/backup_jobs/_form.html.haml
new file mode 100644
index 0000000..e0adceb
--- /dev/null
+++ b/app/views/backup_jobs/_form.html.haml
@@ -0,0 +1,7 @@
+= simple_form_for(@backup_job) do |f|
+ = f.error_notification
+
+ = render "form_core", :f => f
+
+ .actions
+ = f.button :submit, conditional_t('backup_jobs.form.submit') \ No newline at end of file
diff --git a/app/views/backup_jobs/_form_core.html.haml b/app/views/backup_jobs/_form_core.html.haml
new file mode 100644
index 0000000..9d439c5
--- /dev/null
+++ b/app/views/backup_jobs/_form_core.html.haml
@@ -0,0 +1,5 @@
+.inputs
+ = f.input :started_at, :label => t('backup_jobs.form.started_at.label'), :hint => conditional_hint('backup_jobs.form.started_at.hint')
+ = f.input :finished_at, :label => t('backup_jobs.form.finished_at.label'), :hint => conditional_hint('backup_jobs.form.finished_at.hint')
+ = f.input :state, :label => t('backup_jobs.form.state.label'), :hint => conditional_hint('backup_jobs.form.state.hint')
+ = f.input :directory, :label => t('backup_jobs.form.directory.label'), :hint => conditional_hint('backup_jobs.form.directory.hint')
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..0102546
--- /dev/null
+++ b/app/views/backup_jobs/_index_core.html.haml
@@ -0,0 +1,49 @@
+%table.table.table-striped
+ %tr
+ %th= t('backup_jobs.index.started_at')
+ %th
+ %span.hidden-phone
+ = t('backup_jobs.index.finished_at')
+ %th= t('backup_jobs.index.state')
+ %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'
+ - else
+ - if backup_job.state == 'failed'
+ - row_marker = 'error'
+ - else
+ - row_marker = ''
+ %tr{:class => row_marker}
+ - if backup_job.finished_at.blank?
+ %td{:colspan => '2'}
+ - 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
+ %span.hidden-phone
+ = l backup_job.finished_at, :format => :short
+ %td= backup_job.state
+ %td
+ %span.hidden-phone
+ - if backup_job.backup_file?
+ %a{:href => backup_job.backup_file.url}
+ %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}
diff --git a/app/views/backup_jobs/edit.html.haml b/app/views/backup_jobs/edit.html.haml
new file mode 100644
index 0000000..7892edb
--- /dev/null
+++ b/app/views/backup_jobs/edit.html.haml
@@ -0,0 +1,3 @@
+- content_for :title, t("backup_jobs.edit.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/backup_jobs/index.html.haml b/app/views/backup_jobs/index.html.haml
new file mode 100644
index 0000000..0bb4747
--- /dev/null
+++ b/app/views/backup_jobs/index.html.haml
@@ -0,0 +1,6 @@
+- content_for :title, t("backup_jobs.index.page_title")
+
+- if @backup_jobs && @backup_jobs.count > 0
+ = render "index_core", :backup_jobs => @backup_jobs
+
+= render :partial => 'shared/create_link', :locals => {:child_class => BackupJob} \ No newline at end of file
diff --git a/app/views/backup_jobs/new.html.haml b/app/views/backup_jobs/new.html.haml
new file mode 100644
index 0000000..65efd4f
--- /dev/null
+++ b/app/views/backup_jobs/new.html.haml
@@ -0,0 +1,3 @@
+- content_for :title, t("backup_jobs.new.page_title")
+
+= render "form" \ No newline at end of file
diff --git a/app/views/backup_jobs/show.html.haml b/app/views/backup_jobs/show.html.haml
new file mode 100644
index 0000000..6fcb1dc
--- /dev/null
+++ b/app/views/backup_jobs/show.html.haml
@@ -0,0 +1,22 @@
+- content_for :title, t("backup_jobs.show.page_title")
+
+%p
+ %strong= t('backup_jobs.show.started_at') + ":"
+ = @backup_job.started_at
+%p
+ %strong= t('backup_jobs.show.finished_at') + ":"
+ = @backup_job.finished_at
+%p
+ %strong= t('backup_jobs.show.state') + ":"
+ = @backup_job.state
+%p
+ %strong= t('backup_jobs.show.directory') + ":"
+ = @backup_job.directory
+%p
+ %strong= t('backup_jobs.show.size_of_the_backup') + ":"
+ - if @backup_job.backup_file?
+ %a{:href => backup_job.backup_file.url}
+ %i{:class => 'icon-download'}
+ = number_to_human_size(backup_job.backup_file.size, :precision => 2)
+
+= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @backup_job } \ No newline at end of file