From ecb5083f1c97bc4520139c59814bbeb5fee76bcb Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 18 Jan 2014 15:16:23 -0500 Subject: [PATCH] Created new dashboard index *Added js for logging out button *WIP --- app/assets/javascripts/site.js | 9 +++++++++ app/views/site/index.html.haml | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 app/views/site/index.html.haml diff --git a/app/assets/javascripts/site.js b/app/assets/javascripts/site.js index e69de29..bebec98 100644 --- a/app/assets/javascripts/site.js +++ b/app/assets/javascripts/site.js @@ -0,0 +1,9 @@ +$("#index_logout").click(function(){ + $.ajax({ + type: "DELETE", + url: $("#index_logout").data("url"), + complete: function(){ + window.location.href="/"; + } + }); +}); diff --git a/app/views/site/index.html.haml b/app/views/site/index.html.haml new file mode 100644 index 0000000..f9a9b63 --- /dev/null +++ b/app/views/site/index.html.haml @@ -0,0 +1,21 @@ += stylesheet_link_tag "bootstrap_and_overrides", :media => "all" +%h2 Dashboard + +%p + %p + %a{class: "btn btn-lg btn-block btn-primary"} Add Time Entry + %p + %a{class: "btn btn-lg btn-block btn-primary"} View Timesheet + %p + %a{class: "btn btn-lg btn-block btn-primary"} Add Bike + +%p Your Bikes: +%ol + %li Bike 1 + %li Bike 2 + +%p + %p + %a{class: "btn btn-lg btn-block btn-primary", href: admin_index_path} Admin View + %p + %input{id: "index_logout", value: "Logout", type: "button", class: "btn btn-lg btn-block btn-danger", "data-url" => destroy_user_session_path }