Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
25e3d00d
Commit
25e3d00d
authored
Jul 25, 2017
by
Tugce Nur Tas
Committed by
Tuğçe Nur Taş
Jul 26, 2017
Browse files
replace gender with salutation
parent
b90c6a39
Changes
28
Hide whitespace changes
Inline
Side-by-side
app/controllers/clients_controller.rb
View file @
25e3d00d
...
...
@@ -58,7 +58,7 @@ class ClientsController < ApplicationController
def
client_params
params
.
require
(
:client
).
permit
(
:entry_year
,
:gender_request
,
:age_request
,
:other_request
,
:birth_year
,
:
gender
,
:nationality
,
:permit
,
:goals
,
:education
,
:interests
,
:
salutation
,
:nationality
,
:permit
,
:goals
,
:education
,
:interests
,
:state
,
:comments
,
:involved_authority
,
:competent_authority
,
:actual_activities
,
language_skills_attributes
,
relatives_attributes
,
schedules_attributes
,
contact_attributes
...
...
app/controllers/concerns/volunteer_attributes.rb
View file @
25e3d00d
...
...
@@ -4,7 +4,7 @@ module VolunteerAttributes
included
do
def
volunteer_attributes
[
:birth_year
,
:
gender
,
:avatar
,
:nationality
,
:additional_nationality
,
:birth_year
,
:
salutation
,
:avatar
,
:nationality
,
:additional_nationality
,
:profession
,
:education
,
:motivation
,
:experience
,
:expectations
,
:strengths
,
:skills
,
:interests
,
:state
,
:duration
,
:man
,
:woman
,
:family
,
:kid
,
:sport
,
:creative
,
:music
,
:culture
,
:training
,
...
...
app/models/client.rb
View file @
25e3d00d
class
Client
<
ApplicationRecord
include
LanguageAndScheduleReferences
include
Gender
Collection
include
Salutation
Collection
include
YearCollection
include
BuildContactRelation
...
...
app/models/concerns/
gender
_collection.rb
→
app/models/concerns/
salutation
_collection.rb
View file @
25e3d00d
module
Gender
Collection
module
Salutation
Collection
extend
ActiveSupport
::
Concern
included
do
def
self
.
gender
_collection
[
:
female
,
:m
ale
]
def
self
.
salutation
_collection
[
:
mrs
,
:m
r
]
end
end
end
app/models/volunteer.rb
View file @
25e3d00d
class
Volunteer
<
ApplicationRecord
include
LanguageAndScheduleReferences
include
Gender
Collection
include
Salutation
Collection
include
BuildContactRelation
include
YearCollection
...
...
app/views/assignments/_gender_request_select.html.slim
View file @
25e3d00d
-
gender_request_filter
=
request_filter
(
:gender_request_cont
,
'all'
)
.btn-group
button
.btn.btn-default.dropdown-toggle
type
=
'button'
data-toggle
=
'dropdown'
aria-label
=
"#{t_attr(:
gender
_request)}"
aria-haspopup
=
'true'
aria-expanded
=
'false'
class
=
"btn-md"
button
.btn.btn-default.dropdown-toggle
type
=
'button'
data-toggle
=
'dropdown'
aria-label
=
"#{t_attr(:
salutation
_request)}"
aria-haspopup
=
'true'
aria-expanded
=
'false'
class
=
"btn-md"
=
"
#{
t_attr
(
:gender_request
,
Client
)
}
: "
=
t
(
gender_request_filter
,
scope:
[
:simple_form
,
:options
,
:client
,
:gender_request
])
+
' '
span
.caret
aria-hidden
=
'true'
...
...
app/views/assignments/_gender_select.html.slim
deleted
100644 → 0
View file @
b90c6a39
-
gender_filter
=
params
[
:q
]
&&
params
[
:q
][
:gender_cont
].
present?
?
params
[
:q
][
:gender_cont
]
:
'all'
.btn-group
button
.btn.btn-default.dropdown-toggle
type
=
'button'
data-toggle
=
'dropdown'
aria-label
=
"#{t_attr(:gender)}"
aria-haspopup
=
'true'
aria-expanded
=
'false'
class
=
"btn-md"
=
"
#{
t_attr
(
:gender
,
Volunteer
)
}
: "
=
t
(
gender_filter
,
scope:
[
:simple_form
,
:options
,
:volunteer
,
:gender
])
+
' '
span
.caret
aria-hidden
=
'true'
ul
.dropdown-menu
li
=
link_to
t
(
'all'
),
params
.
permit!
.
to_h
.
deep_merge
(
q:
{
gender_matches:
''
})
-
Volunteer
.
gender_collection
.
each
do
|
s
|
li
=
link_to
t
(
s
.
to_s
,
scope:
[
:simple_form
,
:options
,
:volunteer
,
:gender
]),
params
.
permit!
.
to_h
.
deep_merge
(
q:
{
gender_matches:
s
})
app/views/assignments/_salutation_select.html.slim
0 → 100644
View file @
25e3d00d
-
salutation_filter
=
params
[
:q
]
&&
params
[
:q
][
:salutation_cont
].
present?
?
params
[
:q
][
:salutation_cont
]
:
'all'
.btn-group
button
.btn.btn-default.dropdown-toggle
type
=
'button'
data-toggle
=
'dropdown'
aria-label
=
"#{t_attr(:salutation)}"
aria-haspopup
=
'true'
aria-expanded
=
'false'
class
=
"btn-md"
=
"
#{
t_attr
(
:salutation
,
Volunteer
)
}
: "
=
t
(
salutation_filter
,
scope:
[
:simple_form
,
:options
,
:volunteer
,
:salutation
])
+
' '
span
.caret
aria-hidden
=
'true'
ul
.dropdown-menu
li
=
link_to
t
(
'all'
),
params
.
permit!
.
to_h
.
deep_merge
(
q:
{
salutation_matches:
''
})
-
Volunteer
.
salutation_collection
.
each
do
|
s
|
li
=
link_to
t
(
s
.
to_s
,
scope:
[
:simple_form
,
:options
,
:volunteer
,
:salutation
]),
params
.
permit!
.
to_h
.
deep_merge
(
q:
{
salutation_matches:
s
})
app/views/assignments/_without_client.html.slim
0 → 100644
View file @
25e3d00d
tr
td
=
without_client
.
contact
.
full_name
td
=
t
(
"salutation.
#{
without_client
.
salutation
}
"
)
if
without_client
.
salutation
.
present?
td
=
nationality_name
(
without_client
.
nationality
)
td
=
nationality_name
(
without_client
.
additional_nationality
)
td
=
without_client
.
contact
.
city
td
=
without_client
.
contact
.
postal_code
td
-
without_client
.
language_skills
.
each
do
|
language
|
=
language
.
full_language_skills
td
=
without_client
.
motivation
td
=
Volunteer
.
human_boolean
(
without_client
.
experience
)
td
=
t
(
"duration.
#{
without_client
.
duration
}
"
)
if
without_client
.
duration
.
present?
td
-
Volunteer
.
single_accompaniment
.
each
do
|
single
|
-
if
without_client
[
single
]
=
t
(
"activerecord.attributes.volunteer.
#{
single
}
"
)
br
td
-
Volunteer
.
group_accompaniment
.
each
do
|
group
|
-
if
without_client
[
group
]
=
t
(
"activerecord.attributes.volunteer.
#{
group
}
"
)
br
td
=
button_link
t_action
(
:show
),
volunteer_path
(
without_client
)
td
=
button_link
t
(
'reserve'
),
new_assignment_url
(
client_id:
client
,
volunteer_id:
without_client
.
id
)
app/views/assignments/find_volunteer.html.slim
View file @
25e3d00d
...
...
@@ -31,7 +31,7 @@
h1
=
t
(
'available_volunteers'
)
.filters
=
render
partial:
'
gender
_select'
,
locals:
{
client:
@client
.
id
}
=
render
partial:
'
salutation
_select'
,
locals:
{
client:
@client
.
id
}
=
render
partial:
'duration_select'
,
locals:
{
client:
@client
.
id
}
.row
...
...
@@ -40,7 +40,7 @@
thead
tr
th
=
sort_link
@q
,
:contact_last_name
,
t_attr
(
:full_name
,
Volunteer
)
th
=
sort_link
@q
,
:
gender
,
t_attr
(
:gender
,
Volunteer
)
th
=
sort_link
@q
,
:
salutation
,
t_attr
(
:salutation
,
Volunteer
)
th
=
sort_link
@q
,
:nationality
,
t_attr
(
:nationality
,
Volunteer
)
th
=
sort_link
@q
,
:additional_nationality
,
t_attr
(
:additional_nationality
,
Volunteer
)
th
=
sort_link
@q
,
:contact_city
,
t_attr
(
:city
,
Volunteer
)
...
...
app/views/clients/_client.html.slim
View file @
25e3d00d
tr
td
=
t
(
"
gender.
#{
client
.
gender
}
"
)
unless
client
.
gender
.
blank?
td
=
t
(
"
salutation.
#{
client
.
salutation
}
"
)
unless
client
.
salutation
.
blank?
td
=
client
.
contact
.
full_name
td
=
client
.
contact
.
full_address
td
=
client
.
birth_year
.
year
if
client
.
birth_year
...
...
app/views/clients/_columns.html.slim
View file @
25e3d00d
...
...
@@ -3,7 +3,7 @@
table
.table.table-striped
thead
tr
th
=
t_attr
(
:
gender
,
Client
)
th
=
t_attr
(
:
salutation
,
Client
)
th
=
t_attr
(
:full_name
,
Client
)
th
=
t_attr
(
:address
,
Client
)
th
=
t_attr
(
:birth_year
,
Client
)
...
...
app/views/clients/_form.html.slim
View file @
25e3d00d
...
...
@@ -13,8 +13,8 @@
include_blank:
true
.col-xs-12.col-md-6
=
f
.
input
:
gender
,
collection:
Client
.
gender
_collection
,
=
f
.
input
:
salutation
,
collection:
Client
.
salutation
_collection
,
as: :radio_buttons
,
wrapper: :vertical_radio_and_checkboxes
.row
...
...
app/views/clients/show.html.slim
View file @
25e3d00d
...
...
@@ -13,10 +13,10 @@
td
=
t_attr
(
:birth_year
)
td
=
@client
.
birth_year
.
try
(
:year
)
tr
td
=
t_attr
(
:
gender
)
td
=
t_attr
(
:
salutation
)
td
-
if
@client
.
gender
.
present?
=
t
(
"
gender
.
#{
@client
.
gender
}
"
)
-
if
@client
.
salutation
.
present?
=
t
(
"
salutation
.
#{
@client
.
salutation
}
"
)
tr
td
=
t_attr
(
:nationality
)
td
=
nationality_name
(
@client
.
nationality
)
...
...
app/views/contacts/_fields.slim
View file @
25e3d00d
...
...
@@ -2,9 +2,8 @@
-
if
f
.
object
.
department?
.col-xs-12.col-md-6
=
f
.
input
:last_name
,
required:
true
,
label:
t
(
'.name'
)
-
else
.col-xs-12.col-md-2
=
f
.
input
:title
.col-xs-12.col-md-5
=
f
.
input
:first_name
,
required:
true
.col-xs-12.col-md-5
=
f
.
input
:last_name
,
label:
t
(
'.last_name'
)
.col-xs-12.col-md-6
=
f
.
input
:first_name
,
required:
true
.col-xs-12.col-md-6
=
f
.
input
:last_name
,
label:
t
(
'.last_name'
)
.row
.col-xs-12
...
...
app/views/volunteer_mailer/welcome_email.html.slim
View file @
25e3d00d
...
...
@@ -44,8 +44,8 @@ h4= "#{t_attr(:birth_year, Volunteer)}: "
p
=
l
(
@volunteer
.
birth_year
)
if
@volunteer
.
birth_year
h4
=
"
#{
t_attr
(
:
gender
,
Volunteer
)
}
: "
p
=
t
(
"
gender
.
#{
@volunteer
.
gender
}
"
)
if
@volunteer
.
gender
.
present?
h4
=
"
#{
t_attr
(
:
salutation
,
Volunteer
)
}
: "
p
=
t
(
"
salutation
.
#{
@volunteer
.
salutation
}
"
)
if
@volunteer
.
salutation
.
present?
h4
=
"
#{
t_attr
(
:avatar
,
Volunteer
)
}
: "
p
=
image_tag
@volunteer
.
avatar
.
url
(
:thumb
)
if
@volunteer
.
avatar
.
present?
...
...
app/views/volunteer_mailer/welcome_email.text.slim
View file @
25e3d00d
...
...
@@ -40,9 +40,9 @@
-
if
@volunteer
.
birth_year
.
present?
=
"
#{
rn2
}#{
t_attr
(
:birth_year
,
Volunteer
)
}
:
#{
t3
}#{
l
(
@volunteer
.
birth_year
)
}
\r\n
"
-
if
@volunteer
.
gender
.
present?
=
"
\r\n
#{
t_attr
(
:
gender
,
Volunteer
)
}
:
#{
t3
}
"
=
t
(
"
gender
.
#{
@volunteer
.
gender
}
"
)
if
@volunteer
.
gender
.
present?
-
if
@volunteer
.
salutation
.
present?
=
"
\r\n
#{
t_attr
(
:
salutation
,
Volunteer
)
}
:
#{
t3
}
"
=
t
(
"
salutation
.
#{
@volunteer
.
salutation
}
"
)
if
@volunteer
.
salutation
.
present?
-
if
@volunteer
.
avatar
.
present?
=
"
#{
rn2
}#{
t_attr
(
:avatar
,
Volunteer
)
}
:
\t\t
"
...
...
app/views/volunteers/_form.html.slim
View file @
25e3d00d
...
...
@@ -8,7 +8,12 @@
=
f
.
input
:rejection_type
,
collection:
Volunteer
.
rejection_collection
,
as: :radio_buttons
.col-xs-12
=
f
.
input
:rejection_text
.row
.col-xs-12
=
f
.
input
:salutation
,
as: :select
,
collection:
Volunteer
.
salutation_collection
,
include_blank:
true
=
f
.
simple_fields_for
:contact
do
|
c
|
=
render
'contacts/fields'
,
f:
c
...
...
@@ -18,10 +23,6 @@
as: :select
,
collection:
Client
.
year_collection
,
include_blank:
true
.col-xs-12.col-md-6
=
f
.
input
:gender
,
collection:
Volunteer
.
gender_collection
,
as: :radio_buttons
.row
.col-xs-12
=
f
.
input
:avatar
,
as: :file
...
...
app/views/volunteers/_volunteer.html.slim
View file @
25e3d00d
tr
td
=
volunteer
.
contact
.
title
td
=
t
(
"salutation.
#{
volunteer
.
salutation
}
"
)
unless
volunteer
.
salutation
.
blank?
-
if
action_name
==
'index'
td
=
volunteer
.
contact
.
full_name
td
=
volunteer
.
contact
.
city
...
...
app/views/volunteers/show.html.slim
View file @
25e3d00d
...
...
@@ -18,8 +18,8 @@
td
=
t_attr
(
:birth_year
)
td
=
l
(
@volunteer
.
birth_year
)
if
@volunteer
.
birth_year
tr
td
=
t_attr
(
:
gender
)
td
=
t
(
"
gender
.
#{
@volunteer
.
gender
}
"
)
if
@volunteer
.
gender
.
present?
td
=
t_attr
(
:
salutation
)
td
=
t
(
"
salutation
.
#{
@volunteer
.
salutation
}
"
)
if
@volunteer
.
salutation
.
present?
tr
td
=
t_attr
(
:avatar
)
td
=
image_tag
@volunteer
.
avatar
.
url
(
:thumb
)
if
@volunteer
.
avatar
.
present?
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
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