From 7e2e42379cb40a500eb8a236c05788eb3e84d141 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 25 Jun 2017 12:30:31 -0400 Subject: Added logging in and logging out --- app/views/layouts/application.html.haml | 18 +++++++++++++++--- app/views/layouts/userdata.html.haml | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 app/views/layouts/userdata.html.haml (limited to 'app/views/layouts') diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 55d7805..e9d8dfd 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -5,12 +5,24 @@ = csrf_meta_tags = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' - %body + %body#main-body + - if flash[:alert] + %div#flash.flash-alert= flash[:alert] + - if flash[:notice] + %div#flash.flash-notice= flash[:notice] #container #banner %h1= link_to "Thoughts", root_url #main #content= yield #sidebar - %h2 I'm Fef. - %p I'm a computer science undergrad at Carnegie Mellon University. I make a lot of things, including Twitter bots. I really like Pokémon, and I write about it a lot. + .sidebar-module + %h2 I'm Fef. + %p I'm a computer science undergrad at Carnegie Mellon University. I make a lot of things, including Twitter bots. I really like Pokémon, and I write about it a lot. + .sidebar-module + %h2 Meta + %ul + - if not user_signed_in? + %li= link_to "Log in", new_user_session_path + - if user_signed_in? + %li= link_to "Log out", destroy_user_session_path, method: :delete diff --git a/app/views/layouts/userdata.html.haml b/app/views/layouts/userdata.html.haml new file mode 100644 index 0000000..f6e3b57 --- /dev/null +++ b/app/views/layouts/userdata.html.haml @@ -0,0 +1,18 @@ +!!! 5 +%html + %head + %title Thoughts + = csrf_meta_tags + = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' + = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' + %body#userdata-body + #userdata-container + - if flash[:alert] + #userdata-flash.userdata-flash-alert + %span.userdata-flash-tag ERROR: + = flash.alert + - if flash[:notice] + #userdata-flash.userdata-flash-notice + %span.userdata-flash-tag NOTICE: + = flash.notice + = yield -- cgit 1.4.1