Skip to content

Commit

Permalink
UX: refactor security modals (#12870)
Browse files Browse the repository at this point in the history
- better form
- uses d-footer
- ensure buttons have the same height

Note that to achieve same height for btn without text, I made the choice to go for a minimum height which should work in most cases.
  • Loading branch information
jjaffeux committed May 3, 2021
1 parent e7de943 commit 286b691
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{{#d-modal-body}}
<div class="form-horizontal">
{{input type="text" value=model.name}}
</div>
<div class="second-factor instructions">
{{i18n "user.second_factor.security_key.edit_description"}}
</div>
<form class="form-horizontal">
<div class="input-group">
<label for="security-key-name">{{i18n "user.second_factor.security_key.edit_description"}}</label>
{{input name="security-key-name" type="text" value=model.name}}
</div>
</form>
{{/d-modal-body}}

<div class="modal-footer">
{{d-button
action=(action "editSecurityKey")
class="btn-primary"
label="user.second_factor.security_key.save"
}}
{{d-button
action=(action "disableSecurityKey")
class="btn-danger"
class="btn-danger no-text"
icon="trash-alt"
aria-label="user.second_factor.disable"
title="user.second_factor.disable"
}}
{{/d-modal-body}}
</div>
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{{#d-modal-body}}
<div class="form-horizontal">
{{input type="text" value=model.name}}
</div>
<div class="second-factor instructions">
{{i18n "user.second_factor.edit_description"}}
</div>
<form class="form-horizontal">
<div class="input-group">
<label for="authenticator-name">{{i18n "user.second_factor.edit_description"}}</label>
{{input name="authenticator-name" type="text" value=model.name}}
</div>
</form>
{{/d-modal-body}}

<div class="modal-footer">
{{d-button
action=(action "editSecondFactor")
class="btn-primary"
label="user.second_factor.save"
}}
{{d-button
action=(action "disableSecondFactor")
class="btn-danger"
class="btn-danger no-text"
icon="trash-alt"
aria-label="user.second_factor.disable"
title="user.second_factor.disable"
}}
{{/d-modal-body}}
</div>
1 change: 1 addition & 0 deletions app/assets/stylesheets/common/components/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
&.no-text {
.d-icon {
margin-right: 0;
min-height: 17px;
}
}
@include hover {
Expand Down

0 comments on commit 286b691

Please sign in to comment.