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:
Zmago Devetak 2016-08-25 15:43:50 +02:00 committed by GitHub
commit 1b21e55fea
2 changed files with 27 additions and 0 deletions

View file

@ -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

View file

@ -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) %>
,&nbsp;
<% 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>