Commit 14065b26 by Mykhailo Makohin

finish registration

parent f8b7ff2c
<svg id="SvgjsSvg1000" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" width="16" height="16"><defs id="SvgjsDefs1001"></defs><path id="SvgjsPath1007" d="M1750 797L1750 789.999L1743 789.999L1743 788L1750 788L1750 781L1752 781L1752 788L1759 788L1759 789.999L1752 789.999L1752 797Z " fill="#ff4628" transform="matrix(1,0,0,1,-1743,-781)"></path></svg>
\ No newline at end of file
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
protect_from_forgery with: :exception
skip_before_filter :verify_authenticity_token
end
class UsersController < ApplicationController
# skip_before_filter :verify_authenticity_token
def index
@users = collection
......@@ -17,7 +18,7 @@ class UsersController < ApplicationController
@user.skip_password_validation = true
if @user.save
redirect_to edit_user_path(@user)
elsif
else
redirect_to root_path
end
end
......@@ -28,12 +29,10 @@ class UsersController < ApplicationController
def update
@user = resource
@user.skip_password_validation = false
if @user.update(user_params)
sign_in @user
redirect_to user_path(@user)
else
puts @user.errors.messages
render :edit
end
end
......@@ -42,7 +41,7 @@ class UsersController < ApplicationController
@user = resource
@user.destroy
redirect_to users_path
redirect_to root_path
end
private
......@@ -57,7 +56,6 @@ class UsersController < ApplicationController
def user_params
params.require(:user).permit(:email, :name, :location,
:password, :password_confirmation)
:password, :password_confirmation)
end
end
\ No newline at end of file
......@@ -31,8 +31,17 @@ class User < ApplicationRecord
protected
# def password_required?
# return false if skip_password_validation
# super
# end
def password_required?
return false if skip_password_validation
super
if respond_to?(:reset_password_token)
return true if reset_password_token.present?
end
return true if new_record?
password.present? || password_confirmation.present?
end
end
......@@ -190,7 +190,7 @@
%span.grid_item_content.tooltipstered
%a.get_involved_link.centered{"data-original-title" => "приєднатись", "data-placement" => "top", "data-toggle" => "tooltip", :href => "#"}
%span.get_involved_circle
%img.icon_plus{:alt => "", :src => "img/plus.svg"}/
%img.icon_plus{:alt => "", :src => "plus.svg"}/
.progress
.progress-bar{"aria-valuemax" => "100", "aria-valuemin" => "0", "aria-valuenow" => "58", :role => "progressbar", :style => "width: 58%"}
.progress_value_lg 58 / 100
......@@ -595,8 +595,8 @@
.counter_text Обєднаних людей за кордоном
.map_text
Етнічна, в першу чергу релігійна та мовно-культурна спільнота або сукупність індивидів, які існують зберігаються за межами свого регіону
#map.map
%a.btn.btn_default.btn_round.btn_bordered{"data-original-title" => "долучитись", "data-placement" => "top", "data-toggle" => "tooltip", :href => "#"}
#map.map
%a.btn.btn_default.btn_round.btn_bordered{"data-original-title" => "долучитись", "data-placement" => "top", "data-target" => "#modal3", "data-toggle" => "modal",href: "#"}
%i.icon.icon_plus
.tooltip_templates
#tooltip_content_inner
......@@ -605,7 +605,7 @@
Технічний партнер
.tooltipster_title_name Cosmo-Trecel
%a.tooltipster_img{"data-target" => "#video", "data-toggle" => "modal", :href => "//www.youtube.com/embed/uX12dn47Dy0?rel=0&autoplay=1&showinfo=0html5=1"}
%img{:alt => "", :src => "img/tip_img1.png"}/
%img{:alt => "", :src => "tip_img1.png"}/
.tooltipster_bot
%a.tooltipster_link{:href => "#"} cosmo-travel.com.ua
%a.round_link{:href => "#"}
......
......@@ -45,7 +45,7 @@
- unless current_user
.login_wrap
%div
%button.login_btn{"data-target" => "#modal3", "data-toggle" => "modal"}
%button.login_btn{"data-target" => "#modal_log_in", "data-toggle" => "modal"}
= image_tag ("login.png")
.search_block
%input#search_field.search_field{placeholder: "Пошук по імені...", :type => "text"}/
......
......@@ -8,7 +8,7 @@
%button.round_link.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
%i.icon.icon_close
.modal-header_bot
%h3#modalLabel.modal-title Вхід
%h3#modalLabel.modal-title Реєстрація
.help_text.absolute
%span.asterisk> *
Всі поля обов'язкові для заповнення
......@@ -16,7 +16,7 @@
.row
.col-sm-9.modal-body_login
%h4.modal_subtitle
Авторизація
реєстрація
.form-group
%label{:for => "id_3"}
E-mail
......@@ -44,3 +44,68 @@
%i.icon.icon_google
.text-center
= f.button :submit, "Вхід", class: "btn btn-success btn-lg"
#modal_log_in.modal.fade.modal_styled.in{"aria-labelledby" => "modalLabel", :role => "dialog", :tabindex => "-1"}
.modal-dialog{:role => "document"}
.modal-content
#log_in_form
.modal-header
.modal-header_top.clearfix
.modal-header_top_bg
%button.round_link.close{"aria-label" => "Close", "data-dismiss" => "modal", :type => "button"}
%i.icon.icon_close
.modal-header_bot
%h3#modalLabel.modal-title Увійти
.help_text.absolute
Заповніть всі поля
.modal-body
.row
.col-sm-9.modal-body_login
%h4.modal_subtitle
Авторизація
= simple_form_for :user, url: session_path(:user), remote: true do |f|
%input{:name => "utf8", :type => "hidden", :value => "✓"}/
.form-group
%label{:for => "id_3"}
%span.asterisk>
E-mail
.field_wrap
= f.email_field :email, autofocus: true, autocomplete: "email"
%span.error_text
.form-group
%label
%span.asterisk
%label{:for => "user_password"} Password
.field_wrap
= f.password_field :password, autocomplete: "current-password"
%span.error_text
.text-center
= f.submit "Log in"
.col-sm-3.modal-body_registration
%h4.modal_subtitle
Швидка реєстрація
.soc_btn_wrap.clearfix
%a.soc_btn.soc_btn_fb{href: "/users/auth/facebook"}
%i.icon.icon_fb
%a.soc_btn.soc_btn_google{href: "/users/auth/google_oauth2"}
%i.icon.icon_google
/ = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
/ .field
/ = f.label :email
/ %br/
/ = f.email_field :email, autofocus: true, autocomplete: "email"
/ .field
/ = f.label :password
/ %br/
/ = f.password_field :password, autocomplete: "current-password"
/ - if devise_mapping.rememberable?
/ .field
/ = f.check_box :remember_me
/ = f.label :remember_me
/ .actions
/ = f.submit "Log in"
\ No newline at end of file
= simple_form_for @user, url: user_path, html: { method: :put } do |f|
= f.error_notification
.wrapper
.content
.img_line
.container
.centered_form
.pseudo_btns
%span.btn.btn_faked реєстрація
.help_text
%span.asterisk *
Поля обов'язкові для заповнення
.form_container
.horizontal_input_group
.form-group
%label{:for => "id_1"}
%span.asterisk> *
Як вас звати?
.field_wrap
= f.input_field :name, class: 'form-control'
.form-group
%label{:for => "id_2"} Nickname
.field_wrap
%input#id_2.form-control{:type => "text", :value => "V@renyk"}/
.form-group
%label{:for => "id_3"}
%span.asterisk> *
E-mail
.field_wrap
= f.input_field :email, class: 'form-control'
.form-group
%label{:for => "id_4"} Facebook
.field_wrap
%input#id_4.form-control{:type => "text", :value => "https://www.facebook.com/liubko.deresh"}/
.form-group
%label{:for => "id_5"}
Місто
.field_wrap
= f.input_field :location, class: 'form-control'
.form-group
%label{:for => "id_5"}
%span.asterisk> *
Пароль
.field_wrap
= f.password_field :password, class: 'form-control'
.form-group
%label{:for => "id_5"}
%span.asterisk> *
Підтвердження паролю
.field_wrap
= f.password_field :password_confirmation, class: 'form-control'
.form-group
%label{:for => "id_5"}
Фото або лого
.field_wrap.upload_wrap
.upload_bot.clearfix
= file_field :avatar, class: 'form-control'
.upload_img
= image_tag url_for(user.avatar) if @user.avatar
.text-center
= f.submit "Оновити", class: 'btn btn-success btn-lg'
.wrapper
.content
.img_line
.container
.centered_form
.pseudo_btns
%span.btn.btn_faked профіль користувача
.help_text
%span.asterisk *
Поля обов'язкові для заповнення
.form_container
= simple_form_for @user, url: user_path, html: { method: :put } do |f|
= f.error_notification
.form-group
%label{:for => "id_1"}
%span.asterisk> *
Як вас звати?
.field_wrap
= f.input :name, label: false, class: 'form-control'
.form-group
%label{:for => "id_3"}
%span.asterisk> *
E-mail
.field_wrap
= f.input :email,label: false, class: 'form-control'
.form-group
%label{:for => "id_5"}
Місто
.field_wrap
= f.input :location, label: false,class: 'form-control'
.form-group
%label{:for => "id_5"}
%span.asterisk> *
Пароль
.field_wrap
= f.input :password, label: false, class: 'form-control'
.form-group
%label{:for => "id_5"}
%span.asterisk> *
Підтвердження паролю
.field_wrap
= f.input :password_confirmation, label: false, class: 'form-control'
.form-group
%label{:for => "id_5"}
Фото або лого
.field_wrap.upload_wrap
.upload_bot.clearfix
= file_field :avatar, class: 'form-control'
.upload_img
= image_tag url_for(user.avatar) if @user.avatar
.text-center
= f.submit "Оновити", class: 'btn btn-success btn-lg'
......@@ -33,3 +33,4 @@
= image_tag url_for(@user.avatar)
.text-center
= link_to 'Редагувати', edit_user_path, class: 'btn btn-success btn-lg'
Rails.application.routes.draw do
root 'home#index'
devise_for :users, controllers: {omniauth_callbacks: "users/omniauth_callbacks",
registrations: "users"}
registrations: "users", sessions: "users"}
resources :users
end
......@@ -12540,7 +12540,7 @@ img.rsImg {
padding-right: 119px;
}
.form_container .form-group {
margin-bottom: 32px;
margin-bottom: 10px;
}
.form_container .checkbox {
margin-left: 171px;
......
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