Skip to content

Commit 0a27de1

Browse files
committed
Replace type field in user creation UI with radio-button for better usability.
1 parent 894d284 commit 0a27de1

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

frontend/src/assets/style.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,20 @@ body.is-noscroll {
507507
}
508508
}
509509

510+
&.is-light.is-outlined {
511+
background: lighten($primary, 55%);
512+
513+
&.is-focused {
514+
background: lighten($primary, 55%);
515+
}
516+
517+
&.is-selected {
518+
border-color: $primary;
519+
color: $primary;
520+
font-weight: bold;
521+
}
522+
}
523+
510524
&:not(.is-small) {
511525
height: auto;
512526
padding: 10px 20px;
@@ -592,6 +606,10 @@ body.is-noscroll {
592606
color: $grey-dark;
593607
}
594608

609+
&.is-floating-label label.label {
610+
font-size: 0.875rem;
611+
}
612+
595613
.help {
596614
color: $grey;
597615
}

frontend/src/views/UserForm.vue

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
<section expanded class="modal-card-body">
1616
<div class="columns">
1717
<div class="column is-6">
18-
<b-field :label="$t('users.type')" label-position="on-border">
19-
<b-select v-model="form.type" name="status" required expanded :disabled="isEditing">
20-
<option value="user">
21-
{{ $t('users.type.user') }}
22-
</option>
23-
<option value="api">
24-
{{ $t('users.type.api') }}
25-
</option>
26-
</b-select>
18+
<b-field label-position="on-border" class="mb-6">
19+
<b-radio-button v-model="form.type" name="type" native-value="user" :disabled="isEditing" expanded
20+
type="is-light is-outlined">
21+
<b-icon icon="account-outline" />
22+
{{ $t('users.type.user') }}
23+
</b-radio-button>
24+
<b-radio-button v-model="form.type" name="type" native-value="api" :disabled="isEditing" expanded
25+
type="is-light is-outlined">
26+
<b-icon icon="code" />
27+
{{ $t('users.type.api') }}
28+
</b-radio-button>
2729
</b-field>
2830
</div>
2931
<div class="column is-6">
@@ -46,14 +48,14 @@
4648
pattern="[a-zA-Z0-9_\-\.]+$" />
4749
</b-field>
4850

49-
<b-field v-if="form.type !== 'api'" :label="$t('subscribers.email')" label-position="on-border">
50-
<b-input :maxlength="200" v-model="form.email" name="email" :placeholder="$t('subscribers.email')" required />
51-
</b-field>
52-
5351
<b-field :label="$t('globals.fields.name')" label-position="on-border">
5452
<b-input :maxlength="200" v-model="form.name" name="name" :placeholder="$t('globals.fields.name')" />
5553
</b-field>
5654

55+
<b-field v-if="form.type !== 'api'" :label="$t('subscribers.email')" label-position="on-border">
56+
<b-input :maxlength="200" v-model="form.email" name="email" :placeholder="$t('subscribers.email')" required />
57+
</b-field>
58+
5759
<template v-if="form.type !== 'api'">
5860
<div class="box">
5961
<b-field>

0 commit comments

Comments
 (0)