diff --git a/app/assets/stylesheets/admin.sass b/app/assets/stylesheets/admin.sass index d484bedaa6470925a3a405c85b84f9d7999b70a5..0ae53103027e081426039e5d5a49fbe33ed8942b 100644 --- a/app/assets/stylesheets/admin.sass +++ b/app/assets/stylesheets/admin.sass @@ -1,2 +1,2 @@ -@import 'appstack/light' +@import 'appstack/dark' @import 'admin/*' diff --git a/app/assets/stylesheets/admin/styles.sass b/app/assets/stylesheets/admin/styles.sass index cd6160dcb923cab4206ab5344534f5fb08e13a7c..d94ee86ef8bd147e42c60f0ee7f23b389cb7c9da 100644 --- a/app/assets/stylesheets/admin/styles.sass +++ b/app/assets/stylesheets/admin/styles.sass @@ -3,3 +3,9 @@ h1 .sidebar-nav .fas min-width: 20px + +#topbar + padding-left: 2.5rem + padding-right: 2.5rem + .nav-link.avatar + padding-right: 0 diff --git a/app/views/admin/application/_footer.html.erb b/app/views/admin/application/_footer.html.erb index c8f2fe951d34d34a3da62e84ba25b7218e65500a..34e022a16c6bffc6f677ac6f179a729cffc84f08 100644 --- a/app/views/admin/application/_footer.html.erb +++ b/app/views/admin/application/_footer.html.erb @@ -20,7 +20,7 @@ <div class="col-6 text-end"> <p class="mb-0"> <a href="https://www.osuny.org" target="_blank" rel="noreferrer"> - <%= image_tag 'osuny-black.svg', width: 65 %> + <%= image_tag 'osuny-white.svg', width: 65 %> </a> </p> </div> diff --git a/app/views/admin/application/_nav.html.erb b/app/views/admin/application/_nav.html.erb index df7afefc6438e02864aec4b35bc31fb3aa3062c5..5016cfd06c48f76fd97f1f4d41db068e8fb8f301 100644 --- a/app/views/admin/application/_nav.html.erb +++ b/app/views/admin/application/_nav.html.erb @@ -1,8 +1,7 @@ - <nav id="sidebar" class="sidebar"> <div class="sidebar-content js-simplebar"> <%= link_to admin_root_path, class: 'sidebar-brand' do %> - <%= image_tag 'osuny-black.svg', class: 'img-fluid pe-5 py-3' %> + <%= image_tag 'osuny-white.svg', class: 'img-fluid pe-5 py-3' %> <% end %> <%= render_navigation context: :admin %> </div> diff --git a/app/views/admin/application/_top.html.erb b/app/views/admin/application/_top.html.erb index b79946dcf07ae9866a53491cbd01b114df6b7e97..7c6ab401b5fbe384c517ee359ca0249d9de6d076 100644 --- a/app/views/admin/application/_top.html.erb +++ b/app/views/admin/application/_top.html.erb @@ -1,4 +1,4 @@ -<nav class="navbar navbar-expand navbar-light navbar-bg"> +<nav id="topbar" class="navbar navbar-expand navbar-light navbar-bg"> <div class="navbar-collapse collapse"> <%= render_breadcrumbs builder: Appstack::BreadcrumbsOnRailsBuilder %> <ul class="navbar-nav navbar-align"> @@ -14,11 +14,11 @@ <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Settings & Privacy</a> <a class="dropdown-item" href="#">Help</a> - <a class="dropdown-item" href="#">Sign out</a> + <%= link_to 'DĆ©connexion', destroy_user_session_path, method: :delete, class: 'dropdown-item' %> </div> </li> <li> - <a class="nav-link" href="#"> + <a class="nav-link avatar" href="#"> <%= image_tag 'avatar.jpg', class: 'avatar img-fluid rounded-circle' %> </a> </li> diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index 7d508ae2a5b8facdab65304097349cdd9e5b49cb..1d3d05832deed44fe28fd3522d22fe9792a1ede8 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -49,24 +49,8 @@ <div class="col-sm-6 col-lg-12 col-xxl-6 d-flex"> <div class="card illustration flex-fill"> <div class="card-body p-0 d-flex flex-fill"> - <div class="row g-0 w-100"> - <div class="col-6"> - <div class="illustration-text p-3 m-1"> - <h4 class="illustration-text"> - <font style="vertical-align: inherit;"> - <font style="vertical-align: inherit;">Bon retour, Chris !</font> - </font> - </h4> - <p class="mb-0"> - <font style="vertical-align: inherit;"> - <font style="vertical-align: inherit;">Tableau de bord AppStack</font> - </font> - </p> - </div> - </div> - <div class="col-6 align-self-end text-end"> - <img src="img/illustrations/searching.png" alt="Recherche" class="img-fluid illustration-img"> - </div> + <div class="p-3"> + <h4>Bonjour <%= current_user.first_name %> !</h4> </div> </div> </div> diff --git a/app/views/admin/layouts/application.html.erb b/app/views/admin/layouts/application.html.erb index c5ed8061f93a6e1f0c3060dfc674a33dd153cc5c..a4c9b6ee113efd673bb6430404b939f899aa337d 100644 --- a/app/views/admin/layouts/application.html.erb +++ b/app/views/admin/layouts/application.html.erb @@ -13,7 +13,7 @@ <%= favicon_link_tag 'favicon.ico' %> </head> - <body data-theme="light" data-layout="fluid" data-sidebar-position="left" data-sidebar-behavior="sticky"> + <body data-theme="dark" data-layout="fluid" data-sidebar-position="left" data-sidebar-behavior="sticky"> <div class="wrapper"> <%= render 'admin/application/nav' %> <div class="main"> diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..f7b4a65c50f5b1dee50b718eb67a76fd2ec04d34 --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,20 @@ +<h2>Resend confirmation instructions</h2> + +<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> + <%= f.error_notification %> + <%= f.full_error :confirmation_token %> + + <div class="form-inputs"> + <%= f.input :email, + required: true, + autofocus: true, + value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), + input_html: { autocomplete: "email" } %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Resend confirmation instructions" %> + </div> +<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..dc55f64f69e2541d12e6ffd6e3f4a413e8b828b2 --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +<p>Welcome <%= @email %>!</p> + +<p>You can confirm your account email through the link below:</p> + +<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p> diff --git a/app/views/devise/mailer/email_changed.html.erb b/app/views/devise/mailer/email_changed.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..32f4ba8038d81c16f86eab2262a761f56ef656c9 --- /dev/null +++ b/app/views/devise/mailer/email_changed.html.erb @@ -0,0 +1,7 @@ +<p>Hello <%= @email %>!</p> + +<% if @resource.try(:unconfirmed_email?) %> + <p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p> +<% else %> + <p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p> +<% end %> diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..b41daf476a35f81702a954445f624b98e15b54f1 --- /dev/null +++ b/app/views/devise/mailer/password_change.html.erb @@ -0,0 +1,3 @@ +<p>Hello <%= @resource.email %>!</p> + +<p>We're contacting you to notify you that your password has been changed.</p> diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..f667dc12fe34929983021920c39f4ca061c4fd4f --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +<p>Hello <%= @resource.email %>!</p> + +<p>Someone has requested a link to change your password. You can do this through the link below.</p> + +<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p> + +<p>If you didn't request this, please ignore this email.</p> +<p>Your password won't change until you access the link above and create a new one.</p> diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..41e148bf2ac2d8b3f108e15c45f8a2e75fb0b07e --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +<p>Hello <%= @resource.email %>!</p> + +<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p> + +<p>Click the link below to unlock your account:</p> + +<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p> diff --git a/app/views/devise/passwords/edit.html.erb b/app/views/devise/passwords/edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..591cd8c85a2bfa46d4d699efc6af56aa3ba73687 --- /dev/null +++ b/app/views/devise/passwords/edit.html.erb @@ -0,0 +1,27 @@ +<h2>Change your password</h2> + +<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= f.error_notification %> + + <%= f.input :reset_password_token, as: :hidden %> + <%= f.full_error :reset_password_token %> + + <div class="form-inputs"> + <%= f.input :password, + label: "New password", + required: true, + autofocus: true, + hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length), + input_html: { autocomplete: "new-password" } %> + <%= f.input :password_confirmation, + label: "Confirm your new password", + required: true, + input_html: { autocomplete: "new-password" } %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Change my password" %> + </div> +<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..01ce0b8b9b8aa008b13ae987830a97ac12ab8e7e --- /dev/null +++ b/app/views/devise/passwords/new.html.erb @@ -0,0 +1,18 @@ +<h2>Forgot your password?</h2> + +<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %> + <%= f.error_notification %> + + <div class="form-inputs"> + <%= f.input :email, + required: true, + autofocus: true, + input_html: { autocomplete: "email" } %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Send me reset password instructions" %> + </div> +<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..dfb7eb94ea9a4a18529bac9097280cb9a51a4450 --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,35 @@ +<h2>Edit <%= resource_name.to_s.humanize %></h2> + +<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> + <%= f.error_notification %> + + <div class="form-inputs"> + <%= f.input :email, required: true, autofocus: true %> + + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> + <p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p> + <% end %> + + <%= f.input :password, + hint: "leave it blank if you don't want to change it", + required: false, + input_html: { autocomplete: "new-password" } %> + <%= f.input :password_confirmation, + required: false, + input_html: { autocomplete: "new-password" } %> + <%= f.input :current_password, + hint: "we need your current password to confirm your changes", + required: true, + input_html: { autocomplete: "current-password" } %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Update" %> + </div> +<% end %> + +<h3>Cancel my account</h3> + +<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p> + +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..cf520eccd4526915ba799c37e814819d7dd9f020 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,25 @@ +<h2>Sign up</h2> + +<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> + <%= f.error_notification %> + + <div class="form-inputs"> + <%= f.input :email, + required: true, + autofocus: true, + input_html: { autocomplete: "email" }%> + <%= f.input :password, + required: true, + hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length), + input_html: { autocomplete: "new-password" } %> + <%= f.input :password_confirmation, + required: true, + input_html: { autocomplete: "new-password" } %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Sign up", class: 'btn btn-lg btn-primary' %> + </div> +<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..c2f4b30df4a49c178976331045161e5d87cf03a1 --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,20 @@ +<h2>Log in</h2> + +<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> + <div class="form-inputs"> + <%= f.input :email, + required: false, + autofocus: true, + input_html: { autocomplete: "email" } %> + <%= f.input :password, + required: false, + input_html: { autocomplete: "current-password" } %> + <%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Log in", class: 'btn btn-lg btn-primary' %> + </div> +<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_error_messages.html.erb b/app/views/devise/shared/_error_messages.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..ba7ab887013255a06523bdee4d19189cb5b59b3c --- /dev/null +++ b/app/views/devise/shared/_error_messages.html.erb @@ -0,0 +1,15 @@ +<% if resource.errors.any? %> + <div id="error_explanation"> + <h2> + <%= I18n.t("errors.messages.not_saved", + count: resource.errors.count, + resource: resource.class.model_name.human.downcase) + %> + </h2> + <ul> + <% resource.errors.full_messages.each do |message| %> + <li><%= message %></li> + <% end %> + </ul> + </div> +<% end %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..96a9412417bf51257684ada2d9410c4e98e857ff --- /dev/null +++ b/app/views/devise/shared/_links.html.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Log in", new_session_path(resource_name) %><br /> +<% end %> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %><br /> +<% end %> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %><br /> +<% end %> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br /> +<% end %> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> +<% end %> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br /> + <% end %> +<% end %> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..c42de1738e6de14e6a7f7b470f3e5b0d257440ae --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,19 @@ +<h2>Resend unlock instructions</h2> + +<%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> + <%= f.error_notification %> + <%= f.full_error :unlock_token %> + + <div class="form-inputs"> + <%= f.input :email, + required: true, + autofocus: true, + input_html: { autocomplete: "email" } %> + </div> + + <div class="form-actions"> + <%= f.button :submit, "Resend unlock instructions" %> + </div> +<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/layouts/devise.html.erb b/app/views/layouts/devise.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..f7b594e8c6eba126d1bbaaae640a3ce45bf58dc9 --- /dev/null +++ b/app/views/layouts/devise.html.erb @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> + <title><%= yield :title %></title> + <%= csrf_meta_tags %> + <%= csp_meta_tag %> + <%= stylesheet_link_tag 'admin', media: 'all' %> + <%= javascript_include_tag 'admin' %> + </head> + <body data-theme="default" data-layout="fluid"> + <div class="main d-flex justify-content-center w-100"> + <main class="content d-flex p-0"> + <div class="container d-flex flex-column"> + <div class="row h-100"> + <div class="col-sm-10 col-md-8 col-lg-6 mx-auto d-table h-100"> + <div class="d-table-cell align-middle"> + <h1 class="mb-5 text-center"><%= current_university %></h1> + <div class="card"> + <div class="card-body text-start"> + <div class="m-sm-4"> + <%= yield %> + </div> + </div> + </div> + </div> + </div> + </div> + </main> + </div> + </body> + </html>