From e47e83cf6bded3d1924b4d500193e7876833ef83 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 2 Jul 2017 13:03:43 -0400 Subject: Created admin panel Currently allows you to create and edit blogs, including associated records. Uses a WYSIWYG editor that allows uploading images. Also included jQuery :( --- app/views/layouts/admin.html.haml | 27 +++++++++++++++++++++++++++ app/views/layouts/application.html.haml | 1 + 2 files changed, 28 insertions(+) create mode 100644 app/views/layouts/admin.html.haml (limited to 'app/views/layouts') diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml new file mode 100644 index 0000000..a2c2d95 --- /dev/null +++ b/app/views/layouts/admin.html.haml @@ -0,0 +1,27 @@ +!!! 5 +%html + %head + %title Thoughts - Admin + = csrf_meta_tags + = stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track': 'reload' + = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' + %body + #banner= link_to "Thoughts", root_url + #container + %ul#sidebar + %li{major_sidebar_attrs("dashboard")} + = link_to "Dashboard", admin_url, class: "major-link" + %li{major_sidebar_attrs("blogs")} + = link_to "Blogs", admin_blogs_url, class: "major-link" + %ul.minors + %li.minor= link_to "New blog", new_admin_blog_url + #main + - if flash[:alert] + #flash.flash-alert + %span.flash-tag ERROR: + = flash.alert + - if flash[:notice] + #flash.flash-notice + %span.flash-tag NOTICE: + = flash.notice + = yield diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 2a9e2eb..5148df4 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -21,6 +21,7 @@ - if not user_signed_in? %li= link_to "Log in", new_user_session_path - if user_signed_in? + %li= link_to "Admin", admin_url %li= link_to "Log out", destroy_user_session_path, method: :delete #main %header#banner= link_to "feffernoo.se", root_url -- cgit 1.4.1