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

add responsibility fillter to list_responses

parent a35a2aa7
......@@ -53,7 +53,7 @@
.index-action-cell {
white-space: nowrap;
a {
a, span {
display: block;
margin-right: 2px;
}
......
......@@ -6,6 +6,7 @@ class ListResponsesController < ApplicationController
@q = Feedback.created_asc.author_volunteer(params[:q]).ransack(params[:q])
@q.sorts = ['updated_at asc'] if @q.sorts.empty?
@feedbacks = @q.result.paginate(page: params[:page])
set_responsibles
end
def trial_feedbacks
......@@ -14,4 +15,21 @@ class ListResponsesController < ApplicationController
@q.sorts = ['updated_at asc'] if @q.sorts.empty?
@trial_feedbacks = @q.result.paginate(page: params[:page])
end
private
def set_responsibles
@responsibles = Feedback.joins(responsible: [profile: [:contact]])
.author_volunteer(params[:q])
.where(reviewer_id: nil)
.distinct
.select('users.id, contacts.full_name')
.map do |responsible|
{
q: :responsible_id_eq,
text: "Übernommen von #{responsible.full_name}",
value: responsible.id
}
end
end
end
......@@ -8,6 +8,10 @@ nav.navbar.section-navigation.hidden-print
= custom_filter_dropdown('Geprüft',
{ q: :reviewer_id_not_null, text: 'Angeschaut', value: 'true' },
{ q: :reviewer_id_null, text: 'Ungesehen', value: 'true' })
= custom_filter_dropdown('Übernommen',
{ q: :responsible_id_null, text: 'Offen', value: 'true' },
{ q: :responsible_id_not_null, text: 'Übernommen', value: 'true' },
*@responsibles)
= custom_filter_dropdown('Autor',
{ q: :author_volunteer, text: 'Freiwillige/r', value: 'true' },
{ q: :author_volunteer, text: 'AOZ', value: 'false' })
......
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