fix routes user and css flash

parent d3fde0de
Pipeline #1406 failed with stages
in 0 seconds
@import "bootstrap"; @import "bootstrap";
@import "flash";
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap');
#logo { #logo {
float: left; float: left;
margin-right: 10px; margin-right: 10px;
...@@ -159,30 +161,23 @@ footer { ...@@ -159,30 +161,23 @@ footer {
} }
} }
.alert-error { .alert-error, .alert-alert {
background-color: #f2dede; background-color: $background-error-alert-color;
border-color: #eed3d7; border-color: $border-error-alert-color;
color: #b94a48; color: $error-alert-color;
text-align: left;
}
.alert-alert {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
text-align: left; text-align: left;
} }
.alert-success { .alert-success {
background-color: #dff0d8; background-color: $background-success-notice-color;
border-color: #d6e9c6; border-color: $border-success-notice-color;
color: #468847; color: $success-notice-color;
text-align: left; text-align: left;
} }
.alert-notice { .alert-notice {
background-color: #dff0d8; background-color: $background-success-notice-color;
border-color: #d6e9c6; border-color: $border-success-notice-color;
color: #468847; color: $success-notice-color;
text-align: left; text-align: left;
} }
\ No newline at end of file
$background-error-alert-color:#f2dede;
$border-error-alert-color:#eed3d7;
$error-alert-color: #b94a48;
$background-success-notice-color: #dff0d8;
$border-success-notice-color:#d6e9c6;
$success-notice-color: #468847;
\ No newline at end of file
# frozen_string_literal: true
class Users::ConfirmationsController < Devise::ConfirmationsController class Users::ConfirmationsController < Devise::ConfirmationsController
# GET /resource/confirmation/new
# def new
# super
# end
# POST /resource/confirmation
# def create
# super
# end
# GET /resource/confirmation?confirmation_token=abcdef
# def show
# super
# end
protected protected
# The path used after resending confirmation instructions. # The path used after resending confirmation instructions.
# def after_resending_confirmation_instructions_path_for(resource_name) def after_resending_confirmation_instructions_path_for(resource_name)
# super(resource_name) register_2_path
# end end
# The path used after confirmation. # The path used after confirmation.
def after_confirmation_path_for(resource_name, resource) def after_confirmation_path_for(resource_name, resource)
......
# frozen_string_literal: true
class Users::PasswordsController < Devise::PasswordsController class Users::PasswordsController < Devise::PasswordsController
# GET /resource/password/new
# def new
# super
# end
# POST /resource/password
# def create
# super
# end
# GET /resource/password/edit?reset_password_token=abcdef
# def edit
# self.resource = resource_class.new(reset_params)
# set_minimum_password_length
# resource.reset_password_token = params[:reset_password_token]
# end
# PUT /resource/password
# def update
# super
# end
protected protected
......
# frozen_string_literal: true class Users::RegistrationsController < Devise::RegistrationsController
class Users::RegistrationsController < Devise::RegistrationsController
# before_action :configure_sign_up_params, only: [:create]
# before_action :configure_account_update_params, only: [:update]
def show def show
end end
# GET /resource/sign_up
# def new
# super
# end
# # POST /resource
# def create
# super
# end
# GET /resource/edit
# def edit
# super
# end
# # PUT /resource
# def update
# super
# end
# def update
# super
# end
# DELETE /resource
# def destroy
# super
# end
# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
# def cancel
# super
# end
private private
# If you have extra params to permit, append them to the sanitizer.
# def configure_permitted_parameters
# devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :cv, :password, :password_confirmation])
# end
# The path used after sign up.
# def after_sign_up_path_for(resource)
# send_path
# end
def after_update_path_for(resource) def after_update_path_for(resource)
my_path my_path
end end
...@@ -63,13 +12,4 @@ class Users::RegistrationsController < Devise::RegistrationsController ...@@ -63,13 +12,4 @@ class Users::RegistrationsController < Devise::RegistrationsController
def after_inactive_sign_up_path_for(resource) def after_inactive_sign_up_path_for(resource)
register_2_path register_2_path
end end
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_up_params
# devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :cv])
# end
# def configure_account_update_params
# devise_parameter_sanitizer.permit(:account_update, keys: [:name, :cv])
# end
end end
# frozen_string_literal: true
class Users::SessionsController < Devise::SessionsController class Users::SessionsController < Devise::SessionsController
# before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
# protected
# If you have extra params to permit, append them to the sanitizer.
# def configure_sign_in_params
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
# end
end end
...@@ -4,7 +4,7 @@ class User < ApplicationRecord ...@@ -4,7 +4,7 @@ class User < ApplicationRecord
has_many :favorite_jobs, dependent: :destroy has_many :favorite_jobs, dependent: :destroy
has_many :history_jobs, dependent: :destroy has_many :history_jobs, dependent: :destroy
devise :database_authenticatable, :registerable, devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable, :recoverable, :rememberable, :validatable,
:confirmable :confirmable
validates :name, length: { maximum: 200 } validates :name, length: { maximum: 200 }
validates :email, length: { maximum: 200 }, uniqueness: true validates :email, length: { maximum: 200 }, uniqueness: true
......
...@@ -13,8 +13,6 @@ html ...@@ -13,8 +13,6 @@ html
body.bg-light body.bg-light
= render 'layouts/header' = render 'layouts/header'
.container .container
/ p.notice= notice
/ p.alert= alert
- flash.each do |key, value| - flash.each do |key, value|
= content_tag(:div, value, class: "alert alert-#{key}") = content_tag(:div, value, class: "alert alert-#{key}")
= yield = yield
......
h2.p-3.text-center .row.p-3
| Resend confirmation instructions
.row
.col-md-6.offset-md-3.form-apply .col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: register_2_path) do |f| = form_for(resource, as: resource_name) do |f|
= render 'shared/error_messages', object: resource = render 'shared/error_messages', object: resource
.card .card
.card-body .card-body
.field .field
= f.label :email = f.label :email
br br
= f.email_field :email, autofocus: true, required: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'form-control' = f.email_field :email, autofocus: true, disabled: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'form-control'
.actions.p-3.text-center .actions.p-3.text-center
= f.submit "Confirm your email", class: "btn btn-primary" = link_to "Back to Login", new_user_session_path, class: "btn btn-primary"
\ No newline at end of file \ No newline at end of file
h2.p-3.text-center
| Sign up
.row
.col-md-6.offset-md-3.form-apply
= form_for(resource, as: resource_name, url: register_2_path) do |f|
= render 'shared/error_messages', object: resource
.card
.card-body
.field
= f.label :name, "Full Name"
br
= f.text_field :name, required: true, length: { maximum: 200 }, class: 'form-control'
.field
= f.label :email
br
= f.email_field :email, required: true, length: { maximum: 200 }, autofocus: true, autocomplete: "email", class: 'form-control'
.field
= f.label :password
- if @minimum_password_length
em
| (
= @minimum_password_length
| characters minimum)
br
= f.password_field :password, autocomplete: "new-password", class: 'form-control'
.field
= f.label :password_confirmation
br
= f.password_field :password_confirmation, autocomplete: "new-password", class: 'form-control'
.field
= f.label :cv, "CV"
br
= f.file_field :cv, accept: "application/pdf", size: { less_than: 5.megabytes, message:"should be less than 5MB" }
.actions.p-3.text-center
= f.submit "Sign up", class: "btn btn-primary"
\ No newline at end of file
...@@ -2,7 +2,7 @@ h2.p-3.text-center ...@@ -2,7 +2,7 @@ h2.p-3.text-center
| My Page | My Page
.row .row
.col-md-6.offset-md-3.form-apply .col-md-6.offset-md-3.form-apply
= form_with(model: @user, local:true) do |f| = form_with(scope: @user, local:true) do |f|
.card .card
.card-body .card-body
.field .field
......
<h2>Resend unlock instructions</h2>
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= render "users/shared/error_messages", resource: resource %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
</div>
<div class="actions">
<%= f.submit "Resend unlock instructions" %>
</div>
<% end %>
<%= render "users/shared/links" %>
...@@ -9,7 +9,6 @@ Rails.application.routes.draw do ...@@ -9,7 +9,6 @@ Rails.application.routes.draw do
post 'confirm', to: 'apply_jobs#confirm' post 'confirm', to: 'apply_jobs#confirm'
post 'done', to: 'apply_jobs#done' post 'done', to: 'apply_jobs#done'
devise_for :users, skip: %i[sessions registrations passwords], controllers: { confirmations: 'users/confirmations' } devise_for :users, skip: %i[sessions registrations passwords], controllers: { confirmations: 'users/confirmations' }
resources :users, only: :show
get '/my', to: 'users#show' get '/my', to: 'users#show'
devise_scope :user do devise_scope :user do
get 'register/1', to: 'users/registrations#new', as: :new_user_registration get 'register/1', to: 'users/registrations#new', as: :new_user_registration
......
...@@ -13,11 +13,11 @@ class AuthenticatableRegisterableTrackableConfirmableToUser < ActiveRecord::Migr ...@@ -13,11 +13,11 @@ class AuthenticatableRegisterableTrackableConfirmableToUser < ActiveRecord::Migr
t.datetime :remember_created_at t.datetime :remember_created_at
## Trackable ## Trackable
t.integer :sign_in_count, default: 0, null: false # t.integer :sign_in_count, default: 0, null: false
t.datetime :current_sign_in_at # t.datetime :current_sign_in_at
t.datetime :last_sign_in_at # t.datetime :last_sign_in_at
t.string :current_sign_in_ip # t.string :current_sign_in_ip
t.string :last_sign_in_ip # t.string :last_sign_in_ip
# Confirmable # Confirmable
t.string :confirmation_token t.string :confirmation_token
......
...@@ -157,11 +157,6 @@ ActiveRecord::Schema.define(version: 2021_08_18_152915) do ...@@ -157,11 +157,6 @@ ActiveRecord::Schema.define(version: 2021_08_18_152915) do
t.string "reset_password_token" t.string "reset_password_token"
t.datetime "reset_password_sent_at" t.datetime "reset_password_sent_at"
t.datetime "remember_created_at" t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token" t.string "confirmation_token"
t.datetime "confirmed_at" t.datetime "confirmed_at"
t.datetime "confirmation_sent_at" t.datetime "confirmation_sent_at"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment