<%= t('page.sort_by') -%>: <%- if params[:sort_by].blank? -%> <%= t('question.last_answered_at') -%> <%- else -%> <%= link_to t('question.last_answered_at'), url_for(params.merge(sort_by: nil, only_path: true)) -%> <%- end -%> <%- if params[:sort_by] == 'created_at' -%> <%= t('question.created_at') -%> <%- else -%> <%= link_to t('question.created_at'), url_for(params.merge(sort_by: 'created_at', only_path: true)) -%> <%- end -%> <%- if params[:sort_by] == 'answers_count' -%> <%= t('activerecord.attributes.question.answers_count') -%> <%- else -%> <%= link_to t('activerecord.attributes.question.answers_count'), url_for(params.merge(sort_by: 'answers_count', only_path: true)) -%> <%- end -%>
<%- if @count[:query_result] > 0 -%>Id | <%= t('activerecord.models.question') -%> | ||
---|---|---|---|
<%= question.id -%> |
<%= link_to truncate(question.body, length: 60), question -%>
(<%= link_to question.user.username, question.user.profile if question.user.try(:profile) -%>)
<%= t('question.last_answered_at') %>: <%= l(question.answers.last.updated_at) if question.answers.last -%> |
<%= link_to image_tag('icons/comments.png', alt: t('answer.count'), size: '16x16'), question %> <%= link_to question.answers.size, question -%> <%- if question.solved %> <%= t('question.solved') %> <% else %> <%= t('question.not_solved') %> <% end %> | <%- if can? :update, question -%> <%= link_to t('page.edit'), edit_question_path(question) -%> <% end %> <%- if can? :delete, question -%> <%= link_to t('page.destroy'), question, data: {confirm: t('page.are_you_sure')}, method: :delete -%> <%- end -%> |
<%= t('question.no_record_found') -%>
<%- end -%> <%= paginate(@questions, remote: true) -%>