diff options
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/_content.html.haml | 19 | ||||
-rw-r--r-- | app/views/layouts/_footer.html.haml | 0 | ||||
-rw-r--r-- | app/views/layouts/_header.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/_masthead.html.haml | 4 | ||||
-rw-r--r-- | app/views/layouts/_messages.html.haml | 11 | ||||
-rw-r--r-- | app/views/layouts/_navigation.html.haml | 12 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 26 |
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' |