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
5f27e6ee
Commit
5f27e6ee
authored
Oct 17, 2017
by
Kaspar Vollenweider
👻
Committed by
Kaspar
Oct 20, 2017
Browse files
feierabend - formes more fine tuned and it starts to work, more or less
parent
f825ebe1
Changes
10
Hide whitespace changes
Inline
Side-by-side
app/controllers/feedbacks_controller.rb
View file @
5f27e6ee
...
...
@@ -21,7 +21,7 @@ class FeedbacksController < ApplicationController
volunteer_id:
@volunteer
.
id
))
authorize
@feedback
if
@feedback
.
save
redirect_to
url_for
([
@feedback
.
feedbackable
,
@feedback
]),
make_notice
redirect_to
url_for
([
@feedback
.
volunteer
,
@feedback
]),
make_notice
else
render
:new
end
...
...
@@ -29,7 +29,7 @@ class FeedbacksController < ApplicationController
def
update
if
@feedback
.
update
(
feedback_params
)
redirect_to
url_for
([
@feedback
able
,
@feedback
]),
make_notice
redirect_to
url_for
([
@feedback
.
volunteer
,
@feedback
]),
make_notice
else
render
:edit
end
...
...
app/policies/volunteer_policy.rb
View file @
5f27e6ee
...
...
@@ -29,4 +29,5 @@ class VolunteerPolicy < ApplicationPolicy
alias_method
:can_manage?
,
:superadmin?
alias_method
:acceptance?
,
:superadmin?
alias_method
:checklist?
,
:superadmin?
alias_method
:state?
,
:superadmin?
end
app/views/feedbacks/_form.html.slim
View file @
5f27e6ee
...
...
@@ -2,8 +2,8 @@
=
simple_form_for
[
@feedbackable
,
@feedback
]
do
|
f
|
=
simple_error_notice
f
=
f
.
hidden_field
:feedbackable_id
,
value:
@feedbackable
=
f
.
hidden_field
:feedbackable_type
,
value:
@feedbackable
=
f
.
hidden_field
:feedbackable_id
,
value:
@feedbackable
.
id
=
f
.
hidden_field
:feedbackable_type
,
value:
@feedbackable
.
class
=
render
'main_fields'
,
f:
f
-
else
...
...
app/views/feedbacks/edit.html.slim
View file @
5f27e6ee
.row
.col-xs-12
h1
=
t_title
(
:edit
)
h1
=
t_title
(
:edit
)
=
render
'form'
=
form_navigation_btn
:
back
=
bootstrap_row_col
{
button_link
t
(
'back'
),
volunteer_feedback_path
(
@volunteer
,
@feed
back
)
}
app/views/feedbacks/index.html.slim
View file @
5f27e6ee
h1
=
t_title
table
.table.table-striped
thead
tr
th
=
t_model
(
Volunteer
)
th
=
t_
model
(
Client
)
th
=
t_
attr
(
:feedback_activity
,
Feedback
)
th
=
t_attr
(
:goals
,
Feedback
)
th
=
t_attr
(
:achievements
,
Feedback
)
th
=
t_attr
(
:future
,
Feedback
)
...
...
@@ -19,19 +18,17 @@ table.table.table-striped
td
=
link_to
record
.
volunteer
.
contact
.
full_name
,
volunteer_path
(
record
.
volunteer
)
td
-
if
record
.
assignment?
=
link_to
record
.
feedbackable
.
client
.
contact
.
full_name
,
client_path
(
record
.
feedbackable
.
client
)
=
link_to
record
.
feedbackable
.
to_label
,
client_path
(
record
.
feedbackable
.
client
)
-
else
=
link_to
record
.
feedbackable
.
group_offer
.
to_label
,
group_offer_path
(
record
.
feedbackable
)
=
link_to
record
.
feedbackable
.
to_label
,
group_offer_path
(
record
.
feedbackable
)
td
=
record
.
goals
td
=
record
.
achievements
td
=
record
.
future
td
=
record
.
comments
td
=
t
(
record
.
conversation
)
td
=
link_to
t_action
(
:show
),
url_for
([
@
feedback
_
ab
out
,
record
])
td
=
link_to
t_action
(
:edit
),
url_for
([
@
feedback
_
ab
out
,
record
])
+
'/edit'
td
=
link_to
t_action
(
:destroy
),
url_for
([
@
feedback
_
ab
out
,
record
]),
confirm_deleting
(
record
)
td
=
link_to
t_action
(
:show
),
url_for
([
record
.
feedbackab
le
,
record
])
td
=
link_to
t_action
(
:edit
),
url_for
([
record
.
feedbackab
le
,
record
])
+
'/edit'
td
=
link_to
t_action
(
:destroy
),
url_for
([
record
.
feedbackab
le
,
record
]),
confirm_deleting
(
record
)
=
form_navigation_btn
:new
.row
.col-xs-12
=
button_link
t
(
'back'
),
@feedbacked
=
bootstrap_row_col
{
button_link
t
(
'back'
),
volunteer_path
(
params
[
:volunteer_id
])
}
app/views/feedbacks/new.html.slim
View file @
5f27e6ee
.row
.col-xs-12
h1
=
t_title
(
:new
)
h1
=
t_title
(
:new
)
=
render
'form'
=
form_navigation_btn
:back
=
bootstrap_row_col
{
button_link
t
(
'back'
),
volunteer_feedbacks_path
(
@volunteer
)
}
app/views/feedbacks/show.html.slim
View file @
5f27e6ee
.table-responsive
h1
=
t_title
(
:show
)
.table-responsive.m-t-30.m-b-20
table
.table.table-no-border-top
tbody
tr
td
=
t_model
(
Volunteer
)
td
=
@feedback
.
volunteer
.
contact
.
full_name
tr
-
if
@feedback
.
assignment?
td
=
link_to
@feedback
.
volunteer
.
contact
.
full_name
,
volunteer_path
(
@feedback
.
volunteer
)
-
if
@feedback
.
assignment?
tr
td
=
t_model
(
Assignment
)
td
=
link_to
@feedback
.
feedbackable
.
to_label
,
assignment_path
(
@feedback
.
feedbackable
)
tr
td
=
t_model
(
Client
)
td
=
@feedback
.
feedbackable
.
client
.
contact
.
full_name
-
else
td
=
link_to
@feedback
.
feedbackable
.
client
.
contact
.
full_name
,
client_path
(
@feedback
.
feedbackable
.
client
)
-
else
tr
td
=
t_model
(
GroupOffer
)
td
=
@feedback
.
feedbackable
.
to_label
tr
td
=
t_attr
(
:goals
)
td
=
@feedback
.
goals
tr
td
=
t_attr
(
:achievements
)
td
=
@feedback
.
achievements
tr
td
=
t_attr
(
:future
)
td
=
@feedback
.
future
tr
td
=
t_attr
(
:comments
)
td
=
@feedback
.
comments
td
=
link_to
@feedback
.
feedbackable
.
to_label
,
group_offer_path
(
@feedback
.
feedbackable
)
-
[
:goals
,
:achievements
,
:future
,
:comments
].
each
do
|
field
|
tr
td
=
t_attr
(
field
)
td
=
@feedback
[
field
]
tr
td
=
t_attr
(
:conversation
)
td
=
t
(
@feedback
.
conversation
)
=
form_navigation_btn
:edit
=
form_navigation_btn
:back
=
bootstrap_row_col
{
button_link
t
(
'back'
),
volunteer_feedbacks_path
(
@volunteer
)
}
app/views/volunteers/show.html.slim
View file @
5f27e6ee
.row
.col-xs-12
h1
=
@volunteer
.
contact
.
full_name
h1
=
@volunteer
.
contact
.
full_name
nav
.navbar.section-navigation
ul
.list-inline
...
...
@@ -29,7 +27,7 @@ nav.navbar.section-navigation
li
=
button_link
current_user
.
volunteer?
?
t
(
'edit_profile'
)
:
t_title
(
:edit
),
edit_volunteer_path
(
@volunteer
)
li
=
form_navigation_btn
:back
,
with_row:
false
unless
current_user
.
volunteer?
-
if
policy
(
Volunteer
).
c
an_manage
?
-
if
policy
(
Volunteer
).
c
hecklist
?
h3
=
t
(
'checklist'
)
.table-responsive
table
.table.table-no-border-top
...
...
@@ -100,10 +98,11 @@ h3= t('personal_background')
tr
td
=
t_attr
(
:interests
)
td
=
@volunteer
.
interests
-
if
policy
(
Volunteer
).
can_manag
e?
-
if
policy
(
Volunteer
).
acceptanc
e?
tr
td
=
t_attr
(
:acceptance
)
td
=
t
(
".acceptance.
#{
@volunteer
.
acceptance
}
"
)
-
if
policy
(
Volunteer
).
state?
tr
td
=
t_attr
(
:state
)
td
=
t
(
"state.
#{
@volunteer
.
state
}
"
)
...
...
@@ -183,4 +182,5 @@ h3= t('.availability')
nav
.navbar.section-navigation
ul
.list-inline
li
=
button_link
current_user
.
volunteer?
?
t
(
'edit_profile'
)
:
t_title
(
:edit
),
edit_volunteer_path
(
@volunteer
)
li
=
form_navigation_btn
:back
,
with_row:
false
-
if
policy
(
Volunteer
).
index?
li
=
form_navigation_btn
:back
,
with_row:
false
config/locales/de.yml
View file @
5f27e6ee
...
...
@@ -235,6 +235,8 @@ de:
future
:
Soll der Einsatz weiterlaufen und wenn ja, mit welchen Inhalten (Zielen)?
goals
:
Was waren die wichtigsten Inhalte (oder Ziele) Ihres Einsatzes in den letzten Monaten?
last
:
Letzter inhaltlicher Journaleintrag am
feedback_activity
:
Aktivität
feedbackable_id_and_type
:
Aktivitäten
billing_expense
:
<<
:
*id-generic_keys
amount
:
Betrag
...
...
config/locales/en.yml
View file @
5f27e6ee
...
...
@@ -220,6 +220,7 @@ en:
future
:
Should the assignment continue? If yes, with which goals?
goals
:
Which were the most important goals during the last months?
last
:
Last assignment journal entry
feedbackable_id_and_type
:
Activities
certificate
:
duration
:
Duration
duration_end
:
End
...
...
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