summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/gemeinschaft_setups_controller.rb2
-rw-r--r--app/controllers/page_controller.rb5
-rw-r--r--app/controllers/tenants_controller.rb4
-rw-r--r--app/models/user.rb3
-rw-r--r--app/views/layouts/_navbar.html.haml13
-rw-r--r--app/views/page/help.de.html.haml (renamed from app/views/page/beginners_intro.de.html.haml)0
-rw-r--r--app/views/page/help.html.haml (renamed from app/views/page/beginners_intro.html.haml)0
-rw-r--r--config/routes.rb3
8 files changed, 20 insertions, 10 deletions
diff --git a/app/controllers/gemeinschaft_setups_controller.rb b/app/controllers/gemeinschaft_setups_controller.rb
index a860653..4f4a72a 100644
--- a/app/controllers/gemeinschaft_setups_controller.rb
+++ b/app/controllers/gemeinschaft_setups_controller.rb
@@ -94,7 +94,7 @@ class GemeinschaftSetupsController < ApplicationController
session[:user_id] = user.id
# Redirect to the user
- redirect_to page_beginners_intro_path, :notice => t('gemeinschaft_setups.initial_setup.successful_setup')
+ redirect_to page_help_path, :notice => t('gemeinschaft_setups.initial_setup.successful_setup')
else
render :new
end
diff --git a/app/controllers/page_controller.rb b/app/controllers/page_controller.rb
index dc5f57b..8f4fa88 100644
--- a/app/controllers/page_controller.rb
+++ b/app/controllers/page_controller.rb
@@ -11,8 +11,9 @@ class PageController < ApplicationController
end
end
- def conference;end
- def beginners_intro;end
+ def help
+
+ end
private
def if_fresh_system_then_go_to_wizard
diff --git a/app/controllers/tenants_controller.rb b/app/controllers/tenants_controller.rb
index cb67e5f..37874b2 100644
--- a/app/controllers/tenants_controller.rb
+++ b/app/controllers/tenants_controller.rb
@@ -70,7 +70,7 @@ class TenantsController < ApplicationController
:amount_of_numbers => @tenant.array_of_internal_extension_numbers.count + @tenant.array_of_dids.count
)
else
- redirect_to page_beginners_intro_path, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs',
+ redirect_to page_help_path, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs',
:resource => @tenant,
:amount_of_numbers => @tenant.array_of_internal_extension_numbers.count + @tenant.array_of_dids.count
)
@@ -81,7 +81,7 @@ class TenantsController < ApplicationController
:resource => @tenant
)
else
- redirect_to page_beginners_intro_path, :notice => t('tenants.controller.successfuly_created',
+ redirect_to page_help_path, :notice => t('tenants.controller.successfuly_created',
:resource => @tenant
)
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 9e8cbc0..afb3f04 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -144,6 +144,9 @@ class User < ActiveRecord::Base
self.pin_hash == Digest::SHA2.hexdigest( "#{self.pin_salt}#{entered_pin}" )
end
+ def admin?
+ self.user_groups.include?(UserGroup.find(2))
+ end
private
diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml
index 7ef6523..c2d9946 100644
--- a/app/views/layouts/_navbar.html.haml
+++ b/app/views/layouts/_navbar.html.haml
@@ -9,9 +9,16 @@
%span.icon-bar
%span.icon-bar
- - if current_user && current_user.sip_accounts.any?
- .nav-collapse.collapse
- %ul.nav
+ .nav-collapse.collapse
+ %ul.nav
+ - if current_user && GemeinschaftSetup.any? && current_user.admin?
+ - if current_page?(page_help_path)
+ %li.active
+ =link_to 'Admin-Doku', page_help_path
+ - else
+ %li
+ =link_to 'Admin-Doku', page_help_path
+ - if current_user && current_user.sip_accounts.any?
%li
%a{:href => sip_account_call_histories_path(current_user.sip_accounts.first)}
%i.icon-list-alt.icon-white
diff --git a/app/views/page/beginners_intro.de.html.haml b/app/views/page/help.de.html.haml
index 5eef135..5eef135 100644
--- a/app/views/page/beginners_intro.de.html.haml
+++ b/app/views/page/help.de.html.haml
diff --git a/app/views/page/beginners_intro.html.haml b/app/views/page/help.html.haml
index dadd99f..dadd99f 100644
--- a/app/views/page/beginners_intro.html.haml
+++ b/app/views/page/help.html.haml
diff --git a/config/routes.rb b/config/routes.rb
index 22a36e5..9d47efc 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -224,8 +224,7 @@ Gemeinschaft42c::Application.routes.draw do
resources :sessions
get "page/index"
- get "page/conference"
- get "page/beginners_intro"
+ get "page/help"
root :to => "page#index"