Date: Thu, 9 Jun 2016 11:05:54 +0100
Subject: [PATCH 6/7] =?UTF-8?q?Truncate=20items=20that=20don=E2=80=99t=20f?=
=?UTF-8?q?it=20in=20the=20first=20column?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The first column of a table is a heading, and will always be 50% wide.
It makes the table harder to scan when the information in the first
column breaks onto multiple lines, and introduces uneven whitespace in
the table.
This commit adds some CSS to force things in the first column to only
ever be one line. If they are too long to fit, they get truncated with
an ellipsis (`…`)
---
app/assets/stylesheets/components/table.scss | 12 ++++++++++--
app/assets/stylesheets/views/dashboard.scss | 4 ++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/app/assets/stylesheets/components/table.scss b/app/assets/stylesheets/components/table.scss
index 45a86e33e..05079605f 100644
--- a/app/assets/stylesheets/components/table.scss
+++ b/app/assets/stylesheets/components/table.scss
@@ -1,6 +1,7 @@
.table {
margin-bottom: $gutter;
width: 100%;
+ table-layout: fixed;
}
.table-heading {
@@ -16,11 +17,14 @@
.table-row {
th {
+ display: table-cell;
width: 52.5%;
font-weight: normal;
- a {
- max-height: 1.25em;
+ .hint {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
}
}
@@ -101,6 +105,10 @@
.table-field-heading {
+ &-first {
+ width: 52.5%;
+ }
+
&:last-child {
padding-right: 0;
}
diff --git a/app/assets/stylesheets/views/dashboard.scss b/app/assets/stylesheets/views/dashboard.scss
index 04c2cc622..6069a8f20 100644
--- a/app/assets/stylesheets/views/dashboard.scss
+++ b/app/assets/stylesheets/views/dashboard.scss
@@ -58,6 +58,10 @@
&-filename {
@include bold-19;
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
&-hint {
From 04ef730fd191507b513d32d2601929eacc1c8e8d Mon Sep 17 00:00:00 2001
From: Chris Hill-Scott
Date: Thu, 9 Jun 2016 11:26:45 +0100
Subject: [PATCH 7/7] Remove redundant `if` statement on job page
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We had this if statement to lay out the table differently with and
without row numbers.
Since we don’t show row numbers at all, this isn’t needed.
---
.../partials/jobs/notifications.html | 73 ++++++-------------
1 file changed, 24 insertions(+), 49 deletions(-)
diff --git a/app/templates/partials/jobs/notifications.html b/app/templates/partials/jobs/notifications.html
index 9241aa83f..cb87d6280 100644
--- a/app/templates/partials/jobs/notifications.html
+++ b/app/templates/partials/jobs/notifications.html
@@ -9,55 +9,30 @@
{% endif %}
>
-
- {% if notifications|length > 0 and notifications[0].job_row_number is not none %}
- {% call(item, row_number) list_table(
- notifications,
- caption=uploaded_file_name,
- caption_visible=False,
- empty_message="No messages to show yet",
- field_headings=[
- 'Recipient',
- 'Time',
- right_aligned_field_heading('Status')
- ],
- field_headings_visible=False
- ) %}
- {% call row_heading() %}
- {{ item.to }}
- {% endcall %}
- {{ date_field(
- (item.updated_at or item.created_at)|format_datetime_short
- ) }}
- {% call field(
- align='right',
- status=item.status|format_notification_status_as_field_status
- ) %}
- {{ item.status|format_notification_status(item.template.template_type) }}
- {% endcall %}
- {% endcall %}
- {% else %}
- {% call(item, row_number) list_table(
- notifications,
- caption=uploaded_file_name,
- caption_visible=False,
- empty_message="No messages to show yet",
- field_headings=[
- 'Recipient',
- right_aligned_field_heading('Status')
- ]
- ) %}
- {% call field() %}
- {{ item.to }}
- {% endcall %}
- {% call field(
- align='right',
- status='error' if item.status == 'Failed' else 'default'
- ) %}
- {{ item.status|format_notification_status }} at {{ item.updated_at|format_time }}
- {% endcall %}
+ {% call(item, row_number) list_table(
+ notifications,
+ caption=uploaded_file_name,
+ caption_visible=False,
+ empty_message="No messages to show yet",
+ field_headings=[
+ 'Recipient',
+ 'Time',
+ 'Status'
+ ],
+ field_headings_visible=False
+ ) %}
+ {% call row_heading() %}
+ {{ item.to }}
{% endcall %}
- {% endif %}
-
+ {{ date_field(
+ (item.updated_at or item.created_at)|format_datetime_short
+ ) }}
+ {% call field(
+ align='right',
+ status=item.status|format_notification_status_as_field_status
+ ) %}
+ {{ item.status|format_notification_status(item.template.template_type) }}
+ {% endcall %}
+ {% endcall %}