NEW: styling (#5)
This commit is contained in:
parent
26995d72e3
commit
2b8a6a1927
13 changed files with 175 additions and 118 deletions
|
@ -1,5 +1,15 @@
|
|||
<main role="main" class="container">
|
||||
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
|
||||
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
|
||||
<%= if not is_nil(get_flash(@conn, :info)) do %>
|
||||
<p class="notification is-info" role="alert">
|
||||
<%= get_flash(@conn, :info) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= if not is_nil(get_flash(@conn, :error)) do %>
|
||||
<p class="notification is-danger" role="alert">
|
||||
<%= get_flash(@conn, :error) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= @inner_content %>
|
||||
</main>
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
<main role="main" class="container">
|
||||
<p class="alert alert-info" role="alert"
|
||||
phx-click="lv:clear-flash"
|
||||
phx-value-key="info"><%= live_flash(@flash, :info) %></p>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<%= if live_flash(@flash, :info) do %>
|
||||
<p class="alert alert-info" role="alert"
|
||||
phx-click="lv:clear-flash"
|
||||
phx-value-key="info"><%= live_flash(@flash, :info) %></p>
|
||||
<% end %>
|
||||
|
||||
<p class="alert alert-danger" role="alert"
|
||||
phx-click="lv:clear-flash"
|
||||
phx-value-key="error"><%= live_flash(@flash, :error) %></p>
|
||||
<%= if live_flash(@flash, :error) do %>
|
||||
<p class="alert alert-danger" role="alert"
|
||||
phx-click="lv:clear-flash"
|
||||
phx-value-key="error"><%= live_flash(@flash, :error) %></p>
|
||||
<% end %>
|
||||
|
||||
<%= @inner_content %>
|
||||
<%= @inner_content %>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -2,27 +2,34 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<title>Planner</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>planner</title>
|
||||
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
|
||||
<%= csrf_meta_tag() %>
|
||||
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Planner</h1>
|
||||
<ul>
|
||||
<%= if @current_user do %>
|
||||
<li><%= @current_user.email %></li>
|
||||
<li><%= link "Settings", to: Routes.user_settings_path(@conn, :edit) %></li>
|
||||
<li><%= link "Logout", to: Routes.user_session_path(@conn, :delete), method: :delete %></li>
|
||||
<% else %>
|
||||
<li><%= link "Login", to: Routes.user_session_path(@conn, :new) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<nav class="navbar is-dark" role="navigation">
|
||||
<div class="navbar-brand">
|
||||
<%= link "planner", to: Routes.landing_path(@conn, :index), class: "navbar-item has-text-weight-bold hast-text-info-light" %>
|
||||
|
||||
<hr>
|
||||
<a role="button" class="navbar-burger burger" data-target="nvbr">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<%= @inner_content %>
|
||||
<div id="nvbr" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<%= link "tasks", to: Routes.landing_path(@conn, :index), class: "navbar-item" %>
|
||||
</div>
|
||||
|
||||
<div class="navbar-end">
|
||||
<%= link "log out", to: Routes.user_session_path(@conn, :delete), method: :delete, class: "navbar-item" %>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<%= @inner_content %>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,22 +1,30 @@
|
|||
<h1>Reset password</h1>
|
||||
<h1 class="title is-1">Reset password</h1>
|
||||
|
||||
<%= form_for @changeset, Routes.user_reset_password_path(@conn, :update, @token), fn f -> %>
|
||||
<%= if @changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<div class="help is-danger">
|
||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :password, "New password" %>
|
||||
<%= password_input f, :password, required: true %>
|
||||
<%= error_tag f, :password %>
|
||||
<div class="field">
|
||||
<%= label f, :password, "New password", class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :password, required: true, class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :password %>
|
||||
</div>
|
||||
|
||||
<%= label f, :password_confirmation, "Confirm new password" %>
|
||||
<%= password_input f, :password_confirmation, required: true %>
|
||||
<%= error_tag f, :password_confirmation %>
|
||||
<div class="field">
|
||||
<%= label f, :password_confirmation, "Confirm new password", class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :password_confirmation, required: true, class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :password_confirmation %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= submit "Reset password" %>
|
||||
<%= submit "Reset password", class: "button is-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
<h1>Forgot your password?</h1>
|
||||
<h1 class="title is-1">Forgot your password?</h1>
|
||||
|
||||
<%= form_for :user, Routes.user_reset_password_path(@conn, :create), fn f -> %>
|
||||
<%= label f, :email %>
|
||||
<%= text_input f, :email, required: true %>
|
||||
<div class="field">
|
||||
<%= label f, :email, class: "label" %>
|
||||
<div class="control">
|
||||
<%= text_input f, :email, required: true, class: "input" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= submit "Send instructions to reset password" %>
|
||||
<%= submit "Send instructions to reset password", class: "button is-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,23 +1,38 @@
|
|||
<h1>Login</h1>
|
||||
<h1 class="title is-1">Login</h1>
|
||||
|
||||
<%= form_for @conn, Routes.user_session_path(@conn, :create), [as: :user], fn f -> %>
|
||||
<%= if @error_message do %>
|
||||
<div class="alert alert-danger">
|
||||
|
||||
<div class="help is-danger">
|
||||
<p><%= @error_message %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :email %>
|
||||
<%= text_input f, :email, required: true %>
|
||||
<div class="field">
|
||||
<%= label f, :email, class: "label" %>
|
||||
<div class="control">
|
||||
<%= text_input f, :email, required: true, class: "input" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= label f, :password %>
|
||||
<%= password_input f, :password, required: true %>
|
||||
<div class="field">
|
||||
<%= label f, :password, class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :password, required: true, class: "input" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= label f, :remember_me, "Keep me logged in for 60 days" %>
|
||||
<%= checkbox f, :remember_me %>
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<%= label class: "checkbox" do %>
|
||||
Keep me logged in for 60 days
|
||||
<%= checkbox f, :remember_me %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= submit "Login" %>
|
||||
<div class="control">
|
||||
<%= submit "Login", class: "button is-link" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -1,49 +1,71 @@
|
|||
<h1>Settings</h1>
|
||||
<h1 class="title is-1">Settings</h1>
|
||||
|
||||
<h3>Change e-mail</h3>
|
||||
<h3 class="title is-3">Change e-mail</h3>
|
||||
|
||||
<%= form_for @email_changeset, Routes.user_settings_path(@conn, :update_email), fn f -> %>
|
||||
<%= if @email_changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<div class="help is-danger">
|
||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :email %>
|
||||
<%= text_input f, :email, required: true %>
|
||||
<%= error_tag f, :email %>
|
||||
<div class="field">
|
||||
<%= label f, :email, class: "label" %>
|
||||
<div class="control">
|
||||
<%= text_input f, :email, required: true, class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :email %>
|
||||
</div<
|
||||
|
||||
<%= label f, :current_password, for: "current_password_for_email" %>
|
||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email" %>
|
||||
<%= error_tag f, :current_password %>
|
||||
<div class="field">
|
||||
<%= label f, :current_password, for: "current_password_for_email", class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_email", class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :current_password %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= submit "Change e-mail" %>
|
||||
<%= submit "Change e-mail", class: "button is-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3>Change password</h3>
|
||||
<br>
|
||||
|
||||
<h3 class="title is-3">Change password</h3>
|
||||
|
||||
<%= form_for @password_changeset, Routes.user_settings_path(@conn, :update_password), fn f -> %>
|
||||
<%= if @password_changeset.action do %>
|
||||
<div class="alert alert-danger">
|
||||
<div class="help is-danger">
|
||||
<p>Oops, something went wrong! Please check the errors below.</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= label f, :password, "New password" %>
|
||||
<%= password_input f, :password, required: true %>
|
||||
<%= error_tag f, :password %>
|
||||
<div class="field">
|
||||
<%= label f, :password, "New password", class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :password, required: true, class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :password %>
|
||||
</div>
|
||||
|
||||
<%= label f, :password_confirmation, "Confirm new password" %>
|
||||
<%= password_input f, :password_confirmation, required: true %>
|
||||
<%= error_tag f, :password_confirmation %>
|
||||
<div class="field">
|
||||
<%= label f, :password_confirmation, "Confirm new password", class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :password_confirmation, required: true, class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :password_confirmation %>
|
||||
</div>
|
||||
|
||||
<%= label f, :current_password, for: "current_password_for_password" %>
|
||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password" %>
|
||||
<%= error_tag f, :current_password %>
|
||||
<div class="field">
|
||||
<%= label f, :current_password, for: "current_password_for_password", class: "label" %>
|
||||
<div class="control">
|
||||
<%= password_input f, :current_password, required: true, name: "current_password", id: "current_password_for_password", class: "input" %>
|
||||
</div>
|
||||
<%= error_tag f, :current_password %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= submit "Change password" %>
|
||||
<%= submit "Change password", class: "button is-primary" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue