From 3d019bdcd5f7d3607f64933346278f289e2ee363 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 29 Nov 2013 16:52:14 +1100 Subject: [PATCH] Starting to partialise things --- app/assets/stylesheets/application.css.scss | 2 +- app/views/layouts/darkswarm.html.haml | 22 +++++++++++++++++++++ app/views/shared/_login.html.haml | 12 +++++++++++ app/views/shared/_menu.html.haml | 11 +++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 app/views/shared/_login.html.haml create mode 100644 app/views/shared/_menu.html.haml diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 60db6ad7e5..db803ee40a 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -4,4 +4,4 @@ * the top of the compiled file, but it's generally better to create a new file per style scope. *= require_self *= require_tree . -*/ \ No newline at end of file +*/ diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index 348ce11d49..230f54e0da 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -8,3 +8,25 @@ = favicon_link_tag "favicon.png" = stylesheet_link_tag "darkswarm/all" + = javascript_include_tag "darkswarm/all" + + = render "layouts/bugherd_script" + = csrf_meta_tags + + + %body.off-canvas + = render partial: "shared/menu" + + %section{ role: "main" } + = yield + + %section#sidebar{ role: "complementary" } + .login-panel + #login-content.hide + = render "home/login" + #sign-up-content.hide + = render "home/signup" + + + = yield :scripts + diff --git a/app/views/shared/_login.html.haml b/app/views/shared/_login.html.haml new file mode 100644 index 0000000000..67249aeb26 --- /dev/null +++ b/app/views/shared/_login.html.haml @@ -0,0 +1,12 @@ +- if spree_current_user.nil? + %li#login-link= link_to "Login", "#sidebar", id: "sidebarLoginButton", class: "sidebar-button" + %li#login-name.hide + %li.divider + %li#sign-up-link= link_to "Sign Up", "#sidebar", id: "sidebarSignUpButton", class: "sidebar-button" + %li#sign-out-link.hide= link_to "Sign Out", "/logout" +- else + %li#login-link.hide= link_to "Login", "#sidebar", id: "sidebarLoginButton", class: "sidebar-button" + %li#login-name= link_to "#{spree_current_user.email}", "#" + %li.divider + %li#sign-up-link.hide= link_to "Sign Up", "#" + %li#sign-out-link= link_to "Sign Out", "/logout" diff --git a/app/views/shared/_menu.html.haml b/app/views/shared/_menu.html.haml new file mode 100644 index 0000000000..0531afcdcb --- /dev/null +++ b/app/views/shared/_menu.html.haml @@ -0,0 +1,11 @@ +%nav.top-bar + %section.top-bar-section + %ul.left + %li= link_to image_tag("ofn_logo_small.png"), new_landing_page_path + %li.divider + = render partial: "shared/login" + + %ul.right + %li= link_to "Distributors", "#", :data => { "reveal-id" => "become-distributor" } + %li.divider + %li= link_to "Farmers", "#", :data => { "reveal-id" => "become-farmer" }