From 2358b6adfb3c8634444209619e38caa64d02b7cf Mon Sep 17 00:00:00 2001 From: Adam Piontek <adam@73k.us> Date: Fri, 26 Feb 2021 18:28:48 -0500 Subject: [PATCH] added a separate 'other' non-live controller page path for testing --- .../controllers/other_controller.ex | 16 ++++++++ lib/bones73k_web/router.ex | 3 ++ .../templates/other/index.html.eex | 37 +++++++++++++++++++ lib/bones73k_web/views/other_view.ex | 3 ++ 4 files changed, 59 insertions(+) create mode 100644 lib/bones73k_web/controllers/other_controller.ex create mode 100644 lib/bones73k_web/templates/other/index.html.eex create mode 100644 lib/bones73k_web/views/other_view.ex diff --git a/lib/bones73k_web/controllers/other_controller.ex b/lib/bones73k_web/controllers/other_controller.ex new file mode 100644 index 0000000..8576b75 --- /dev/null +++ b/lib/bones73k_web/controllers/other_controller.ex @@ -0,0 +1,16 @@ +defmodule Bones73kWeb.OtherController do + use Bones73kWeb, :controller + + def index(conn, _params) do + conn + |> put_flash(:success, "Log in was a success. Good for you.") + |> put_flash(:error, "Lorem ipsum dolor sit amet consectetur adipisicing elit.") + |> put_flash( + :info, + "Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus dolore sunt quia aperiam sint id reprehenderit? Dolore incidunt alias inventore accusantium nulla optio, ducimus eius aliquam hic, pariatur voluptate distinctio." + ) + |> put_flash(:warning, "Oh no, there's nothing to worry about!") + |> put_flash(:primary, "Something in the brand color.") + |> render("index.html") + end +end diff --git a/lib/bones73k_web/router.ex b/lib/bones73k_web/router.ex index 43b05b0..6d349d7 100644 --- a/lib/bones73k_web/router.ex +++ b/lib/bones73k_web/router.ex @@ -81,6 +81,9 @@ defmodule Bones73kWeb.Router do get("/users/confirm", UserConfirmationController, :new) post("/users/confirm", UserConfirmationController, :create) get("/users/confirm/:token", UserConfirmationController, :confirm) + + # Special non-live page for testing only + get("/other", OtherController, :index) end scope "/", Bones73kWeb do diff --git a/lib/bones73k_web/templates/other/index.html.eex b/lib/bones73k_web/templates/other/index.html.eex new file mode 100644 index 0000000..b42a562 --- /dev/null +++ b/lib/bones73k_web/templates/other/index.html.eex @@ -0,0 +1,37 @@ +<h1 class="text-3xl font-bold leading-tight text-gunmetal-200"> + Other Page +</h1> +<h2 class="text-xl leading-tight text-gunmetal-400"> + With a subtitle no less! +</h2> + +<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8"> + <!-- Replace with your content --> + <%# <div class="px-4 py-6 sm:px-0"> + <div class="border-4 border-dashed border-gray-200 rounded-lg h-96"></div> + </div> %> + <p> + Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus dolore sunt quia aperiam sint id + reprehenderit? Dolore incidunt alias inventore accusantium nulla optio, ducimus eius aliquam hic, pariatur + voluptate distinctio. + </p> + <!-- /End replace --> +</div> + +<%# <div class="columns is-centered"> + <div class="column is-three-fifths"> + + <div class="title is-4"> + <span>Other Page</span> + </div> + + <div class="subtitle">With a subtitle no less!</div> + + <p> + Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptatibus dolore sunt quia aperiam sint id + reprehenderit? Dolore incidunt alias inventore accusantium nulla optio, ducimus eius aliquam hic, pariatur + voluptate distinctio. + </p> + + </div> +</div> %> diff --git a/lib/bones73k_web/views/other_view.ex b/lib/bones73k_web/views/other_view.ex new file mode 100644 index 0000000..a103c3b --- /dev/null +++ b/lib/bones73k_web/views/other_view.ex @@ -0,0 +1,3 @@ +defmodule Bones73kWeb.OtherView do + use Bones73kWeb, :view +end