Skip to content

Commit

Permalink
PP-1606 Change legend and read-only fields HTML
Browse files Browse the repository at this point in the history
Description lists were shown to add useful
information for replaying of already-entered field
data:

alphagov/govuk-prototype-kit#365

Apart from that, replacing the heading for the
permissions field with the legend reduces
duplication of that information.
  • Loading branch information
tombye authored and Raul Garcia committed Apr 12, 2017
1 parent d7fa6c8 commit 9297191
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $grey-8: #fff;
@import "helpers/_movement";
@import "helpers/_links";
@import "helpers/_text_treatment";
@import "helpers/_forms";

@import "modules/_service_switcher";
@import "modules/_transactions_filter";
Expand Down
15 changes: 15 additions & 0 deletions app/assets/sass/helpers/_forms.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* For the first heading in a fieldset, use padding-top instead of margin-top to preserve spacing */
fieldset > :first-child.heading-small {
margin-top: 0;
padding-top: (10 / 16) + em;

@include media(tablet) {
margin-top: 0;
padding-top: (20 / 19) + em;
}
}

/* Contain spacing from the margins of child elements */
dl.read-only-fields {
overflow: hidden;
}
13 changes: 6 additions & 7 deletions app/views/services/team_member_permissions.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ <h1 class="heading-large underline">
Edit permissions</h1>
</div>

<div id="heading-large underline">
<h2 class="heading-small">Email address</h2>
<span id="email">{{email}}</span>
</div>
<div class="column-full remove-left-margin">

<dl class="read-only-fields">
<dt class="heading-small">Email address</dt>
<dd id="email">{{email}}</dd>
</dl>

<div class="column-full remove-left-margin">
<h3 class="heading-small">Permission level</h3>
<form id="role-update-form" method="post" action="{{editPermissionsLink}}">
<div class="form-group">
<fieldset>
<legend class="visuallyhidden">Permission level</legend>
<legend class="heading-small">Permission level</legend>
<input id="csrf" name="csrfToken" type="hidden" value="{{csrf}}"/>

<label class="block-label selection-button-radio" for="role-admin-input">
Expand Down

0 comments on commit 9297191

Please sign in to comment.