scinote-web/app/views/projects/show/_experiment.html.erb

81 lines
3.2 KiB
Text
Raw Normal View History

<div class="col-md-6">
<div class="panel panel-default experiment-panel"
data-id="<%= experiment.id %>"
data-canvas-link="<%= canvas_experiment_url(experiment) %>"
>
<div class="panel-heading">
<div class="actions actions-cell table-cell pull-right">
<%= render partial: 'projects/show/experiment_actions_dropdown.html.erb', locals: { experiment: experiment, view: 'cards', project: project } %>
</div>
<div class="panel-title">
<%= link_to experiment.name, list_modules_experiment_pat(experiment) %>
</div>
2019-01-18 22:57:44 +08:00
2021-01-12 22:15:57 +08:00
<% if experiment.archived_branch? %>
<div class="panel-date">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-archive" aria-hidden="true"></span>
2021-01-12 22:15:57 +08:00
<%= l(experiment_archived_on(experiment), format: :full_date) %>
</div>
<% end %>
<div class="panel-date">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-calendar" aria-hidden="true"></span>
<%= l(experiment.created_at, format: :full_date) %> - <%= l(experiment.updated_at, format: :full_date) %>
</div>
2019-01-18 22:57:44 +08:00
<div data-hook="experiment-card-description">
<% if experiment.description? %>
<div class='experiment-description'>
<%= custom_auto_link(experiment.description, team: current_team) %>
</div>
<% else %>
<% if can_manage_experiment?(experiment) %>
<%= link_to t('experiments.edit.add-description'),
edit_experiment_url(experiment),
remote: true,
data: { id: experiment.id },
class: 'experiment-no-description' %>
<% else %>
<p class='experiment-no-description'><%= t('experiments.edit.no-description') %></p>
<% end %>
<% end %>
</div>
</div>
2019-01-18 22:57:44 +08:00
<div class="panel-body">
<% if experiment.my_modules.active.exists? %>
<%= link_to canvas_experiment_path(experiment), class: 'no-workflowimg' do %>
<% if experiment.workflowimg.attached? %>
<div class="workflowimg-container" data-workflowimg-present="true">
2022-08-31 21:26:10 +08:00
<%= render partial: 'projects/show/workflow_img', locals: { experiment: experiment } %>
</div>
<% else %>
<div class="workflowimg-container"
data-workflowimg-present="false"
data-workflowimg-url="<%= fetch_workflow_img_experiment_url(experiment) %>" >
<i class="fas fa-spinner fa-spin fa-3x workflowimg-spinner hidden" aria-hidden="true"></i>
</div>
<% end %>
<% end %>
2019-01-18 22:57:44 +08:00
<% else %>
<% if can_manage_experiment?(experiment) %>
<%= link_to( t('experiments.edit.add_task'),
canvas_experiment_path(experiment, editMode: true),
class: 'no-tasks') %>
<% else %>
<div class="no-workflowimg">
2019-01-18 22:57:44 +08:00
<p><%= t('experiments.edit.no_workflowimg') %></p>
</div>
<% end %>
2019-01-18 22:57:44 +08:00
<% end %>
<div>
<%= link_to t('experiments.index.more_link'),
experiment_path(experiment),
class: 'experiment-action-link pull-right',
remote: true %>
</div>
2019-01-18 22:57:44 +08:00
</div>
</div>
</div>