Skip to content

Commit

Permalink
Fixes #108
Browse files Browse the repository at this point in the history
  • Loading branch information
aheinze committed Jun 3, 2023
1 parent 4f98184 commit c59481d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
4 changes: 4 additions & 0 deletions modules/App/assets/app.bundle.css
Original file line number Diff line number Diff line change
Expand Up @@ -4509,6 +4509,10 @@ app-actionbar kiss-container {
[field="boolean"] {
font-size: .95em;
}
[field="boolean"] label{
all: unset;
cursor: pointer;
}
.fields-renderer[nested="true"] .fields-renderer-field {
display: inline-block;
font-weight: normal;
Expand Down
5 changes: 5 additions & 0 deletions modules/App/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ app-actionbar kiss-container {
font-size: .95em;
}

[field="boolean"] label{
all: unset;
cursor: pointer;
}

.fields-renderer[nested="true"] .fields-renderer-field {
display: inline-block;
font-weight: normal;
Expand Down
9 changes: 6 additions & 3 deletions modules/App/assets/vue-components/fields/field-boolean.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
let uuid = 0;

export default {

_meta: {
Expand All @@ -19,7 +21,8 @@ export default {

data() {
return {
val: this.modelValue
val: this.modelValue,
uuid: `field-boolean-${++uuid}`
}
},

Expand Down Expand Up @@ -49,8 +52,8 @@ export default {

template: /*html*/`
<div class="kiss-flex kiss-flex-middle" field="boolean">
<div class="kiss-flex kiss-flex-middle"><input class="app-switch" type="checkbox" v-model="val" @change="update"></div>
<span class="kiss-text-caption kiss-margin-small-left" :class="{'kiss-color-muted':!val}" v-if="label">{{ label }}</span>
<input :id="uuid" class="app-switch" type="checkbox" v-model="val" @change="update">
<label :for="uuid" class="kiss-margin-small-left" :class="{'kiss-color-muted':!val}" v-if="label">{{ label }}</label>
</div>
`,
}
9 changes: 2 additions & 7 deletions modules/System/views/users/roles/role.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,8 @@
</div>

<div class="kiss-margin" :class="{'kiss-hidden': !visible[group]}">
<div class="kiss-margin-small kiss-size-small kiss-flex kiss-middle" v-for="(label, permission) in permissions">
<div><field-boolean v-model="role.permissions[permission]"></field-boolean></div>
<div class="kiss-flex-1 kiss-margin-small-left">
<div :class="{'kiss-color-muted':!role.permissions[permission]}">
{{label}}
</div>
</div>
<div class="kiss-margin-small kiss-size-small" v-for="(label, permission) in permissions">
<field-boolean v-model="role.permissions[permission]" :label="label"></field-boolean>
</div>
</div>

Expand Down

0 comments on commit c59481d

Please sign in to comment.