diff options
author | azul <azul@riseup.net> | 2013-07-06 07:51:54 -0700 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-07-06 07:51:54 -0700 |
commit | a18efa42ddc1cf8692d55f76ca3e92792913f40d (patch) | |
tree | 00527737a38bdafcd2e175bb6caf5e30b3360de1 /app/views | |
parent | d03e82b4df5075f796f56fb9568992b0ba0d7c07 (diff) | |
parent | dc98ad8c6445182d60b3f1909e0260ace6fbfca5 (diff) |
Merge pull request #55 from elijh/feature/new-ui
Feature/new ui
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/home/index.html.haml | 19 | ||||
-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/_masthead_noauth.html.haml | 3 | ||||
-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 | 28 |
9 files changed, 75 insertions, 32 deletions
diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index c02dcad..8c90436 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,11 +1,12 @@ -Try to fetch a -= link_to "cert", cert_path +%h1= t(:welcome, :provider => APP_CONFIG[:domain]) -%p -Create a -= link_to "ticket", new_ticket_path +%p + We provide secure communication services, including encrypted internet, email (coming soon), and chat (coming later). -- if logged_in? - %p - See all - = link_to "tickets", tickets_path += home_page_buttons + +- if Rails.env == 'development' + .row-fluid + %hr + %p + = link_to "fetch a cert", cert_path 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/_masthead_noauth.html.haml b/app/views/layouts/_masthead_noauth.html.haml new file mode 100644 index 0000000..6bb1943 --- /dev/null +++ b/app/views/layouts/_masthead_noauth.html.haml @@ -0,0 +1,3 @@ +.title + %span.sitename + = APP_CONFIG[:domain]
\ No newline at end of file diff --git a/app/views/layouts/_messages.html.haml b/app/views/layouts/_messages.html.haml index 80e34d4..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, 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/_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 e6d22f0..d5adca9 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,23 +1,27 @@ +- @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 logged_in? + = render 'layouts/masthead' + - elsif params[:controller] != 'home' + = render 'layouts/masthead_noauth' + #main + .container-fluid + - if logged_in? + .row-fluid .span12 - = render 'layouts/messages' - = yield - %footer + = render 'layouts/header' + .row-fluid + = render 'layouts/content' + #footer + = render 'layouts/footer' |