From 036857979935915be133a62758aa745201f10363 Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Tue, 16 Feb 2021 12:42:09 +0100 Subject: [PATCH] Update experiment card css [SCI-5469] --- app/assets/stylesheets/experiments.scss | 18 ++++++++++++++---- .../projects/show/_experiment_card.html.erb | 6 +++--- config/initializers/constants.rb | 2 ++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/experiments.scss b/app/assets/stylesheets/experiments.scss index 106bf5a7b..62ba7c52c 100644 --- a/app/assets/stylesheets/experiments.scss +++ b/app/assets/stylesheets/experiments.scss @@ -167,6 +167,7 @@ } .workflow-img-container { + flex-shrink: 0; height: 3.5em; margin: .25em 1em .25em 0; width: 3.5em; @@ -191,6 +192,10 @@ height: 100%; margin: 0; padding: .25em 0; + + a { + overflow: hidden; + } } .start-date-cell { @@ -209,13 +214,18 @@ grid-column: 6; position: relative; - .description-text::after { - bottom: 1.5em; - right: .5em; + .description-text { + height: 4.5em; + -webkit-line-clamp: 3; + + &::after { + bottom: .5em; + right: .5em; + } } .more-button { - bottom: 1.9em; + bottom: .5em; } } diff --git a/app/views/projects/show/_experiment_card.html.erb b/app/views/projects/show/_experiment_card.html.erb index ebc229e5a..ecd4a2a1e 100644 --- a/app/views/projects/show/_experiment_card.html.erb +++ b/app/views/projects/show/_experiment_card.html.erb @@ -19,9 +19,9 @@
<% if experiment.archived_branch? %> - <%= link_to experiment.name, module_archive_experiment_path(experiment), title: experiment.name %> + <%= link_to experiment.name, module_archive_experiment_path(experiment), title: experiment.name, class: 'name-link' %> <% else %> - <%= link_to experiment.name, canvas_experiment_path(experiment), title: experiment.name %> + <%= link_to experiment.name, canvas_experiment_path(experiment), title: experiment.name, class: 'name-link' %> <% end %>
@@ -70,7 +70,7 @@
<%= custom_auto_link(experiment.description, team: current_team) %>
- <% if experiment.description.present? %> + <% if experiment.description.present? && experiment.description.length > Constants::EXPERIMENT_LONG_DESCRIPTION %> <%= link_to t('experiments.card.more'), experiment_path(experiment), class: 'more-button experiment-action-link', diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index 337c9e469..321960990 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -66,6 +66,8 @@ class Constants ATWHO_REP_NAME_LIMIT = 16 # Results limited query/display elements for pages RESULTS_PER_PAGE_LIMIT = 10 + #Experiments more button appears + EXPERIMENT_LONG_DESCRIPTION = 80 #============================================================================= # File and data memory size