46 lines
2.5 KiB
Plaintext
46 lines
2.5 KiB
Plaintext
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.table.sortable.mt-4
|
|
thead
|
|
tr
|
|
th
|
|
i class="fa fa-lightbulb-o" aria-hidden="true" title = t('request_for_comments.solved') align="right"
|
|
th = sort_link(@search, :title, t('activerecord.attributes.request_for_comments.exercise'))
|
|
th = t('activerecord.attributes.request_for_comments.question')
|
|
th
|
|
i class="fa fa-comment" aria-hidden="true" title = t('request_for_comments.comments') align="center"
|
|
th = t('activerecord.attributes.request_for_comments.username')
|
|
th = t('activerecord.attributes.request_for_comments.requested_at')
|
|
th = t('activerecord.attributes.request_for_comments.last_update')
|
|
tbody
|
|
- @request_for_comments.each do |request_for_comment|
|
|
tr data-id=request_for_comment.id
|
|
- if request_for_comment.solved?
|
|
td
|
|
span class="fa fa-check" aria-hidden="true"
|
|
- elsif request_for_comment.full_score_reached
|
|
td
|
|
span class="fa fa-check" style="color:darkgrey" aria-hidden="true"
|
|
- else
|
|
td = ''
|
|
td = link_to(request_for_comment.exercise.title, request_for_comment)
|
|
- if request_for_comment.has_attribute?(:question) && request_for_comment.question
|
|
td = truncate(request_for_comment.question, length: 200)
|
|
- else
|
|
td = '-'
|
|
td = request_for_comment.comments_count
|
|
td = link_to_if(request_for_comment.user && policy(request_for_comment.user).show?, request_for_comment.user.displayname, request_for_comment.user)
|
|
td = t('shared.time.before', time: distance_of_time_in_words_to_now(request_for_comment.created_at))
|
|
td = t('shared.time.before', time: distance_of_time_in_words_to_now(request_for_comment.last_comment.nil? ? request_for_comment.updated_at : request_for_comment.last_comment))
|
|
|
|
= render('shared/pagination', collection: @request_for_comments)
|