diff --git a/lib/recycledcloud_web/router.ex b/lib/recycledcloud_web/router.ex index 157679b..74b72a6 100644 --- a/lib/recycledcloud_web/router.ex +++ b/lib/recycledcloud_web/router.ex @@ -53,6 +53,7 @@ defmodule RecycledCloudWeb.Router do scope "/", RecycledCloudWeb do pipe_through [:browser] + get "/users/log_out", UserSessionController, :delete delete "/users/log_out", UserSessionController, :delete get "/users/confirm", UserConfirmationController, :new post "/users/confirm", UserConfirmationController, :create diff --git a/lib/recycledcloud_web/templates/layout/_sidebar_nav.html.eex b/lib/recycledcloud_web/templates/layout/_sidebar_nav.html.eex new file mode 100644 index 0000000..9c64679 --- /dev/null +++ b/lib/recycledcloud_web/templates/layout/_sidebar_nav.html.eex @@ -0,0 +1,17 @@ + diff --git a/lib/recycledcloud_web/templates/layout/_user_menu.html.eex b/lib/recycledcloud_web/templates/layout/_user_menu.html.eex deleted file mode 100644 index f281cfc..0000000 --- a/lib/recycledcloud_web/templates/layout/_user_menu.html.eex +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/lib/recycledcloud_web/templates/layout/app.html.eex b/lib/recycledcloud_web/templates/layout/app.html.eex index 5c835b0..581298e 100644 --- a/lib/recycledcloud_web/templates/layout/app.html.eex +++ b/lib/recycledcloud_web/templates/layout/app.html.eex @@ -4,29 +4,28 @@ - RecycledCloud · Phoenix Framework + RecycledCloud · Management "/> - -
-
- - -
-
-
- - - <%= @inner_content %> -
+
+
+
+ <%= render "_sidebar_nav.html", assigns %> +
+
+
+ <%= if get_flash(@conn, :info) do %> + + <% end %> + <%= if get_flash(@conn, :error) do %> + + <% end %> + + <%= @inner_content %> +
+
+
+
diff --git a/lib/recycledcloud_web/templates/page/index.html.eex b/lib/recycledcloud_web/templates/page/index.html.eex index dd0a7f8..eaa24ec 100644 --- a/lib/recycledcloud_web/templates/page/index.html.eex +++ b/lib/recycledcloud_web/templates/page/index.html.eex @@ -1,38 +1,8 @@ -
-

<%= gettext "Welcome to %{name}!", name: "Phoenix" %>

-

Peace of mind from prototype to production

-
- -
-
-

Resources

- -
-
-

Help

- -
-
+

+Welcome on the Recycled Cloud interface. +<%= if @current_user do %> + You can access management facilities via the left sidebar. +<% else %> +Please <%= link "log in", to: Routes.user_session_path(@conn, :new) %> to access management facilities. +<% end %> +

diff --git a/lib/recycledcloud_web/templates/user_session/new.html.eex b/lib/recycledcloud_web/templates/user_session/new.html.eex index 7be6449..5f48ef7 100644 --- a/lib/recycledcloud_web/templates/user_session/new.html.eex +++ b/lib/recycledcloud_web/templates/user_session/new.html.eex @@ -1,5 +1,9 @@

Log in

+

Please use your LDAP credentials to log in. You may +<%= link "register a new account", to: Routes.user_registration_path(@conn, :new) %> +if you do not already have one.

+ <%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user], fn f -> %> <%= if @error_message do %>
@@ -7,21 +11,18 @@
<% end %> - <%= label f, :email %> - <%= email_input f, :email, required: true %> - - <%= label f, :password %> - <%= password_input f, :password, required: true %> - + <%= email_input f, :email, required: true, placeholder: "Email" %>
+ <%= password_input f, :password, required: true, placeholder: "Password" %>
<%= label f, :remember_me, "Keep me logged in for 60 days" %> <%= checkbox f, :remember_me %> +
+
<%= submit "Log in" %>
<% end %>

- <%= link "Register", to: Routes.user_registration_path(@conn, :new) %> | <%= link "Forgot your password?", to: Routes.user_reset_password_path(@conn, :new) %>

diff --git a/mix.lock b/mix.lock index 2b29375..69b3551 100644 --- a/mix.lock +++ b/mix.lock @@ -1,4 +1,6 @@ %{ + "bcrypt_elixir": {:hex, :bcrypt_elixir, "2.2.0", "3df902b81ce7fa8867a2ae30d20a1da6877a2c056bfb116fd0bc8a5f0190cea4", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "762be3fcb779f08207531bc6612cca480a338e4b4357abb49f5ce00240a77d1e"}, + "comeonin": {:hex, :comeonin, "5.3.1", "7fe612b739c78c9c1a75186ef2d322ce4d25032d119823269d0aa1e2f1e20025", [:mix], [], "hexpm", "d6222483060c17f0977fad1b7401ef0c5863c985a64352755f366aee3799c245"}, "connection": {:hex, :connection, "1.1.0", "ff2a49c4b75b6fb3e674bfc5536451607270aac754ffd1bdfe175abe4a6d7a68", [:mix], [], "hexpm", "722c1eb0a418fbe91ba7bd59a47e28008a189d47e37e0e7bb85585a016b2869c"}, "cowboy": {:hex, :cowboy, "2.8.0", "f3dc62e35797ecd9ac1b50db74611193c29815401e53bac9a5c0577bd7bc667d", [:rebar3], [{:cowlib, "~> 2.9.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.7.1", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "4643e4fba74ac96d4d152c75803de6fad0b3fa5df354c71afdd6cbeeb15fac8a"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.3.1", "ebd1a1d7aff97f27c66654e78ece187abdc646992714164380d8a041eda16754", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3a6efd3366130eab84ca372cbd4a7d3c3a97bdfcfb4911233b035d117063f0af"}, @@ -7,6 +9,7 @@ "decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"}, "ecto": {:hex, :ecto, "3.5.5", "48219a991bb86daba6e38a1e64f8cea540cded58950ff38fbc8163e062281a07", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "98dd0e5e1de7f45beca6130d13116eae675db59adfa055fb79612406acf6f6f1"}, "ecto_sql": {:hex, :ecto_sql, "3.5.3", "1964df0305538364b97cc4661a2bd2b6c89d803e66e5655e4e55ff1571943efd", [:mix], [{:db_connection, "~> 2.2", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.5.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.3.0 or ~> 0.4.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.15.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2f53592432ce17d3978feb8f43e8dc0705e288b0890caf06d449785f018061c"}, + "elixir_make": {:hex, :elixir_make, "0.6.2", "7dffacd77dec4c37b39af867cedaabb0b59f6a871f89722c25b28fcd4bd70530", [:mix], [], "hexpm", "03e49eadda22526a7e5279d53321d1cced6552f344ba4e03e619063de75348d9"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "gettext": {:hex, :gettext, "0.18.2", "7df3ea191bb56c0309c00a783334b288d08a879f53a7014341284635850a6e55", [:mix], [], "hexpm", "f9f537b13d4fdd30f3039d33cb80144c3aa1f8d9698e47d7bcbcc8df93b1f5c5"}, "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},