aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/settings_modal/admin_tabs/instance_tab.vue87
-rw-r--r--src/components/settings_modal/helpers/boolean_setting.js15
-rw-r--r--src/components/settings_modal/helpers/boolean_setting.vue5
-rw-r--r--src/components/settings_modal/helpers/draft_buttons.vue2
-rw-r--r--src/components/settings_modal/helpers/number_setting.vue5
-rw-r--r--src/components/settings_modal/helpers/setting.js4
-rw-r--r--src/components/settings_modal/helpers/string_setting.vue5
7 files changed, 115 insertions, 8 deletions
diff --git a/src/components/settings_modal/admin_tabs/instance_tab.vue b/src/components/settings_modal/admin_tabs/instance_tab.vue
index 43ad4c8c..96d8a17e 100644
--- a/src/components/settings_modal/admin_tabs/instance_tab.vue
+++ b/src/components/settings_modal/admin_tabs/instance_tab.vue
@@ -33,11 +33,81 @@
BACKGROUND IMAGE
</StringSetting>
</li>
+ </ul>
+ </div>
+ <div class="setting-item">
+ <h2>{{ $t('admin_dash.instance.access') }}</h2>
+ <ul class="setting-list">
<li>
<BooleanSetting path=":pleroma.:instance.:public">
PUBLIC
</BooleanSetting>
</li>
+ <li>
+ <h3>{{ $t('admin_dash.instance.restrict.header') }}</h3>
+ </li>
+ <li>
+ <ChoiceSetting path=":pleroma.:instance.:limit_to_local_content">
+ SEARCH RESTRICTION
+ </ChoiceSetting>
+ </li>
+ <li>
+ <h4>{{ $t('admin_dash.instance.restrict.timelines') }}</h4>
+ </li>
+ <li>
+ <BooleanSetting
+ path=":pleroma.:restrict_unauthenticated.:timelines.:local"
+ indeterminate-state=":if_instance_is_private"
+ >
+ LOCAL TIMELINES
+ </BooleanSetting>
+ </li>
+ <li>
+ <BooleanSetting
+ path=":pleroma.:restrict_unauthenticated.:timelines.:federated"
+ indeterminate-state=":if_instance_is_private"
+ >
+ FED TIMELINES
+ </BooleanSetting>
+ </li>
+ <li>
+ <h4>{{ $t('admin_dash.instance.restrict.profiles') }}</h4>
+ </li>
+ <li>
+ <BooleanSetting
+ path=":pleroma.:restrict_unauthenticated.:profiles.:local"
+ indeterminate-state=":if_instance_is_private"
+ >
+ LOCAL PROFILES
+ </BooleanSetting>
+ </li>
+ <li>
+ <BooleanSetting
+ path=":pleroma.:restrict_unauthenticated.:profiles.:remote"
+ indeterminate-state=":if_instance_is_private"
+ >
+ FED PROFILES
+ </BooleanSetting>
+ </li>
+ <li>
+ <h4>{{ $t('admin_dash.instance.restrict.activities') }}</h4>
+ </li>
+ <li>
+ <BooleanSetting
+ path=":pleroma.:restrict_unauthenticated.:activities.:local"
+ indeterminate-state=":if_instance_is_private"
+ >
+ LOCAL STATUSES
+ </BooleanSetting>
+ </li>
+ <li>
+ <BooleanSetting
+ path=":pleroma.:restrict_unauthenticated.:activities.:remote"
+ indeterminate-state=":if_instance_is_private"
+ >
+ FED STATUSES
+ </BooleanSetting>
+ </li>
</ul>
</div>
<div class="setting-item">
@@ -52,7 +122,7 @@
<BooleanSetting
path=":pleroma.:instance.:invites_enabled"
parent-path=":pleroma.:instance.:registrations_open"
- :parent-invert="true"
+ parent-invert
>
INVITES ENABLED
</BooleanSetting>
@@ -60,6 +130,21 @@
</ul>
</li>
<li>
+ <BooleanSetting path=":pleroma.:instance.:birthday_required">
+ BDEY REQUIRED
+ </BooleanSetting>
+ <ul class="setting-list suboptions">
+ <li>
+ <IntegerSetting
+ path=":pleroma.:instance.:birthday_min_age"
+ parent-path=":pleroma.:instance.:birthday_required"
+ >
+ BDEY age of consent
+ </IntegerSetting>
+ </li>
+ </ul>
+ </li>
+ <li>
<BooleanSetting path=":pleroma.:instance.:account_activation_required">
ACTIVATION REQUIRED
</BooleanSetting>
diff --git a/src/components/settings_modal/helpers/boolean_setting.js b/src/components/settings_modal/helpers/boolean_setting.js
index 0df01d31..199d3d0f 100644
--- a/src/components/settings_modal/helpers/boolean_setting.js
+++ b/src/components/settings_modal/helpers/boolean_setting.js
@@ -3,13 +3,28 @@ import Setting from './setting.js'
export default {
...Setting,
+ props: {
+ ...Setting.props,
+ indeterminateState: [String, Object]
+ },
components: {
...Setting.components,
Checkbox
},
+ computed: {
+ ...Setting.computed,
+ isIndeterminate () {
+ return this.visibleState === this.indeterminateState
+ }
+ },
methods: {
...Setting.methods,
getValue (e) {
+ // Basic tri-state toggle implementation
+ if (!!this.indeterminateState && !e && this.visibleState === true) {
+ // If we have indeterminate state, switching from true to false first goes through indeterminate
+ return this.indeterminateState
+ }
return e
}
}
diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue
index 07971b00..6307d526 100644
--- a/src/components/settings_modal/helpers/boolean_setting.vue
+++ b/src/components/settings_modal/helpers/boolean_setting.vue
@@ -4,13 +4,15 @@
class="BooleanSetting"
>
<Checkbox
- :model-value="draftMode ? draft :state"
+ :model-value="visibleState"
:disabled="shouldBeDisabled"
+ :indeterminate="isIndeterminate"
@update:modelValue="update"
>
<span
v-if="!!$slots.default"
class="label"
+ :class="{ 'faint': shouldBeDisabled }"
>
<template v-if="backendDescription">
{{ backendDescriptionLabel }}
@@ -29,6 +31,7 @@
<p
v-if="backendDescriptionDescription"
class="setting-description"
+ :class="{ 'faint': shouldBeDisabled }"
>
{{ backendDescriptionDescription + ' ' }}
</p>
diff --git a/src/components/settings_modal/helpers/draft_buttons.vue b/src/components/settings_modal/helpers/draft_buttons.vue
index 9e972b14..80da92e8 100644
--- a/src/components/settings_modal/helpers/draft_buttons.vue
+++ b/src/components/settings_modal/helpers/draft_buttons.vue
@@ -49,13 +49,13 @@
</template>
</Popover>
<Popover
+ v-if="$parent.canHardReset"
trigger="hover"
:trigger-attrs="{ 'aria-label': $t('settings.hard_reset_value_tooltip') }"
>
<template #trigger>
&nbsp;
<button
- v-if="$parent.canHardReset"
class="button button-default btn"
type="button"
:title="$t('settings.hard_reset_value')"
diff --git a/src/components/settings_modal/helpers/number_setting.vue b/src/components/settings_modal/helpers/number_setting.vue
index f97d5cf2..2b90c336 100644
--- a/src/components/settings_modal/helpers/number_setting.vue
+++ b/src/components/settings_modal/helpers/number_setting.vue
@@ -3,7 +3,7 @@
v-if="matchesExpertLevel"
class="NumberSetting"
>
- <label :for="path">
+ <label :for="path" :class="{ 'faint': shouldBeDisabled }">
<template v-if="backendDescription">
{{ backendDescriptionLabel + ' ' }}
</template>
@@ -16,7 +16,7 @@
class="number-input"
type="number"
:step="step || 1"
- :disabled="disabled"
+ :disabled="shouldBeDisabled"
:min="min || 0"
:value="realDraftMode ? draft :state"
@change="update"
@@ -31,6 +31,7 @@
<p
v-if="backendDescriptionDescription"
class="setting-description"
+ :class="{ 'faint': shouldBeDisabled }"
>
{{ backendDescriptionDescription + ' ' }}
</p>
diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js
index 7cad27b7..d42ae763 100644
--- a/src/components/settings_modal/helpers/setting.js
+++ b/src/components/settings_modal/helpers/setting.js
@@ -65,6 +65,9 @@ export default {
return value
}
},
+ visibleState () {
+ return this.realDraftMode ? this.draft : this.state
+ },
realSource () {
return this.source || this.defaultSource
},
@@ -88,7 +91,6 @@ export default {
return this.disabled || (parentValue !== null ? (this.parentInvert ? parentValue : !parentValue) : false)
},
configSource () {
- console.log('SRC', this.realSource)
switch (this.realSource) {
case 'profile':
return this.$store.state.profileConfig
diff --git a/src/components/settings_modal/helpers/string_setting.vue b/src/components/settings_modal/helpers/string_setting.vue
index fb91b5d9..5ee75a84 100644
--- a/src/components/settings_modal/helpers/string_setting.vue
+++ b/src/components/settings_modal/helpers/string_setting.vue
@@ -3,7 +3,7 @@
v-if="matchesExpertLevel"
class="StringSetting"
>
- <label :for="path">
+ <label :for="path" :class="{ 'faint': shouldBeDisabled }">
<template v-if="backendDescription">
{{ backendDescriptionLabel + ' ' }}
</template>
@@ -15,7 +15,7 @@
:id="path"
class="string-input"
step="1"
- :disabled="disabled"
+ :disabled="shouldBeDisabled"
:value="realDraftMode ? draft : state"
@change="update"
>
@@ -29,6 +29,7 @@
<p
v-if="backendDescriptionDescription"
class="setting-description"
+ :class="{ 'faint': shouldBeDisabled }"
>
{{ backendDescriptionDescription + ' ' }}
</p>