Verified Commit b23208c7 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

rename Angeschaut to Quittiert and feedback redirect back also respects page parameter

parent 58421bdb
...@@ -3,6 +3,8 @@ class FeedbacksController < ApplicationController ...@@ -3,6 +3,8 @@ class FeedbacksController < ApplicationController
only: [:show, :edit, :update, :destroy, :mark_as_done, :take_responsibility] only: [:show, :edit, :update, :destroy, :mark_as_done, :take_responsibility]
before_action :set_feedbackable before_action :set_feedbackable
before_action :set_volunteer before_action :set_volunteer
before_action :set_list_response_feedback_redirect_back_path,
only: [:mark_as_done, :take_responsibility]
def index def index
authorize Feedback authorize Feedback
...@@ -49,11 +51,11 @@ class FeedbacksController < ApplicationController ...@@ -49,11 +51,11 @@ class FeedbacksController < ApplicationController
end end
def mark_as_done def mark_as_done
redirect_path = list_responses_feedbacks_path(params.to_unsafe_hash.slice(:q))
if @feedback.update(reviewer: current_user) if @feedback.update(reviewer: current_user)
redirect_to(redirect_path, notice: 'Halbjahres-Rapport quittiert.') redirect_to(@redirect_back_path, notice: 'Halbjahres-Rapport quittiert.')
else else
redirect_to(redirect_path, notice: 'Fehler: Quittieren fehlgeschlagen.') redirect_to(@redirect_back_path, notice: 'Fehler: Quittieren fehlgeschlagen.')
end
end end
def take_responsibility def take_responsibility
...@@ -65,6 +67,13 @@ class FeedbacksController < ApplicationController ...@@ -65,6 +67,13 @@ class FeedbacksController < ApplicationController
end end
private private
def set_list_response_feedback_redirect_back_path
@redirect_back_path = list_responses_feedbacks_path(
params.to_unsafe_hash.slice(:q, :page)
)
end
def simple_form_params def simple_form_params
@simple_form_for_params = [ @simple_form_for_params = [
[@volunteer, @feedbackable, @feedback], { [@volunteer, @feedbackable, @feedback], {
......
...@@ -6,8 +6,8 @@ nav.navbar.section-navigation.hidden-print ...@@ -6,8 +6,8 @@ nav.navbar.section-navigation.hidden-print
ul.list-inline ul.list-inline
li= clear_filter_button li= clear_filter_button
= custom_filter_dropdown('Geprüft', = custom_filter_dropdown('Geprüft',
{ q: :reviewer_id_not_null, text: 'Angeschaut', value: 'true' }, { q: :reviewer_id_not_null, text: 'Quittiert', value: 'true' },
{ q: :reviewer_id_null, text: 'Ungesehen', value: 'true' }) { q: :reviewer_id_null, text: 'Unquittiert', value: 'true' })
= custom_filter_dropdown('Übernommen', = custom_filter_dropdown('Übernommen',
{ q: :responsible_id_null, text: 'Offen', value: 'true' }, { q: :responsible_id_null, text: 'Offen', value: 'true' },
{ q: :responsible_id_not_null, text: 'Übernommen', value: 'true' }, { q: :responsible_id_not_null, text: 'Übernommen', value: 'true' },
...@@ -60,9 +60,7 @@ table.table.table-striped.list-responses-table ...@@ -60,9 +60,7 @@ table.table.table-striped.list-responses-table
td.index-action-cell td.index-action-cell
span= I18n.l record.created_at.to_date span= I18n.l record.created_at.to_date
- if record.reviewer.present? - if record.reviewer.present?
span span Quittiert von: #{link_to(record.reviewer.email, record.reviewer)}
= "Angeschaut von: "
= link_to record.reviewer.email, record.reviewer
td.index-action-cell.hidden-print td.index-action-cell.hidden-print
- if record.responsible.present? - if record.responsible.present?
= 'Übernommen durch ' = 'Übernommen durch '
...@@ -76,7 +74,9 @@ table.table.table-striped.list-responses-table ...@@ -76,7 +74,9 @@ table.table.table-striped.list-responses-table
- if record.reviewer.present? - if record.reviewer.present?
= link_to 'Anzeigen', polymorphic_path([record.volunteer, record.feedbackable, record]) = link_to 'Anzeigen', polymorphic_path([record.volunteer, record.feedbackable, record])
- else - else
= link_to 'Angeschaut', polymorphic_path([record.volunteer, record.feedbackable, record], action: :mark_as_done, q: search_parameters), { method: :put, class: 'btn btn-default btn-xs m-t-10' } = link_to 'Quittieren', polymorphic_path([record.volunteer, record.feedbackable, record],
action: :mark_as_done, q: search_parameters),
{ method: :put, class: 'btn btn-default btn-xs m-t-10' }
= bootstrap_paginate(@feedbacks) = bootstrap_paginate(@feedbacks)
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