mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 06:56:54 +08:00
Merge pull request #100 from ZmagoD/zd_SCI_381
Adds experiment and team to tag search resuls [fixes SCI-381]
This commit is contained in:
commit
1b21e55fea
2 changed files with 27 additions and 0 deletions
|
@ -1,2 +1,9 @@
|
|||
module SearchHelper
|
||||
def experiments_results(tag)
|
||||
experiments = []
|
||||
tag.my_modules.each do |mod|
|
||||
experiments << mod.experiment
|
||||
end
|
||||
experiments.uniq
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,11 +25,31 @@
|
|||
<% end %>
|
||||
</span>
|
||||
<br>
|
||||
<span>
|
||||
<%=t "search.index.experiment" %>
|
||||
<% if tag.my_modules.count > 0 %>
|
||||
<% experiments_results(tag).each_with_index do |exp, i| %>
|
||||
<%= render partial: 'search/results/partials/experiment_text.html.erb',
|
||||
locals: { experiment: exp } %>
|
||||
<% #byebug %>
|
||||
<% if i != (experiments_results(tag).count - 1) %>
|
||||
,
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<br>
|
||||
<span>
|
||||
<%=t "search.index.project" %>
|
||||
<%= render partial: "search/results/partials/project_text.html.erb",
|
||||
locals: { project: tag.project } %>
|
||||
</span>
|
||||
<br>
|
||||
<span>
|
||||
<%=t "search.index.organization" %>
|
||||
<%= render partial: "search/results/partials/organization_text.html.erb",
|
||||
locals: { organization: tag.project.organization } %>
|
||||
</span>
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
|
Loading…
Reference in a new issue