From 15d5f410afafce67b61a27479a21546cebd48ed9 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 27 Feb 2013 10:23:26 +0100 Subject: Show a restore link in the setup navigation bar. --- app/models/ability.rb | 5 +++++ app/views/layouts/_navbar.html.haml | 4 +++- config/locales/views/restore_jobs/de.yml | 2 +- config/locales/views/restore_jobs/en.yml | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 2e270da..23af525 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -90,6 +90,11 @@ class Ability # SIM cards # cannot [:edit, :update], SimCard + + # Restore is only possible on a new system. + # + cannot :manage, RestoreJob + else # Any user can do the following stuff. # diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index a7f47cf..8004c0e 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -3,10 +3,12 @@ .container %span.hidden-phone %a.brand{:href => (current_user.nil? ? '/' : tenant_path(current_user.current_tenant))} - Gemeinschaft 5 + Gemeinschaft 5.1 .nav-collapse.collapse %ul.nav + - if !GemeinschaftSetup.any? + %li=link_to t('restore_jobs.new.page_title'), new_restore_job_path - if current_user && GemeinschaftSetup.any? && current_user.admin? - if current_page?(page_help_path) %li.active diff --git a/config/locales/views/restore_jobs/de.yml b/config/locales/views/restore_jobs/de.yml index 18ee349..3fdd72c 100644 --- a/config/locales/views/restore_jobs/de.yml +++ b/config/locales/views/restore_jobs/de.yml @@ -26,7 +26,7 @@ de: edit: 'Bearbeiten' view_all: 'Alle anzeigen' new: - page_title: 'Restore Auftrag neu anlegen' + page_title: 'Restore von einem Backup' actions: back_to_list: 'Zurück zur Übersicht' edit: diff --git a/config/locales/views/restore_jobs/en.yml b/config/locales/views/restore_jobs/en.yml index d75de95..636c335 100644 --- a/config/locales/views/restore_jobs/en.yml +++ b/config/locales/views/restore_jobs/en.yml @@ -26,7 +26,7 @@ en: edit: 'Edit' view_all: 'View All' new: - page_title: 'New Restorejob' + page_title: 'Restore from a backup' actions: back_to_list: 'Back to Index' edit: -- cgit v1.2.3