adds datahook to experiment card [fixes SCI-2373]

This commit is contained in:
zmagod 2018-06-06 17:28:04 +02:00
parent 9b9143f145
commit 43a60b632a
3 changed files with 20 additions and 16 deletions

View file

@ -10,6 +10,7 @@
data: { id: experiment.id },
class: 'edit-experiment' %></li>
<% end %>
<li data-hook="experiment-actions-second-child"></li>
<% if can_clone_experiment?(experiment) %>
<li><%= link_to t('experiments.clone.label_title'),
clone_modal_experiment_url(experiment),

View file

@ -55,3 +55,4 @@
<%= javascript_include_tag("experiments/dropdown_actions") %>
<%= javascript_include_tag("projects/show") %>
<i data-hook="project-show-js"></i>

View file

@ -43,22 +43,24 @@
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
<%= localize(experiment.created_at, format: t('time.formats.full_date')) %> - <%= localize(experiment.updated_at, format: t('time.formats.full_date')) %>
</span>
<% if experiment.description? %>
<div class='experiment-description'>
<%= custom_auto_link(experiment.description) %>
</div>
<% else %>
<span class='experiment-no-description'>
<% if can_manage_experiment?(experiment) %>
<%= link_to t('experiments.edit.add-description'),
edit_project_experiment_url(@project, experiment),
remote: true,
data: { id: experiment.id } %>
<% else %>
<p><%= t('experiments.edit.no-description') %></p>
<% end %>
</span>
<% end %>
<div data-hook="experiment-card-body">
<% if experiment.description? %>
<div class='experiment-description'>
<%= custom_auto_link(experiment.description) %>
</div>
<% else %>
<span class='experiment-no-description'>
<% if can_manage_experiment?(experiment) %>
<%= link_to t('experiments.edit.add-description'),
edit_project_experiment_url(@project, experiment),
remote: true,
data: { id: experiment.id } %>
<% else %>
<p><%= t('experiments.edit.no-description') %></p>
<% end %>
</span>
<% end %>
</div>
</div>
</div>
</div>