aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/follow_button/follow_button.js9
-rw-r--r--src/components/follow_button/follow_button.vue2
-rw-r--r--src/components/mrf_transparency_panel/mrf_transparency_panel.js51
-rw-r--r--src/components/mrf_transparency_panel/mrf_transparency_panel.scss21
-rw-r--r--src/components/mrf_transparency_panel/mrf_transparency_panel.vue155
-rw-r--r--src/components/settings_modal/tabs/profile_tab.js2
-rw-r--r--src/components/user_card/user_card.vue14
7 files changed, 197 insertions, 57 deletions
diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js
index 95e7cb6b..3edbcb86 100644
--- a/src/components/follow_button/follow_button.js
+++ b/src/components/follow_button/follow_button.js
@@ -1,6 +1,6 @@
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
export default {
- props: ['relationship', 'labelFollowing', 'buttonClass'],
+ props: ['relationship', 'user', 'labelFollowing', 'buttonClass'],
data () {
return {
inProgress: false
@@ -14,7 +14,7 @@ export default {
if (this.inProgress || this.relationship.following) {
return this.$t('user_card.follow_unfollow')
} else if (this.relationship.requested) {
- return this.$t('user_card.follow_again')
+ return this.$t('user_card.follow_cancel')
} else {
return this.$t('user_card.follow')
}
@@ -29,11 +29,14 @@ export default {
} else {
return this.$t('user_card.follow')
}
+ },
+ disabled () {
+ return this.inProgress || this.user.deactivated
}
},
methods: {
onClick () {
- this.relationship.following ? this.unfollow() : this.follow()
+ this.relationship.following || this.relationship.requested ? this.unfollow() : this.follow()
},
follow () {
this.inProgress = true
diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue
index 7f85f1d7..965d5256 100644
--- a/src/components/follow_button/follow_button.vue
+++ b/src/components/follow_button/follow_button.vue
@@ -2,7 +2,7 @@
<button
class="btn button-default follow-button"
:class="{ toggled: isPressed }"
- :disabled="inProgress"
+ :disabled="disabled"
:title="title"
@click="onClick"
>
diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.js b/src/components/mrf_transparency_panel/mrf_transparency_panel.js
index a0b600d2..3fde8106 100644
--- a/src/components/mrf_transparency_panel/mrf_transparency_panel.js
+++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.js
@@ -1,17 +1,56 @@
import { mapState } from 'vuex'
import { get } from 'lodash'
+/**
+ * This is for backwards compatibility. We originally didn't recieve
+ * extra info like a reason why an instance was rejected/quarantined/etc.
+ * Because we didn't want to break backwards compatibility it was decided
+ * to add an extra "info" key.
+ */
+const toInstanceReasonObject = (instances, info, key) => {
+ return instances.map(instance => {
+ if (info[key] && info[key][instance] && info[key][instance]['reason']) {
+ return { instance: instance, reason: info[key][instance]['reason'] }
+ }
+ return { instance: instance, reason: '' }
+ })
+}
+
const MRFTransparencyPanel = {
computed: {
...mapState({
federationPolicy: state => get(state, 'instance.federationPolicy'),
mrfPolicies: state => get(state, 'instance.federationPolicy.mrf_policies', []),
- quarantineInstances: state => get(state, 'instance.federationPolicy.quarantined_instances', []),
- acceptInstances: state => get(state, 'instance.federationPolicy.mrf_simple.accept', []),
- rejectInstances: state => get(state, 'instance.federationPolicy.mrf_simple.reject', []),
- ftlRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []),
- mediaNsfwInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []),
- mediaRemovalInstances: state => get(state, 'instance.federationPolicy.mrf_simple.media_removal', []),
+ quarantineInstances: state => toInstanceReasonObject(
+ get(state, 'instance.federationPolicy.quarantined_instances', []),
+ get(state, 'instance.federationPolicy.quarantined_instances_info', []),
+ 'quarantined_instances'
+ ),
+ acceptInstances: state => toInstanceReasonObject(
+ get(state, 'instance.federationPolicy.mrf_simple.accept', []),
+ get(state, 'instance.federationPolicy.mrf_simple_info', []),
+ 'accept'
+ ),
+ rejectInstances: state => toInstanceReasonObject(
+ get(state, 'instance.federationPolicy.mrf_simple.reject', []),
+ get(state, 'instance.federationPolicy.mrf_simple_info', []),
+ 'reject'
+ ),
+ ftlRemovalInstances: state => toInstanceReasonObject(
+ get(state, 'instance.federationPolicy.mrf_simple.federated_timeline_removal', []),
+ get(state, 'instance.federationPolicy.mrf_simple_info', []),
+ 'federated_timeline_removal'
+ ),
+ mediaNsfwInstances: state => toInstanceReasonObject(
+ get(state, 'instance.federationPolicy.mrf_simple.media_nsfw', []),
+ get(state, 'instance.federationPolicy.mrf_simple_info', []),
+ 'media_nsfw'
+ ),
+ mediaRemovalInstances: state => toInstanceReasonObject(
+ get(state, 'instance.federationPolicy.mrf_simple.media_removal', []),
+ get(state, 'instance.federationPolicy.mrf_simple_info', []),
+ 'media_removal'
+ ),
keywordsFtlRemoval: state => get(state, 'instance.federationPolicy.mrf_keyword.federated_timeline_removal', []),
keywordsReject: state => get(state, 'instance.federationPolicy.mrf_keyword.reject', []),
keywordsReplace: state => get(state, 'instance.federationPolicy.mrf_keyword.replace', [])
diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.scss b/src/components/mrf_transparency_panel/mrf_transparency_panel.scss
new file mode 100644
index 00000000..80ea01d4
--- /dev/null
+++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.scss
@@ -0,0 +1,21 @@
+.mrf-section {
+ margin: 1em;
+
+ table {
+ width:100%;
+ text-align: left;
+ padding-left:10px;
+ padding-bottom:20px;
+
+ th, td {
+ width: 180px;
+ max-width: 360px;
+ overflow: hidden;
+ vertical-align: text-top;
+ }
+
+ th+th, td+td {
+ width: auto;
+ }
+ }
+}
diff --git a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue
index acdf822e..1787fa07 100644
--- a/src/components/mrf_transparency_panel/mrf_transparency_panel.vue
+++ b/src/components/mrf_transparency_panel/mrf_transparency_panel.vue
@@ -31,13 +31,24 @@
<p>{{ $t("about.mrf.simple.accept_desc") }}</p>
- <ul>
- <li
- v-for="instance in acceptInstances"
- :key="instance"
- v-text="instance"
- />
- </ul>
+ <table>
+ <tr>
+ <th>{{ $t("about.mrf.simple.instance") }}</th>
+ <th>{{ $t("about.mrf.simple.reason") }}</th>
+ </tr>
+ <tr
+ v-for="entry in acceptInstances"
+ :key="entry.instance + '_accept'"
+ >
+ <td>{{ entry.instance }}</td>
+ <td v-if="entry.reason === ''">
+ {{ $t("about.mrf.simple.not_applicable") }}
+ </td>
+ <td v-else>
+ {{ entry.reason }}
+ </td>
+ </tr>
+ </table>
</div>
<div v-if="rejectInstances.length">
@@ -45,13 +56,24 @@
<p>{{ $t("about.mrf.simple.reject_desc") }}</p>
- <ul>
- <li
- v-for="instance in rejectInstances"
- :key="instance"
- v-text="instance"
- />
- </ul>
+ <table>
+ <tr>
+ <th>{{ $t("about.mrf.simple.instance") }}</th>
+ <th>{{ $t("about.mrf.simple.reason") }}</th>
+ </tr>
+ <tr
+ v-for="entry in rejectInstances"
+ :key="entry.instance + '_reject'"
+ >
+ <td>{{ entry.instance }}</td>
+ <td v-if="entry.reason === ''">
+ {{ $t("about.mrf.simple.not_applicable") }}
+ </td>
+ <td v-else>
+ {{ entry.reason }}
+ </td>
+ </tr>
+ </table>
</div>
<div v-if="quarantineInstances.length">
@@ -59,13 +81,24 @@
<p>{{ $t("about.mrf.simple.quarantine_desc") }}</p>
- <ul>
- <li
- v-for="instance in quarantineInstances"
- :key="instance"
- v-text="instance"
- />
- </ul>
+ <table>
+ <tr>
+ <th>{{ $t("about.mrf.simple.instance") }}</th>
+ <th>{{ $t("about.mrf.simple.reason") }}</th>
+ </tr>
+ <tr
+ v-for="entry in quarantineInstances"
+ :key="entry.instance + '_quarantine'"
+ >
+ <td>{{ entry.instance }}</td>
+ <td v-if="entry.reason === ''">
+ {{ $t("about.mrf.simple.not_applicable") }}
+ </td>
+ <td v-else>
+ {{ entry.reason }}
+ </td>
+ </tr>
+ </table>
</div>
<div v-if="ftlRemovalInstances.length">
@@ -73,13 +106,24 @@
<p>{{ $t("about.mrf.simple.ftl_removal_desc") }}</p>
- <ul>
- <li
- v-for="instance in ftlRemovalInstances"
- :key="instance"
- v-text="instance"
- />
- </ul>
+ <table>
+ <tr>
+ <th>{{ $t("about.mrf.simple.instance") }}</th>
+ <th>{{ $t("about.mrf.simple.reason") }}</th>
+ </tr>
+ <tr
+ v-for="entry in ftlRemovalInstances"
+ :key="entry.instance + '_ftl_removal'"
+ >
+ <td>{{ entry.instance }}</td>
+ <td v-if="entry.reason === ''">
+ {{ $t("about.mrf.simple.not_applicable") }}
+ </td>
+ <td v-else>
+ {{ entry.reason }}
+ </td>
+ </tr>
+ </table>
</div>
<div v-if="mediaNsfwInstances.length">
@@ -87,13 +131,24 @@
<p>{{ $t("about.mrf.simple.media_nsfw_desc") }}</p>
- <ul>
- <li
- v-for="instance in mediaNsfwInstances"
- :key="instance"
- v-text="instance"
- />
- </ul>
+ <table>
+ <tr>
+ <th>{{ $t("about.mrf.simple.instance") }}</th>
+ <th>{{ $t("about.mrf.simple.reason") }}</th>
+ </tr>
+ <tr
+ v-for="entry in mediaNsfwInstances"
+ :key="entry.instance + '_media_nsfw'"
+ >
+ <td>{{ entry.instance }}</td>
+ <td v-if="entry.reason === ''">
+ {{ $t("about.mrf.simple.not_applicable") }}
+ </td>
+ <td v-else>
+ {{ entry.reason }}
+ </td>
+ </tr>
+ </table>
</div>
<div v-if="mediaRemovalInstances.length">
@@ -101,13 +156,24 @@
<p>{{ $t("about.mrf.simple.media_removal_desc") }}</p>
- <ul>
- <li
- v-for="instance in mediaRemovalInstances"
- :key="instance"
- v-text="instance"
- />
- </ul>
+ <table>
+ <tr>
+ <th>{{ $t("about.mrf.simple.instance") }}</th>
+ <th>{{ $t("about.mrf.simple.reason") }}</th>
+ </tr>
+ <tr
+ v-for="entry in mediaRemovalInstances"
+ :key="entry.instance + '_media_removal'"
+ >
+ <td>{{ entry.instance }}</td>
+ <td v-if="entry.reason === ''">
+ {{ $t("about.mrf.simple.not_applicable") }}
+ </td>
+ <td v-else>
+ {{ entry.reason }}
+ </td>
+ </tr>
+ </table>
</div>
<h2 v-if="hasKeywordPolicies">
@@ -161,7 +227,6 @@
<script src="./mrf_transparency_panel.js"></script>
<style lang="scss">
-.mrf-section {
- margin: 1em;
-}
+@import '../../_variables.scss';
+@import './mrf_transparency_panel.scss';
</style>
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 9709424c..64079fcd 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -24,7 +24,7 @@ library.add(
const ProfileTab = {
data () {
return {
- newName: this.$store.state.users.currentUser.name,
+ newName: this.$store.state.users.currentUser.name_unescaped,
newBio: unescape(this.$store.state.users.currentUser.description),
newLocked: this.$store.state.users.currentUser.locked,
newNoRichText: this.$store.state.users.currentUser.no_rich_text,
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 6b69d15a..5f957003 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -83,6 +83,12 @@
</router-link>
<template v-if="!hideBio">
<span
+ v-if="user.deactivated"
+ class="alert user-role"
+ >
+ {{ $t('user_card.deactivated') }}
+ </span>
+ <span
v-if="!!visibleRole"
class="alert user-role"
>
@@ -160,7 +166,10 @@
class="user-interactions"
>
<div class="btn-group">
- <FollowButton :relationship="relationship" />
+ <FollowButton
+ :relationship="relationship"
+ :user="user"
+ />
<template v-if="relationship.following">
<ProgressButton
v-if="!relationship.subscribing"
@@ -195,6 +204,7 @@
<button
v-if="relationship.muting"
class="btn button-default btn-block toggled"
+ :disabled="user.deactivated"
@click="unmuteUser"
>
{{ $t('user_card.muted') }}
@@ -202,6 +212,7 @@
<button
v-else
class="btn button-default btn-block"
+ :disabled="user.deactivated"
@click="muteUser"
>
{{ $t('user_card.mute') }}
@@ -210,6 +221,7 @@
<div>
<button
class="btn button-default btn-block"
+ :disabled="user.deactivated"
@click="mentionUser"
>
{{ $t('user_card.mention') }}