aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings_modal')
-rw-r--r--src/components/settings_modal/tabs/mutes_and_blocks_tab.js28
-rw-r--r--src/components/settings_modal/tabs/mutes_and_blocks_tab.vue21
-rw-r--r--src/components/settings_modal/tabs/profile_tab.js2
-rw-r--r--src/components/settings_modal/tabs/profile_tab.vue5
-rw-r--r--src/components/settings_modal/tabs/theme_tab/theme_tab.vue7
5 files changed, 42 insertions, 21 deletions
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
index b0043dbb..40a87b81 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
@@ -32,12 +32,12 @@ const DomainMuteList = withSubscription({
const MutesAndBlocks = {
data () {
return {
- activeTab: 'profile',
- newDomainToMute: ''
+ activeTab: 'profile'
}
},
created () {
this.$store.dispatch('fetchTokens')
+ this.$store.dispatch('getKnownDomains')
},
components: {
TabSwitcher,
@@ -51,6 +51,14 @@ const MutesAndBlocks = {
Autosuggest,
Checkbox
},
+ computed: {
+ knownDomains () {
+ return this.$store.state.instance.knownDomains
+ },
+ user () {
+ return this.$store.state.users.currentUser
+ }
+ },
methods: {
importFollows (file) {
return this.$store.state.api.backendInteractor.importFollows({ file })
@@ -86,13 +94,13 @@ const MutesAndBlocks = {
filterUnblockedUsers (userIds) {
return reject(userIds, (userId) => {
const relationship = this.$store.getters.relationship(this.userId)
- return relationship.blocking || userId === this.$store.state.users.currentUser.id
+ return relationship.blocking || userId === this.user.id
})
},
filterUnMutedUsers (userIds) {
return reject(userIds, (userId) => {
const relationship = this.$store.getters.relationship(this.userId)
- return relationship.muting || userId === this.$store.state.users.currentUser.id
+ return relationship.muting || userId === this.user.id
})
},
queryUserIds (query) {
@@ -111,12 +119,16 @@ const MutesAndBlocks = {
unmuteUsers (ids) {
return this.$store.dispatch('unmuteUsers', ids)
},
+ filterUnMutedDomains (urls) {
+ return urls.filter(url => !this.user.domainMutes.includes(url))
+ },
+ queryKnownDomains (query) {
+ return new Promise((resolve, reject) => {
+ resolve(this.knownDomains.filter(url => url.toLowerCase().includes(query)))
+ })
+ },
unmuteDomains (domains) {
return this.$store.dispatch('unmuteDomains', domains)
- },
- muteDomain () {
- return this.$store.dispatch('muteDomain', this.newDomainToMute)
- .then(() => { this.newDomainToMute = '' })
}
}
}
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue b/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
index 6884b7be..5a1cf2c0 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
@@ -119,21 +119,16 @@
<div :label="$t('settings.domain_mutes')">
<div class="domain-mute-form">
- <input
- v-model="newDomainToMute"
+ <Autosuggest
+ :filter="filterUnMutedDomains"
+ :query="queryKnownDomains"
:placeholder="$t('settings.type_domains_to_mute')"
- type="text"
- @keyup.enter="muteDomain"
- >
- <ProgressButton
- class="btn btn-default domain-mute-button"
- :click="muteDomain"
>
- {{ $t('domain_mute_card.mute') }}
- <template slot="progress">
- {{ $t('domain_mute_card.mute_progress') }}
- </template>
- </ProgressButton>
+ <DomainMuteCard
+ slot-scope="row"
+ :domain="row.item"
+ />
+ </Autosuggest>
</div>
<DomainMuteList
:refresh="true"
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 0874e0c8..e6db802d 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -25,6 +25,7 @@ const ProfileTab = {
showRole: this.$store.state.users.currentUser.show_role,
role: this.$store.state.users.currentUser.role,
discoverable: this.$store.state.users.currentUser.discoverable,
+ bot: this.$store.state.users.currentUser.bot,
allowFollowingMove: this.$store.state.users.currentUser.allow_following_move,
pickAvatarBtnVisible: true,
bannerUploading: false,
@@ -94,6 +95,7 @@ const ProfileTab = {
hide_follows: this.hideFollows,
hide_followers: this.hideFollowers,
discoverable: this.discoverable,
+ bot: this.bot,
allow_following_move: this.allowFollowingMove,
hide_follows_count: this.hideFollowsCount,
hide_followers_count: this.hideFollowersCount,
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index 20a68f7d..0f9210a6 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -143,6 +143,11 @@
{{ $t("settings.profile_fields.add_field") }}
</a>
</div>
+ <p>
+ <Checkbox v-model="bot">
+ {{ $t('settings.bot') }}
+ </Checkbox>
+ </p>
<button
:disabled="newName && newName.length === 0"
class="btn btn-default"
diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
index fcfad23b..d14f854c 100644
--- a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
@@ -256,6 +256,13 @@
:label="$t('settings.links')"
/>
<ContrastRatio :contrast="previewContrast.postLink" />
+ <ColorInput
+ v-model="postGreentextColorLocal"
+ name="postGreentextColor"
+ :fallback="previewTheme.colors.cGreen"
+ :label="$t('settings.greentext')"
+ />
+ <ContrastRatio :contrast="previewContrast.postGreentext" />
<h4>{{ $t('settings.style.advanced_colors.alert') }}</h4>
<ColorInput
v-model="alertErrorColorLocal"