diff options
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_content.html.haml | 19 | ||||
-rw-r--r-- | app/views/layouts/_header.html.haml | 10 | ||||
-rw-r--r-- | app/views/layouts/_messages.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 14 |
4 files changed, 36 insertions, 18 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/_header.html.haml b/app/views/layouts/_header.html.haml index aa4054b..854ab40 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -1,3 +1,9 @@ -- if user - %strong.user_address +- 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 +- if user && @show_navigation + .user_heading = user.email_address diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml index a3bbbac..7ff985f 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, format_flash(msg), :id => "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}" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e185f26..db612b7 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,3 +1,4 @@ +- @show_navigation = true if @show_navigation.nil? !!! %html %head @@ -20,16 +21,7 @@ .row-fluid .span12 = render 'layouts/header' - .row-fluid - .span2 - = render 'layouts/navigation' - .span10 - = render 'layouts/messages' - = yield - - else - .row-fluid - .span12 - = render 'layouts/messages' - = yield + .row-fluid + = render 'layouts/content' #footer = render 'layouts/footer' |