fix experiment card look on Matejs request

This commit is contained in:
Mojca Lorber 2019-01-28 16:59:40 +01:00
parent d2108ac3ea
commit 089ec64398
7 changed files with 63 additions and 47 deletions

View file

@ -44,6 +44,7 @@
// click on buttonClass summons modalName dialog
modals = {
'.edit-experiment': '#edit-experiment-modal-',
'.clone-experiment': '#clone-experiment-modal-',
'.move-experiment': '#move-experiment-modal-'
};
@ -112,7 +113,7 @@
// Initialize no description edit link
function initEditNoDescription(){
var modal = "#edit-experiment-modal-";
$.each($(".experiment-no-description a"), function(){
$.each($(".experiment-no-description"), function(){
var id = modal + $(this).data("id");
initializeModal($(this), id);
});
@ -125,6 +126,9 @@
// Bind modal to big-plus new experiment actions
initializeModal('.big-plus', '#new-experiment-modal');
// Bind modal to new-exp-title action
initializeModal('.new-exp-title', '#new-experiment-modal');
// Bind modals to all clone-experiment actions
$.each($('.clone-experiment'), function() {
var id = $(this).closest('.experiment-panel').data('id');

View file

@ -14,7 +14,7 @@
var timestamp = container.data("timestamp");
var img_url = container.data('updated-img');
animateSpinner(container, true);
animateSpinner(container, true, {color: '#555', top: '60%', zIndex: '100'});
checkUpdatedImg(img_url, url, timestamp, container);
}
@ -54,6 +54,7 @@
type: "GET",
dataType: "json",
success: function (data) {
el.children("img").remove();
el.append(data.workflowimg);
},
error: function (ev) {

View file

@ -467,7 +467,8 @@ li.module-hover {
#project-show {
@media (min-width: 1400px) {
.col-md-6 {
width: 33.3333333333%;
width: 33.33%; // fallback if needed
width: calc(100% / 3);
}
}
}
@ -501,7 +502,7 @@ li.module-hover {
color: $color-silver-chalice;
}
.clone-experiment {
.panel-heading > .clone-experiment {
color: $color-silver-chalice;
padding-left: 4px;
padding-top: 2px;
@ -519,6 +520,11 @@ li.module-hover {
display: flex;
flex: 1 1 auto;
flex-direction: column;
height: 100%;
a {
height: 100%;
}
}
.experiment-description {
@ -538,33 +544,26 @@ li.module-hover {
font-weight: bold;
margin-top: 10px;
text-align: center;
a {
color: $color-alto;
text-decoration: none;
}
}
.no-workflowimg {
color: $color-alto;
display: block;
font-size: 26px;
font-size: 22px;
font-weight: bold;
margin: 15px 0;
max-height: 200px;
padding-bottom: 70px;
padding-top: 50px;
text-align: center;
a {
color: $color-alto;
text-decoration: none;
}
}
}
.workflowimg-container {
margin: 15px 0;
max-height: 200px;
align-items: center;
display: flex;
height: 100%;
justify-content: center;
img {
max-height: 190px;

View file

@ -11,6 +11,16 @@
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),
remote: true, type: 'button',
class: 'clone-experiment help_tooltips',
data: {
tooltiplink: I18n.t('tooltips.link.experiment.copy'),
tooltipcontent: I18n.t('tooltips.text.experiment.copy')
} %></li>
<% end %>
<% if can_move_experiment?(experiment) %>
<li><%= link_to t('experiments.move.label_title'),
move_modal_experiment_url(experiment),

View file

@ -38,43 +38,45 @@
<%= l(experiment.created_at, format: :full_date) %> - <%= l(experiment.updated_at, format: :full_date) %>
</span>
<div data-hook="experiment-card-body">
<div data-hook="experiment-card-description">
<% if experiment.description? %>
<div class='experiment-description'>
<%= custom_auto_link(experiment.description, team: current_team) %>
</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>
<% if can_manage_experiment?(experiment) %>
<%= link_to t('experiments.edit.add-description'),
edit_project_experiment_url(@project, 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>
<div class="panel-body">
<% if experiment.active_modules.length > 0 %>
<div class="workflowimg-container"
data-check-img="<%= updated_img_experiment_url(experiment) %>"
data-updated-img="<%= fetch_workflow_img_experiment_url(experiment) %>"
data-timestamp="<%= experiment.updated_at %>" >
</div>
<%= link_to canvas_experiment_path(experiment) do %>
<div class="workflowimg-container"
data-check-img="<%= updated_img_experiment_url(experiment) %>"
data-updated-img="<%= fetch_workflow_img_experiment_url(experiment) %>"
data-timestamp="<%= experiment.updated_at %>" >
</div>
<% end %>
<% else %>
<div class="no-workflowimg">
<% if can_manage_experiment?(experiment) %>
<p><%= link_to( t('experiments.edit.add_task'),
canvas_experiment_path(experiment,
editMode: true)) %></p>
<% else %>
<% if can_manage_experiment?(experiment) %>
<%= link_to( t('experiments.edit.add_task'),
canvas_experiment_path(experiment, editMode: true),
class: 'no-workflowimg') %>
<% else %>
<div class="no-workflowimg">
<p><%= t('experiments.edit.no_workflowimg') %></p>
<% end %>
</div>
</div>
<% end %>
<% end %>
</div>

View file

@ -1,9 +1,10 @@
<div class="col-md-6">
<div class="panel panel-default experiment-panel">
<div class="panel-heading">
<h3 class="panel-title"><%= t('experiments.new.modal_title') %></h3>
<%= link_to t('experiments.new.modal_title'),
new_project_experiment_url(@project),
remote: true,
class: 'panel-title new-exp-title' %>
</div>
<div class="panel-body">
<%= link_to new_project_experiment_url(@project),

View file

@ -1,5 +1,4 @@
<%= link_to image_tag(@experiment.workflowimg.expiring_url(
<%= image_tag(@experiment.workflowimg.expiring_url(
Constants::URL_SHORT_EXPIRE_TIME
),
class: 'img-responsive center-block'),
canvas_experiment_path(@experiment) %>
class: 'img-responsive center-block') %>