summaryrefslogtreecommitdiff
path: root/app/views/layouts
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2013-07-09 11:53:58 -0700
committerjessib <jessib@leap.se>2013-07-09 11:53:58 -0700
commit09b7f01cac6df1ae11f4129b20b781b78a3706ac (patch)
tree3921eaa5edd03d80e6b402c5c2f88dda6338ab3a /app/views/layouts
parent9979b50848ce27730f880159512933e50d5ae0e4 (diff)
parent3113f8b814417a896ad5340fda88927733f8ab22 (diff)
Merge branch 'master' into feature/authentication_generic_error
Conflicts: app/views/layouts/_messages.html.haml app/views/layouts/application.html.haml users/app/assets/javascripts/users.js.coffee
Diffstat (limited to 'app/views/layouts')
-rw-r--r--app/views/layouts/_content.html.haml19
-rw-r--r--app/views/layouts/_footer.html.haml0
-rw-r--r--app/views/layouts/_header.html.haml11
-rw-r--r--app/views/layouts/_masthead.html.haml4
-rw-r--r--app/views/layouts/_messages.html.haml11
-rw-r--r--app/views/layouts/_navigation.html.haml12
-rw-r--r--app/views/layouts/application.html.haml26
7 files changed, 60 insertions, 23 deletions
diff --git a/app/views/layouts/_content.html.haml b/app/views/layouts/_content.html.haml
new file mode 100644
index 0000000..19af627
--- /dev/null
+++ b/app/views/layouts/_content.html.haml
@@ -0,0 +1,19 @@
+-#
+-# Partial for displaying the page content. This is the only place that content should be displayed.
+-#
+
+- if content_for?(:content)
+ - content = yield(:content)
+- else
+ - content = yield
+
+- if @show_navigation
+ .span2
+ = render 'layouts/navigation'
+ .span10
+ = render 'layouts/messages'
+ = content
+- else
+ .span12
+ = render 'layouts/messages'
+ = content
diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/views/layouts/_footer.html.haml
diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml
new file mode 100644
index 0000000..b459545
--- /dev/null
+++ b/app/views/layouts/_header.html.haml
@@ -0,0 +1,11 @@
+- if admin?
+ %ul.nav.nav-tabs
+ %li{:class => ("active" if controller?('users', 'email_settings', 'overviews') || params[:user_id])}
+ = link_to t(:users), users_path
+ %li{:class => ("active" if controller?('tickets') && !params[:user_id])}
+ = link_to t(:tickets), tickets_path
+ %li
+ = link_to t(:logout), logout_path, :method => :delete
+- if @user && @show_navigation
+ .user_heading
+ = @user.email_address
diff --git a/app/views/layouts/_masthead.html.haml b/app/views/layouts/_masthead.html.haml
new file mode 100644
index 0000000..280f2c2
--- /dev/null
+++ b/app/views/layouts/_masthead.html.haml
@@ -0,0 +1,4 @@
+.title
+ %span.sitename
+ = APP_CONFIG[:domain]
+ = t(:user_control_panel) \ No newline at end of file
diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml
index 6ec70a2..3a2361e 100644
--- a/app/views/layouts/_messages.html.haml
+++ b/app/views/layouts/_messages.html.haml
@@ -1,5 +1,6 @@
-- flash.each do |name, msg|
- - if msg.is_a?(String)
- %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
- %a.close{"data-dismiss" => "alert"} ×
- = content_tag :div, msg, :class => "flash_#{name}"
+#messages
+ - flash.each do |name, msg|
+ - if msg.is_a?(String)
+ %div{:class => "alert alert-#{name == :notice ? "success" : "error"}"}
+ %a.close{"data-dismiss" => "alert"} ×
+ = content_tag :div, format_flash(msg), :id => "flash_#{name}" \ No newline at end of file
diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml
index b75eed7..b42c1fe 100644
--- a/app/views/layouts/_navigation.html.haml
+++ b/app/views/layouts/_navigation.html.haml
@@ -1,6 +1,6 @@
-= link_to "Leap Web", root_path, :class => 'brand'
-%ul.nav
- // = render '/tickets/nav'
-
-%ul.nav.pull-right
- = render '/sessions/nav'
+%ul.nav.sidenav
+ = link_to_navigation t(:overview), user_overview_path(@user), :active => controller?(:overviews)
+ = link_to_navigation t(:account_settings), edit_user_path(@user), :active => controller?(:users)
+ = link_to_navigation t(:email_settings), edit_user_email_settings_path(@user), :active => controller?(:email_settings)
+ = link_to_navigation t(:support_tickets), auto_tickets_path(@user), :active => controller?(:tickets)
+ = link_to_navigation t(:logout), logout_path, :method => :delete
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 2b8206d..380f92d 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -1,23 +1,25 @@
+- @show_navigation = true if @show_navigation.nil? && logged_in?
!!!
%html
%head
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
- %title= content_for?(:title) ? yield(:title) : "Leap Web"
+ %title= html_title
%meta{:content => content_for?(:description) ? yield(:description) : "Leap Web", :name => "description"}
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
= yield(:head)
%body
- %header.navbar.navbar-fixed-top
- %nav.navbar-inner
- .container
- = render 'layouts/navigation'
- #main{:role => "main"}
- .container
- .content
- .row
+ #masthead
+ - if params[:controller] != 'home'
+ = render 'layouts/masthead'
+ #main
+ .container-fluid
+ - if logged_in?
+ .row-fluid
.span12
- #messages= render 'layouts/messages'
- = yield
- %footer
+ = render 'layouts/header'
+ .row-fluid
+ = render 'layouts/content'
+ #footer
+ = render 'layouts/footer'