aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/helpers/boolean_setting.vue
blob: 5ddf5aad52f5a025a83b46ba6acf43c9ab39a668 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
  <label
    v-if="matchesExpertLevel"
    class="BooleanSetting"
  >
    <Checkbox
      :model-value="visibleState"
      :disabled="shouldBeDisabled"
      :indeterminate="isIndeterminate"
      @update:modelValue="update"
    >
      <span
        class="label"
        :class="{ 'faint': shouldBeDisabled }"
      >
        <template v-if="backendDescriptionLabel">
          {{ backendDescriptionLabel }}
        </template>
        <template v-else-if="source === 'admin'">
          MISSING LABEL FOR {{ path }}
        </template>
        <slot v-else />
      </span>
    </Checkbox>
    <ModifiedIndicator
      :changed="isChanged"
      :onclick="reset"
    />
    <ProfileSettingIndicator :is-profile="isProfileSetting" />
    <DraftButtons />
    <p
      v-if="backendDescriptionDescription"
      class="setting-description"
      :class="{ 'faint': shouldBeDisabled }"
    >
      {{ backendDescriptionDescription + ' ' }}
    </p>
    <!-- debugging -->
    <!--
    <p
      v-else
      class="setting-description"
      :class="{ 'faint': shouldBeDisabled }"
    >
      MISSING DESCRIPTION FOR {{ path }}
    </p>
    -->
  </label>
</template>

<script src="./boolean_setting.js"></script>