2016-02-12 23:52:43 +08:00
|
|
|
<% results.each do |comment| %>
|
|
|
|
|
|
|
|
<p>
|
2018-05-22 22:55:58 +08:00
|
|
|
<span class="fas fa-comment"></span>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% if comment.is_a?(ProjectComment) && comment.project.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<%=t "search.index.comments.project" %>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% elsif comment.is_a?(TaskComment) && comment.my_module.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<%=t "search.index.comments.my_module" %>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% elsif comment.is_a?(StepComment) && comment.step.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<%=t "search.index.comments.step" %>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% elsif comment.is_a?(ResultComment) && comment.result.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<%=t "search.index.comments.result" %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
<div class="row">
|
|
|
|
<p class="chat-bubble col-xs-4">
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= highlight comment.message, @search_query.strip.split(/\s+/) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<p>
|
|
|
|
<span>
|
|
|
|
<%=t "search.index.created_by" %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= highlight comment.user.full_name, @search_query.strip.split(/\s+/) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<br>
|
|
|
|
<span>
|
|
|
|
<%=t "search.index.created_at" %>
|
|
|
|
<%=l comment.created_at, format: :full %>
|
|
|
|
</span>
|
|
|
|
<br>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% if comment.is_a?(ProjectComment) && comment.project.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<span>
|
|
|
|
<%=t "search.index.project" %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= render partial: "search/results/partials/project_text.html.erb",
|
2017-03-08 20:18:20 +08:00
|
|
|
locals: { project: comment.project, link_to_page: :root } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% elsif comment.is_a?(TaskComment) && comment.my_module.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<span>
|
|
|
|
<%=t "search.index.module" %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<%= render partial: "search/results/partials/my_module_text.html.erb",
|
2017-03-08 20:18:20 +08:00
|
|
|
locals: { my_module: comment.my_module, link_to_page: :canvas } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% elsif comment.is_a?(StepComment) && comment.step.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<span>
|
|
|
|
<%=t "search.index.step" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/step_text.html.erb",
|
2017-03-08 20:18:20 +08:00
|
|
|
locals: { step: comment.step, target: :comment } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
2017-03-08 20:18:20 +08:00
|
|
|
<% elsif comment.is_a?(ResultComment) && comment.result.present? %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<span>
|
|
|
|
<%=t "search.index.result" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/result_text.html.erb",
|
2017-03-08 20:18:20 +08:00
|
|
|
locals: { result: comment.result, target: :comment } %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<hr>
|
2016-07-26 18:59:37 +08:00
|
|
|
<% end %>
|