Commit 5f27e6ee authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻 Committed by Kaspar
Browse files

feierabend - formes more fine tuned and it starts to work, more or less

parent f825ebe1
......@@ -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([@feedbackable, @feedback]), make_notice
redirect_to url_for([@feedback.volunteer, @feedback]), make_notice
else
render :edit
end
......
......@@ -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
......@@ -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
......
.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, @feedback) }
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_about, record])
td= link_to t_action(:edit), url_for([@feedback_about, record]) + '/edit'
td= link_to t_action(:destroy), url_for([@feedback_about, record]), confirm_deleting(record)
td= link_to t_action(:show), url_for([record.feedbackable, record])
td= link_to t_action(:edit), url_for([record.feedbackable, record]) + '/edit'
td= link_to t_action(:destroy), url_for([record.feedbackable, 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]) }
.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) }
.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) }
.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).can_manage?
- if policy(Volunteer).checklist?
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_manage?
- if policy(Volunteer).acceptance?
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
......@@ -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
......
......@@ -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
......
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