mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 05:02:50 +08:00
Add experiment thumbnail, update archived view for experiments
SCI-5481
This commit is contained in:
parent
bb93df004a
commit
6ea39c9363
4 changed files with 70 additions and 8 deletions
|
@ -93,6 +93,7 @@
|
||||||
}
|
}
|
||||||
selectedExperiments.length = 0;
|
selectedExperiments.length = 0;
|
||||||
updateExperimentsToolbar();
|
updateExperimentsToolbar();
|
||||||
|
loadExperimentWorkflowImages();
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
viewContainer.html('Error loading project list');
|
viewContainer.html('Error loading project list');
|
||||||
|
@ -261,7 +262,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function loadExperimentWorkflowImages() {
|
||||||
$('.workflowimg-container').each(function() {
|
$('.workflowimg-container').each(function() {
|
||||||
let container = $(this);
|
let container = $(this);
|
||||||
if (container.data('workflowimg-present') === false) {
|
if (container.data('workflowimg-present') === false) {
|
||||||
|
@ -280,7 +281,9 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
$('#content-wrapper').on('ajax:success', '.experiment-action-link', function(ev, data) {
|
$('#content-wrapper').on('ajax:success', '.experiment-action-link', function(ev, data) {
|
||||||
appendActionModal($(data.html));
|
appendActionModal($(data.html));
|
||||||
});
|
});
|
||||||
|
|
|
@ -61,11 +61,27 @@
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: $flyout-shadow;
|
box-shadow: $flyout-shadow;
|
||||||
|
|
||||||
.workflow-img-container {
|
.workflow-img-wrapper {
|
||||||
background-color: $color-concrete;
|
background-color: $color-concrete;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
height: 76px;
|
height: 76px;
|
||||||
width: 76px;
|
width: 76px;
|
||||||
|
|
||||||
|
.archived-icon-plceholder {
|
||||||
|
color: $color-silver-chalice;
|
||||||
|
font-size: 3.5em;
|
||||||
|
line-height: 76px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workflowimg-container {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-radius: 4px;
|
||||||
|
max-height: 76px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.experiment-name-cell {
|
.experiment-name-cell {
|
||||||
|
@ -170,11 +186,24 @@
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-img-container {
|
.workflow-img-wrapper {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
height: 3.5em;
|
height: 3.5em;
|
||||||
margin: .25em 1em .25em 0;
|
margin: .25em 1em .25em .5em;
|
||||||
width: 3.5em;
|
width: 3.5em;
|
||||||
|
|
||||||
|
.archived-icon-plceholder {
|
||||||
|
font-size: 2em;
|
||||||
|
line-height: 1.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workflowimg-container {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-height: 3em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.dates-and-img-container,
|
.dates-and-img-container,
|
||||||
|
@ -276,7 +305,7 @@
|
||||||
|
|
||||||
.cards-wrapper {
|
.cards-wrapper {
|
||||||
.card.experiment-card {
|
.card.experiment-card {
|
||||||
.workflow-img-container {
|
.workflow-img-wrapper {
|
||||||
background-color: $color-alto;
|
background-color: $color-alto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +316,13 @@
|
||||||
.description-cell {
|
.description-cell {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
.description-text::before {
|
||||||
|
background: $color-alto;
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
height: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
.description-text::after {
|
.description-text::after {
|
||||||
background: linear-gradient(to right, transparent, $color-concrete 50%);
|
background: linear-gradient(to right, transparent, $color-concrete 50%);
|
||||||
}
|
}
|
||||||
|
@ -294,11 +330,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.list {
|
&.list {
|
||||||
|
|
||||||
.card.experiment-card {
|
.card.experiment-card {
|
||||||
.archived-date-cell {
|
.archived-date-cell {
|
||||||
grid-column: 5;
|
grid-column: 5;
|
||||||
}
|
}
|
||||||
|
.description-cell {
|
||||||
|
.description-text::before {
|
||||||
|
content: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.description-text::after {
|
.description-text::after {
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="experiment-name-cell table-cell">
|
<div class="experiment-name-cell table-cell">
|
||||||
<div class="workflow-img-container" list-render="true">
|
<div class="workflow-img-wrapper" list-render="true">
|
||||||
|
<%= render partial: 'projects/show/experiment_workflow_image_container', locals: { experiment: experiment } %>
|
||||||
</div>
|
</div>
|
||||||
<% if experiment.archived_branch? %>
|
<% if experiment.archived_branch? %>
|
||||||
<%= link_to experiment.name, module_archive_experiment_path(experiment), title: experiment.name, class: 'name-link' %>
|
<%= link_to experiment.name, module_archive_experiment_path(experiment), title: experiment.name, class: 'name-link' %>
|
||||||
|
@ -50,7 +51,8 @@
|
||||||
<span class="card-value"><%= t('experiments.card.completed_value', completed: experiment.completed_task_count, all: experiment.task_count) %></span>
|
<span class="card-value"><%= t('experiments.card.completed_value', completed: experiment.completed_task_count, all: experiment.task_count) %></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="workflow-img-container" cards-render="true">
|
<div class="workflow-img-wrapper" cards-render="true">
|
||||||
|
<%= render partial: 'projects/show/experiment_workflow_image_container', locals: { experiment: experiment } %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="completed-task-cell table-cell" data-view-mode="active">
|
<div class="completed-task-cell table-cell" data-view-mode="active">
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
<% if experiment.archived_branch? %>
|
||||||
|
<div class="archived-icon-plceholder">
|
||||||
|
<i class="fas fa-archive"></i>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<% if experiment.workflowimg.attached? %>
|
||||||
|
<div class="workflowimg-container" data-workflowimg-present="true">
|
||||||
|
<%= render partial: 'projects/show/workflow_img.html.erb', 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" aria-hidden="true"></i>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
Loading…
Reference in a new issue