Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warm_city
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mykhailo Makohin
warm_city
Commits
14065b26
Commit
14065b26
authored
Sep 18, 2019
by
Mykhailo Makohin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish registration
parent
f8b7ff2c
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
100 additions
and
33 deletions
+100
-33
grid_item_first.png
app/assets/images/grid_item_first.png
+0
-0
plus.svg
app/assets/images/plus.svg
+2
-0
tip_img1.png
app/assets/images/tip_img1.png
+0
-0
application_controller.rb
app/controllers/application_controller.rb
+1
-0
users_controller.rb
app/controllers/users_controller.rb
+3
-6
user.rb
app/models/user.rb
+10
-1
index.html.haml
app/views/home/index.html.haml
+3
-3
_black_header.html.haml
app/views/partials/_black_header.html.haml
+1
-1
_modal.html.haml
app/views/partials/_modal.html.haml
+68
-2
edit.html.haml
app/views/users/edit.html.haml
+9
-18
show.html.haml
app/views/users/show.html.haml
+1
-0
routes.rb
config/routes.rb
+1
-1
main.css
vendor/assets/stylesheets/main.css
+1
-1
No files found.
app/assets/images/grid_item_first.png
0 → 100644
View file @
14065b26
16.6 KB
app/assets/images/plus.svg
0 → 100644
View file @
14065b26
<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
app/assets/images/tip_img1.png
0 → 100644
View file @
14065b26
11.3 KB
app/controllers/application_controller.rb
View file @
14065b26
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
skip_before_filter
:verify_authenticity_token
end
app/controllers/users_controller.rb
View file @
14065b26
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
)
els
if
els
e
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
...
...
@@ -59,5 +58,4 @@ class UsersController < ApplicationController
params
.
require
(
:user
).
permit
(
:email
,
:name
,
:location
,
:password
,
:password_confirmation
)
end
end
\ No newline at end of file
app/models/user.rb
View file @
14065b26
...
...
@@ -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
app/views/home/index.html.haml
View file @
14065b26
...
...
@@ -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
...
...
@@ -596,7 +596,7 @@
.map_text
Етнічна, в першу чергу релігійна та мовно-культурна спільнота або сукупність індивидів, які існують зберігаються за межами свого регіону
#map
.map
%a
.btn.btn_default.btn_round.btn_bordered
{
"data-original-title"
=>
"долучитись"
,
"data-placement"
=>
"top"
,
"data-t
oggle"
=>
"tooltip"
,
:href
=>
"#"
}
%a
.btn.btn_default.btn_round.btn_bordered
{
"data-original-title"
=>
"долучитись"
,
"data-placement"
=>
"top"
,
"data-t
arget"
=>
"#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
=>
"#"
}
...
...
app/views/partials/_black_header.html.haml
View file @
14065b26
...
...
@@ -45,7 +45,7 @@
-
unless
current_user
.login_wrap
%div
%button
.login_btn
{
"data-target"
=>
"#modal
3
"
,
"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"
}
/
...
...
app/views/partials/_modal.html.haml
View file @
14065b26
...
...
@@ -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
app/views/users/edit.html.haml
View file @
14065b26
=
simple_form_for
@user
,
url:
user_path
,
html:
{
method: :put
}
do
|
f
|
=
f
.
error_notification
.wrapper
.wrapper
.content
.img_line
.container
.centered_form
.pseudo_btns
%span
.btn.btn_faked
реєстрація
%span
.btn.btn_faked
профіль користувача
.help_text
%span
.asterisk
*
Поля обов'язкові для заповнення
.form_container
.horizontal_input_group
=
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_field
:name
,
class:
'form-control'
.form-group
%label
{
:for
=>
"id_2"
}
Nickname
.field_wrap
%input
#id_2
.form-control
{
:type
=>
"text"
,
:value
=>
"V@renyk"
}
/
=
f
.
input
:name
,
label:
false
,
class:
'form-control'
.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"
}
/
=
f
.
input
:email
,
label:
false
,
class:
'form-control'
.form-group
%label
{
:for
=>
"id_5"
}
Місто
.field_wrap
=
f
.
input_field
:location
,
class:
'form-control'
=
f
.
input
:location
,
label:
false
,
class:
'form-control'
.form-group
%label
{
:for
=>
"id_5"
}
%span
.asterisk
>
*
Пароль
.field_wrap
=
f
.
password_field
:password
,
class:
'form-control'
=
f
.
input
:password
,
label:
false
,
class:
'form-control'
.form-group
%label
{
:for
=>
"id_5"
}
%span
.asterisk
>
*
Підтвердження паролю
.field_wrap
=
f
.
password_field
:password_confirmation
,
class:
'form-control'
=
f
.
input
:password_confirmation
,
label:
false
,
class:
'form-control'
.form-group
%label
{
:for
=>
"id_5"
}
Фото або лого
...
...
app/views/users/show.html.haml
View file @
14065b26
...
...
@@ -33,3 +33,4 @@
=
image_tag
url_for
(
@user
.
avatar
)
.text-center
=
link_to
'Редагувати'
,
edit_user_path
,
class:
'btn btn-success btn-lg'
config/routes.rb
View file @
14065b26
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
vendor/assets/stylesheets/main.css
View file @
14065b26
...
...
@@ -12540,7 +12540,7 @@ img.rsImg {
padding-right
:
119px
;
}
.form_container
.form-group
{
margin-bottom
:
32
px
;
margin-bottom
:
10
px
;
}
.form_container
.checkbox
{
margin-left
:
171px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment