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
e2cac8cc
Verified
Commit
e2cac8cc
authored
Mar 26, 2018
by
Markus Koller
🦊
Browse files
Clean up find_client view
parent
5a943017
Pipeline
#16859
passed with stage
in 41 minutes and 1 second
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/assets/stylesheets/application.scss
View file @
e2cac8cc
@import
'bootstrap_custom'
;
@import
'utility'
;
@import
'bootstrap-datepicker3'
;
@import
"font-awesome"
;
@import
'jquery-ui/core'
;
@import
'jquery-ui/autocomplete'
;
@import
'jquery-ui/theme'
;
@import
'layout/navbar'
;
@import
'layout/content'
;
@import
'layout/footer'
;
@import
'layout/forms'
;
@import
'layout/print_index_table'
;
@import
'pages/assignment'
;
@import
'pages/certificate'
;
@import
'pages/performance_report'
;
@import
'pages/reminder_mailings'
;
@import
'pages/list_responses'
;
@import
'selectize'
;
@import
'selectize.bootstrap3'
;
@import
'layout/*'
;
@import
'pages/*'
;
app/assets/stylesheets/layout/_content.scss
View file @
e2cac8cc
...
...
@@ -182,3 +182,10 @@ li.button-acceptance a {
.disabled-title
{
color
:
$gray-light
;
}
.label-list
{
.label
{
display
:
inline-block
;
margin-bottom
:
0
.3em
;
}
}
app/assets/stylesheets/pages/_find_clients.scss
0 → 100644
View file @
e2cac8cc
#find-clients-table
{
overflow-y
:
auto
;
height
:
300px
;
}
app/helpers/navigation_and_button_helper.rb
View file @
e2cac8cc
...
...
@@ -41,7 +41,9 @@ module NavigationAndButtonHelper
deactivate:
{
text:
'Deaktivieren'
,
glyph:
'remove'
},
back:
{
text:
'Zurück'
,
glyph:
'arrow-left'
},
print:
{
text:
'Ausdrucken'
,
glyph:
'print'
},
download:
{
text:
'Herunterladen'
,
glyph:
'download-alt'
}
download:
{
text:
'Herunterladen'
,
glyph:
'download-alt'
},
yes:
{
text:
'Ja'
,
glyph:
'ok'
},
no:
{
text:
'Nein'
,
glyph:
'remove'
}
}
glyph_span
(
translate_glyph
[
icon_type
.
to_sym
])
end
...
...
app/models/group_offer_category.rb
View file @
e2cac8cc
...
...
@@ -6,6 +6,8 @@ class GroupOfferCategory < ApplicationRecord
CATEGORY_STATES
=
[
:active
,
:inactive
].
freeze
default_scope
{
order
(
:category_name
)
}
scope
:house_moving
,
->
{
where
(
'category_name LIKE ?'
,
'%Zürich%'
)
}
scope
:active
,
->
{
where
(
category_state: :active
)
}
scope
:active_without_house_moving
,
->
{
active
.
where
.
not
(
'category_name LIKE ?'
,
'%Zürich%'
)
}
...
...
app/views/assignments/find_client.html.slim
View file @
e2cac8cc
...
...
@@ -4,25 +4,14 @@ h1= @volunteer.contact.full_name
=
render
'volunteers/show_excerpt'
,
volunteer:
@volunteer
h3
=
t_attr
(
:single_accompaniment
,
Volunteer
)
.table-responsive
table
.table.table-striped
thead
tr
-
Volunteer
::
SINGLE_ACCOMPANIMENTS
.
each
do
|
single
|
th
.text-center
=
t_attr
(
single
)
tbody
tr
-
Volunteer
::
SINGLE_ACCOMPANIMENTS
.
each
do
|
single
|
td
.text-center
-
if
@volunteer
.
read_attribute
(
single
)
i
.glyphicon.glyphicon-ok.text-success
-
else
i
.glyphicon.glyphicon-remove.text-danger
=
render
'availability/show'
,
available:
@volunteer
.row
.col-xs-6
=
render
'volunteers/single_accompaniments'
,
volunteer:
@volunteer
.col-xs-6
h3
=
t_attr
(
:availability
,
Volunteer
)
=
render
'availability/show'
,
available:
@volunteer
h
1
=
t
(
'clients_need_accompanying'
)
h
3
=
t
(
'clients_need_accompanying'
)
nav
.navbar.section-navigation
ul
.list-inline
...
...
@@ -30,12 +19,11 @@ nav.navbar.section-navigation
li
=
render
'age_request_select'
li
=
render
'language_skills_language_select'
=
bootstrap_paginate
(
@need_accompanying
)
.table-responsive
#find-clients-table
.table-responsive
table
.table.table-striped
thead
tr
th
.hidden-print
Aktionen
th
=
sort_link
@q
,
:salutation
,
t_attr
(
:salutation
,
Client
)
th
=
sort_link
@q
,
:contact_last_name
,
t_attr
(
:full_name
,
Contact
)
th
=
sort_link
@q
,
:contact_city
,
t_attr
(
:address
,
Client
)
...
...
@@ -48,10 +36,12 @@ nav.navbar.section-navigation
th
=
sort_link
@q
,
:created_at
,
t_attr
(
:created_at
,
Client
)
th
=
sort_link
@q
,
:gender_request
,
t_attr
(
:gender_request
,
Client
)
th
=
sort_link
@q
,
:age_request
,
t_attr
(
:age_request
,
Client
)
th
colspan
=
'2'
tbody
-
@need_accompanying
.
each
do
|
client
|
tr
td
.index-action-cell.hidden-print
=
button_link
navigation_glyph
(
:show
),
client
,
title:
'Anzeigen'
=
button_link
t
(
'reserve'
),
new_assignment_url
(
client_id:
client
,
volunteer_id:
@volunteer
)
td
=
t
(
"salutation.
#{
client
.
salutation
}
"
)
if
client
.
salutation?
td
=
client
.
contact
.
full_name
td
=
client
.
contact
.
full_address
...
...
@@ -70,7 +60,5 @@ nav.navbar.section-navigation
td
=
l
(
client
.
created_at
.
to_date
)
td
=
t
(
"gender_request.
#{
client
.
gender_request
}
"
)
if
client
.
gender_request
.
present?
td
=
t
(
"age_request.
#{
client
.
age_request
}
"
)
if
client
.
age_request
.
present?
td
=
button_link
t_action
(
:show
),
client
td
=
button_link
t
(
'reserve'
),
new_assignment_url
(
client_id:
client
,
volunteer_id:
@volunteer
)
=
bootstrap_paginate
(
@need_accompanying
)
app/views/availability/_show.html.slim
View file @
e2cac8cc
.table-responsive
table
.table.table-striped
thead
tr
-
availability_collection
.
each
do
|
availability
|
th
.text-center
=
t
(
"availability.
#{
availability
}
"
)
tbody
tr
-
availability_collection
.
each
do
|
availability
|
td
.text-center
-
if
available
.
read_attribute
(
availability
)
i
.glyphicon.glyphicon-ok.text-success
-
else
i
.glyphicon.glyphicon-remove.text-danger
h4
.label-list
-
availability_collection
.
each
do
|
availability
|
-
if
available
.
read_attribute
(
availability
)
span
.label.label-success
>
=
>
navigation_glyph
(
:yes
)
=
t
(
"availability.
#{
availability
}
"
)
-
else
span
.label.label-danger
>
=
>
navigation_glyph
(
:no
)
=
t
(
"availability.
#{
availability
}
"
)
-
if
available
.
detailed_description?
.table-responsive
table
.table.table-no-border-top
tbody
tr
td
=
t
(
"availability.detailed_description"
)
td
=
available
.
detailed_description
.row
.col-xs-12
strong
=
t
(
"availability.detailed_description"
)
'
:
-
if
available
.
detailed_description?
=
available
.
detailed_description
-
else
em
keine
app/views/volunteers/_show_excerpt.html.slim
View file @
e2cac8cc
...
...
@@ -3,6 +3,7 @@
thead
tr
th
=
t_attr
(
:title
,
Contact
)
th
=
t_attr
(
:full_name
,
Volunteer
)
th
=
t_attr
(
:city
,
Contact
)
th
=
t_attr
(
:postal_code
,
Contact
)
th
=
t_attr
(
:primary_email
,
Contact
)
...
...
@@ -12,7 +13,6 @@
th
=
t_attr
(
:education
,
Volunteer
)
th
=
t_attr
(
:profession
,
Volunteer
)
th
=
t_attr
(
:working_percent
,
Volunteer
)
th
=
t_attr
(
:expectations
,
Volunteer
)
th
=
t_attr
(
:interests
,
Volunteer
)
th
=
t_attr
(
:external
,
Volunteer
)
...
...
@@ -24,11 +24,11 @@
td
=
volunteer
.
contact
.
postal_code
td
=
volunteer
.
contact
.
primary_email
td
=
volunteer
.
birth_year
.
year
if
volunteer
.
birth_year?
td
=
volunteer
.
language_skills
.
first
.
language_name
if
volunteer
.
language_skills
.
any?
td
=
render
'language_skills/show_inline'
,
language_skills:
volunteer
.
language_skills
td
=
volunteer
.
native_language
&
.
language_name
td
=
render
'language_skills/show_inline'
,
language_skills
:
volunteer
.foreign_languages
td
=
volunteer
.
education
td
=
volunteer
.
profession
td
#{
volunteer
.
working_percent
}
%
td
=
volunteer
.
expectations
td
=
volunteer
.
interests
td
=
volunteer
.
external?
?
t_attr
(
:external
)
:
t_attr
(
:internal
)
td
=
volunteer
.
external?
?
t_attr
(
:external
,
Volunteer
)
:
t_attr
(
:internal
,
Volunteer
)
app/views/volunteers/_single_accompaniments.html.slim
0 → 100644
View file @
e2cac8cc
h3
=
t_attr
(
:single_accompaniment
,
Volunteer
)
h4
.label-list
-
Volunteer
::
SINGLE_ACCOMPANIMENTS
.
each
do
|
key
|
-
if
volunteer
.
read_attribute
(
key
)
span
.label.label-success
>
=
>
navigation_glyph
(
:yes
)
=
t_attr
(
key
,
Volunteer
)
-
else
span
.label.label-danger
>
=
>
navigation_glyph
(
:no
)
=
t_attr
(
key
,
Volunteer
)
app/views/volunteers/show.html.slim
View file @
e2cac8cc
...
...
@@ -137,50 +137,46 @@ h2.small Persönlicher Hintergrund
td
=
t_attr
(
:additional_comments
)
td
=
@volunteer
.
additional_comments
h2
.small
=
t_attr
(
:single_accompaniment
)
.table-responsive
table
.table.table-striped
thead
tr
-
Volunteer
::
SINGLE_ACCOMPANIMENTS
.
each
do
|
single
|
th
.text-center
=
t_attr
(
single
)
tbody
tr
-
@volunteer
.
slice
(
Volunteer
::
SINGLE_ACCOMPANIMENTS
).
values
.
each
do
|
value
|
td
.text-center
=
boolean_glyph
(
value
)
.table-responsive
table
.table.table-striped
thead
tr
-
@volunteer
.
group_accompaniments_house_moving
.
each
do
|
group
|
th
.text-center
.row
.col-xs-6
=
render
'volunteers/single_accompaniments'
,
volunteer:
@volunteer
.col-xs-6
h3
=
t_attr
(
:availability
,
Volunteer
)
=
render
'availability/show'
,
available:
@volunteer
h3
=
t_attr
(
:group_accompaniment
)
h4
.label-list
.row
.col-xs-12
-
@volunteer
.
group_accompaniments_active_without_house_moving
.
each
do
|
group
|
-
if
group
[
:value
]
span
.label.label-success
>
=
>
navigation_glyph
(
:yes
)
=
t_attr
(
group
[
:title
])
tbody
tr
-
@volunteer
.
group_accompaniments_house_moving
.
each
do
|
group
|
td
.text-center
=
boolean_glyph
(
group
[
:value
])
h2
.small
=
t_attr
(
:group_accompaniment
)
.table-responsive
table
.table.table-striped
thead
tr
-
@volunteer
.
group_accompaniments_active_without_house_moving
.
each
do
|
group
|
th
.text-center
-
else
span
.label.label-danger
>
=
>
navigation_glyph
(
:no
)
=
t_attr
(
group
[
:title
])
.row
.col-xs-12
-
@volunteer
.
group_accompaniments_house_moving
.
each
do
|
group
|
-
if
group
[
:value
]
span
.label.label-success
>
=
>
navigation_glyph
(
:yes
)
=
t_attr
(
group
[
:title
])
-
else
span
.label.label-danger
>
=
>
navigation_glyph
(
:no
)
=
t_attr
(
group
[
:title
])
tbody
tr
-
@volunteer
.
group_accompaniments_active_without_house_moving
.
each
do
|
group
|
td
.text-center
=
boolean_glyph
(
group
[
:value
])
-
if
@volunteer
.
other_offer_desc?
tr
td
=
t_attr
(
:other_offer_desc
)
td
=
@volunteer
.
other_offer_desc
h2
.small
=
t
(
'.availability'
)
=
render
'availability/show'
,
available:
@volunteer
.row
.col-xs-12
strong
=
t_attr
(
:other_offer_desc
)
'
:
-
if
@volunteer
.
other_offer_desc?
=
@volunteer
.
other_offer_desc
-
else
em
keine
-
if
@volunteer
.
assignments
.
unterminated
.
any?
h2
.small
#assignments
Aktuelle
Begleitungen
...
...
config/locales/de.yml
View file @
e2cac8cc
...
...
@@ -243,7 +243,6 @@ de:
<<
:
[
*id-volunteers-index
]
acceptance
:
*id-volunteer-acceptance
state
:
*id-volunteer-active-states
availability
:
Verfügbarkeit
group_assignments
:
Aktuelle Gruppenangebote
hour_reports
:
Stunden Rapporte
new_certificate
:
Nachweis ausstellen
...
...
@@ -440,6 +439,7 @@ de:
additional_nationality
:
Zusätzliche Nationalität
additional_phone_numbers
:
Zusätzliche Telefonnummern
assignment_count
:
Anzahl begleitungen
availability
:
Verfügbarkeit
external
:
Extern
internal
:
Intern
available
:
Verfügbar
...
...
@@ -638,7 +638,7 @@ de:
client_destroyed
:
Klient/in wurde erfolgreich gelöscht.
client_updated
:
Klient/in wurde erfolgreich aktualisiert.
clients_xlsx
:
Klienten
clients_need_accompanying
:
Klienten ohne Begleitung
clients_need_accompanying
:
Klient
/inn
en ohne Begleitung
contact_info
:
Kontakt Informationen
contacts
:
fields
:
...
...
test/factories/group_offer_categories.rb
View file @
e2cac8cc
FactoryBot
.
define
do
factory
:group_offer_category
do
sequence
:category_name
do
|
n
|
"category
#{
n
}
"
end
category_name
{
FFaker
::
Skill
.
specialty
}
category_state
'active'
end
end
test/system/profiles_test.rb
View file @
e2cac8cc
...
...
@@ -40,12 +40,17 @@ class ProfilesTest < ApplicationSystemTestCase
@user_without_profile
.
reload
assert
page
.
has_current_path?
profile_path
(
@user_without_profile
.
profile
)
assert
page
.
has_text?
'Hans'
assert
page
.
has_text?
'Muster'
refute
page
.
has_selector?
(
'table > tbody td:nth-child(1) i.glyphicon-ok'
)
assert
page
.
has_selector?
(
'table > tbody td:nth-child(2) i.glyphicon-ok'
)
assert
page
.
has_selector?
(
'table > tbody td:nth-child(3) i.glyphicon-remove'
)
assert
page
.
has_text?
'Profil wurde erfolgreich erstellt.'
assert_text
'Profil wurde erfolgreich erstellt.'
assert_text
'Hans'
assert_text
'Muster'
assert_text
'Nein Flexibel'
assert_text
'Ja Morgens'
assert_text
'Nein Nachmittags'
assert_text
'Nein Abends'
assert_text
'Nein Werktags'
assert_text
'Nein Wochenende'
end
test
'when_profile_created_it_can_be_displayed'
do
...
...
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