summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-07-02 23:19:38 -0700
committerelijah <elijah@riseup.net>2013-07-02 23:19:38 -0700
commitfcd9c579866e7d17891c4d1426ef7f230d16f1c5 (patch)
tree2a849dea556c4e66e73e21ab97482f7cd55b90df /app/views
parent96206389a863f105bd0b37dcdb9d00b7c30d8b51 (diff)
cleaned up application layout and some minor css.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/_content.html.haml19
-rw-r--r--app/views/layouts/_header.html.haml10
-rw-r--r--app/views/layouts/_messages.html.haml11
-rw-r--r--app/views/layouts/application.html.haml14
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'