Commit 25e3d00d authored by Tugce Nur Tas's avatar Tugce Nur Tas Committed by Tuğçe Nur Taş
Browse files

replace gender with salutation

parent b90c6a39
......@@ -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
......
......@@ -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,
......
class Client < ApplicationRecord
include LanguageAndScheduleReferences
include GenderCollection
include SalutationCollection
include YearCollection
include BuildContactRelation
......
module GenderCollection
module SalutationCollection
extend ActiveSupport::Concern
included do
def self.gender_collection
[:female, :male]
def self.salutation_collection
[:mrs, :mr]
end
end
end
class Volunteer < ApplicationRecord
include LanguageAndScheduleReferences
include GenderCollection
include SalutationCollection
include BuildContactRelation
include YearCollection
......
- 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'
......
- 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})
- 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})
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)
......@@ -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)
......
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
......
......@@ -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)
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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?
......
......@@ -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"
......
......@@ -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
......
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
......
......@@ -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?
......
Supports Markdown
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