added a search for request_for_comments.
fixed translation of model for request_for_comments
This commit is contained in:
@ -11,7 +11,8 @@ class RequestForCommentsController < ApplicationController
|
|||||||
# GET /request_for_comments
|
# GET /request_for_comments
|
||||||
# GET /request_for_comments.json
|
# GET /request_for_comments.json
|
||||||
def index
|
def index
|
||||||
@request_for_comments = RequestForComment.last_per_user(2).order('created_at DESC').paginate(page: params[:page])
|
@search = RequestForComment.last_per_user(2).search(params[:q])
|
||||||
|
@request_for_comments = @search.result.order('created_at DESC').paginate(page: params[:page])
|
||||||
authorize!
|
authorize!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -8,6 +8,10 @@ class RequestForCommentPolicy < ApplicationPolicy
|
|||||||
everyone
|
everyone
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def search?
|
||||||
|
everyone
|
||||||
|
end
|
||||||
|
|
||||||
def show?
|
def show?
|
||||||
everyone
|
everyone
|
||||||
end
|
end
|
||||||
|
@ -1,12 +1,20 @@
|
|||||||
h1 = RequestForComment.model_name.human(count: 2)
|
h1 = RequestForComment.model_name.human(count: 2)
|
||||||
|
|
||||||
|
= render(layout: 'shared/form_filters') do |f|
|
||||||
|
.form-group
|
||||||
|
= f.label(:exercise_title_cont, t('activerecord.attributes.request_for_comments.exercise'), class: 'sr-only')
|
||||||
|
= f.search_field(:exercise_title_cont, class: 'form-control', placeholder: t('activerecord.attributes.request_for_comments.exercise'))
|
||||||
|
.form-group
|
||||||
|
= f.label(:title_cont, t('request_for_comments.solved'), class: 'sr-only')
|
||||||
|
= f.select(:solved_not_eq, [[t('request_for_comments.show_all'), 2], [t('request_for_comments.show_unsolved'), 1], [t('request_for_comments.show_solved'), 0]])
|
||||||
|
|
||||||
.table-responsive
|
.table-responsive
|
||||||
table.table.sortable
|
table.table.sortable
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
th
|
th
|
||||||
i class="fa fa-lightbulb-o" aria-hidden="true" title = t('request_for_comments.solved') align="right"
|
i class="fa fa-lightbulb-o" aria-hidden="true" title = t('request_for_comments.solved') align="right"
|
||||||
th = t('activerecord.attributes.request_for_comments.exercise')
|
th = sort_link(@search, :title, t('activerecord.attributes.request_for_comments.exercise'))
|
||||||
th = t('activerecord.attributes.request_for_comments.question')
|
th = t('activerecord.attributes.request_for_comments.question')
|
||||||
th
|
th
|
||||||
i class="fa fa-comment" aria-hidden="true" title = t('request_for_comments.comments') align="center"
|
i class="fa fa-comment" aria-hidden="true" title = t('request_for_comments.comments') align="center"
|
||||||
|
@ -146,6 +146,9 @@ de:
|
|||||||
internal_user:
|
internal_user:
|
||||||
one: Interner Nutzer
|
one: Interner Nutzer
|
||||||
other: Interne Nutzer
|
other: Interne Nutzer
|
||||||
|
request_for_comment:
|
||||||
|
one: Kommentaranfrage
|
||||||
|
other: Kommentaranfragen
|
||||||
submission:
|
submission:
|
||||||
one: Abgabe
|
one: Abgabe
|
||||||
other: Abgaben
|
other: Abgaben
|
||||||
@ -417,6 +420,9 @@ de:
|
|||||||
all: "Alle Kommentaranfragen"
|
all: "Alle Kommentaranfragen"
|
||||||
no_question: "Der Autor hat keine Frage zu dieser Anfrage gestellt."
|
no_question: "Der Autor hat keine Frage zu dieser Anfrage gestellt."
|
||||||
mark_as_solved: "Diese Frage als beantwortet markieren"
|
mark_as_solved: "Diese Frage als beantwortet markieren"
|
||||||
|
show_all: "Alle Anfragen anzeigen"
|
||||||
|
show_solved: "Nur gelöste Anfragen anzeigen"
|
||||||
|
show_unsolved: "Nur ungelöste Anfragen anzeigen"
|
||||||
solved: "Diese Frage wurde erfolgreich beantwortet"
|
solved: "Diese Frage wurde erfolgreich beantwortet"
|
||||||
comment_exercise: "Ich möchte die Aufgabenstellung kommentieren"
|
comment_exercise: "Ich möchte die Aufgabenstellung kommentieren"
|
||||||
sessions:
|
sessions:
|
||||||
|
@ -167,6 +167,9 @@ en:
|
|||||||
internal_user:
|
internal_user:
|
||||||
one: Internal User
|
one: Internal User
|
||||||
other: Internal Users
|
other: Internal Users
|
||||||
|
request_for_comment:
|
||||||
|
one: Request for Comments
|
||||||
|
other: Requests for Comments
|
||||||
submission:
|
submission:
|
||||||
one: Submission
|
one: Submission
|
||||||
other: Submissions
|
other: Submissions
|
||||||
@ -438,6 +441,9 @@ en:
|
|||||||
get_my_comment_requests: My Requests for Comments
|
get_my_comment_requests: My Requests for Comments
|
||||||
no_question: "The author did not enter a question for this request."
|
no_question: "The author did not enter a question for this request."
|
||||||
mark_as_solved: "Mark this question as answered"
|
mark_as_solved: "Mark this question as answered"
|
||||||
|
show_all: "All requests"
|
||||||
|
show_solved: "Solved requests"
|
||||||
|
show_unsolved: "Unvsolved requests"
|
||||||
solved: "This question has been answered"
|
solved: "This question has been answered"
|
||||||
comment_exercise: "I would like to give feedback for this exercise"
|
comment_exercise: "I would like to give feedback for this exercise"
|
||||||
sessions:
|
sessions:
|
||||||
|
Reference in New Issue
Block a user