From 93bc1de85906dd53f1fa3e1e24f2ea805ef670a9 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 18 May 2022 12:48:27 +0100 Subject: [PATCH] =?UTF-8?q?Show=20=E2=80=98Data=20protection=20officer?= =?UTF-8?q?=E2=80=99=20and/or=20=E2=80=98Key=20contact=E2=80=99=20tags=20i?= =?UTF-8?q?n=20users=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/frontend/styles/_tag.scss | 7 +++++++ app/frontend/styles/application.scss | 1 + app/views/users/index.html.erb | 17 ++++++++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 app/frontend/styles/_tag.scss diff --git a/app/frontend/styles/_tag.scss b/app/frontend/styles/_tag.scss new file mode 100644 index 000000000..dc6c366fa --- /dev/null +++ b/app/frontend/styles/_tag.scss @@ -0,0 +1,7 @@ +.app-tag--small { + @include govuk-font(14, $weight: bold); + padding-top: 2px; + padding-right: 6px; + padding-bottom: 2px; + padding-left: 6px; +} diff --git a/app/frontend/styles/application.scss b/app/frontend/styles/application.scss index b9de7492c..ebe0af05f 100644 --- a/app/frontend/styles/application.scss +++ b/app/frontend/styles/application.scss @@ -33,6 +33,7 @@ $govuk-breakpoints: ( @import "related-navigation"; @import "section-skip-link"; @import "table-group"; +@import "tag"; @import "task-list"; @import "template"; @import "pagination"; diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index cff822745..7a24b1838 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -23,7 +23,22 @@ <% @users.each do |user| %> <%= table.body do |body| %> <%= body.row do |row| %> - <% row.cell(text: simple_format(user_cell(user), {}, wrapper_tag: "div")) %> + <% row.cell do %> + <%= simple_format(user_cell(user), {}, wrapper_tag: "span") %> + <% if user.is_data_protection_officer? || user.is_key_contact? %> +
+ <% end %> + <%= user.is_data_protection_officer? ? govuk_tag( + classes: "app-tag--small", + colour: "turquoise", + text: "Data protection officer", + ) : "" %> + <%= user.is_key_contact? ? govuk_tag( + classes: "app-tag--small", + colour: "turquoise", + text: "Key contact", + ) : "" %> + <% end %> <% row.cell(text: simple_format(org_cell(user), {}, wrapper_tag: "div")) %> <% row.cell(text: user.last_sign_in_at&.to_formatted_s(:govuk_date)) %> <% end %>