From b837e0084c445203b60d25b967c5e533f4c2987b Mon Sep 17 00:00:00 2001 From: Chris Lawton <chris.lawton@torchbox.com> Date: Thu, 14 Jun 2018 12:49:42 +0100 Subject: [PATCH] truncate project title via textwrap as opposed to css --- opentech/apply/funds/tables.py | 5 +++++ .../src/sass/apply/components/_all-submissions.scss | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/opentech/apply/funds/tables.py b/opentech/apply/funds/tables.py index 5104a52ce..077523fd2 100644 --- a/opentech/apply/funds/tables.py +++ b/opentech/apply/funds/tables.py @@ -1,3 +1,5 @@ +import textwrap + from django import forms from django.contrib.auth import get_user_model from django.db.models import OuterRef, Subquery, F, Q @@ -47,6 +49,9 @@ class SubmissionsTable(tables.Table): def render_user(self, value): return value.get_full_name() + def render_title(self, value): + return textwrap.shorten(value, width=30, placeholder="...") + def render_phase(self, value): return mark_safe(f'<span>{ value }</span>') diff --git a/opentech/static_src/src/sass/apply/components/_all-submissions.scss b/opentech/static_src/src/sass/apply/components/_all-submissions.scss index 56fd0c87a..6d863dc8d 100644 --- a/opentech/static_src/src/sass/apply/components/_all-submissions.scss +++ b/opentech/static_src/src/sass/apply/components/_all-submissions.scss @@ -79,11 +79,6 @@ $table-breakpoint: 'tablet-portrait'; font-weight: $weight--bold; @include media-query($table-breakpoint) { - padding-top: 20px; - padding-left: 20px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; &::before { position: absolute; -- GitLab