From 2358b6adfb3c8634444209619e38caa64d02b7cf Mon Sep 17 00:00:00 2001 From: Adam Piontek 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 @@ +

+ Other Page +

+

+ With a subtitle no less! +

+ +
+ + <%#
+
+
%> +

+ 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. +

+ +
+ +<%#
+
+ +
+ Other Page +
+ +
With a subtitle no less!
+ +

+ 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. +

+ +
+
%> 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