From d13db305c145e13df24407d51fecd3b9bfeaeec4 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 3 Dec 2019 09:47:48 +0000 Subject: [PATCH] Convert `
` on API page to macro HTML The GOV.UK Frontend details component macro wraps its `` text in a ``. We put a `

` in the `` (actually valid use, based on the spec) so this breaks when the `` wraps it. This converts the existing `
` tag to use all the class names the macro creates, but with all the `` contents in the `

`. Also adds font-smoothing to the messages on the API page. This was previously set globally for all fonts in the GOV.UK Template CSS but is now just set for the New Transport 'nta' font. Included because the messages use the monospace font so don't have it by default. --- app/assets/stylesheets/views/api.scss | 73 ++++++++++++++++++--------- app/templates/views/api/index.html | 46 +++++++++-------- 2 files changed, 72 insertions(+), 47 deletions(-) diff --git a/app/assets/stylesheets/views/api.scss b/app/assets/stylesheets/views/api.scss index 98e21685e..4049c43c5 100644 --- a/app/assets/stylesheets/views/api.scss +++ b/app/assets/stylesheets/views/api.scss @@ -1,6 +1,8 @@ .api-notifications { font-family: monospace; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; border-bottom: 1px solid $border-colour; &-item { @@ -8,38 +10,59 @@ border-top: 1px solid $border-colour; padding: 10px 0 0 0; - &-title { - color: $link-colour; + &__heading, + &__data, + &__view { + font-family: monospace; + } + + &__heading { + display: block; + margin-bottom: $gutter-half; + + &::before { + top: -1.3em; + } + } + + &__meta { + + display: block; + color: $secondary-text-colour; text-decoration: none; - display: block; + + &-key, + &-time { + color: $secondary-text-colour; + display: inline-block; + width: auto; + } + + @include govuk-media-query($from: tablet) { + &-key, + &-time { + width: 50%; + } + + &-time { + text-align: right; + } + } + } - &-recipient { - display: inline; - } + &__data { - &-meta { - display: block; - color: $secondary-text-colour; - } + border-left: none; + padding-left: 25px; - &-time { - text-align: right; - } + &-name { + color: $secondary-text-colour; + } - &-key { - display: inline-block; - padding-left: 46px; - } - - &-data { - - padding-left: 31px; - color: $secondary-text-colour; - - &-item { - padding-bottom: 15px; + &-value { color: $text-colour; + padding-bottom: 15px; } } diff --git a/app/templates/views/api/index.html b/app/templates/views/api/index.html index 9397a97b5..cebb5442d 100644 --- a/app/templates/views/api/index.html +++ b/app/templates/views/api/index.html @@ -39,43 +39,45 @@
{% if not api_notifications.notifications %}
-

+

When you send messages via the API they’ll appear here.

-

+

Notify deletes messages after 7 days.

{% endif %} {% for notification in api_notifications.notifications %} -
- -

+
+ +

+ {{ notification.to }} + + + + {{notification.key_name}} + + + + +

- - - {{notification.key_name}} - - - - -
-
-
+
+
{% for key in [ 'id', 'client_reference', 'notification_type', 'created_at', 'updated_at', 'sent_at', 'status' ] %} {% if notification[key] %} -
{{ key }}:
-
{{ notification[key] }}
+
{{ key }}:
+
{{ notification[key] }}
{% endif %} {% endfor %} {% if notification.status not in ('pending-virus-check', 'virus-scan-failed') %} - View {{ message_count_label(1, notification.template.template_type, suffix='') }} + View {{ message_count_label(1, notification.template.template_type, suffix='') }} {% endif %}
@@ -84,11 +86,11 @@ {% if api_notifications.notifications %}
{% if api_notifications.notifications|length == 50 %} -

+

Only showing the first 50 messages.

{% endif %} -

+

Notify deletes messages after 7 days.