summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2018-11-05 11:21:34 +0900
committerGitHub <noreply@github.com>2018-11-05 11:21:34 +0900
commit136f23c7ad5845e243c699a821d2cb8a23e76c13 (patch)
tree1b7f0fcd7ef8d8abfb70a3f4b66615ab45c7642b /src/client
parentUse Twemoji (diff)
parent10.38.7 (diff)
downloadsharkey-136f23c7ad5845e243c699a821d2cb8a23e76c13.tar.gz
sharkey-136f23c7ad5845e243c699a821d2cb8a23e76c13.tar.bz2
sharkey-136f23c7ad5845e243c699a821d2cb8a23e76c13.zip
Merge branch 'develop' into twemoji
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/admin/views/announcements.vue29
-rw-r--r--src/client/app/admin/views/instance.vue6
2 files changed, 26 insertions, 9 deletions
diff --git a/src/client/app/admin/views/announcements.vue b/src/client/app/admin/views/announcements.vue
index 926426844d..bd99e1bc0d 100644
--- a/src/client/app/admin/views/announcements.vue
+++ b/src/client/app/admin/views/announcements.vue
@@ -10,7 +10,7 @@
<span>%i18n:@text%</span>
</ui-textarea>
<ui-horizon-group>
- <ui-button @click="save">%fa:save R% %i18n:@save%</ui-button>
+ <ui-button @click="save()">%fa:save R% %i18n:@save%</ui-button>
<ui-button @click="remove(i)">%fa:trash-alt R% %i18n:@remove%</ui-button>
</ui-horizon-group>
</section>
@@ -46,18 +46,31 @@ export default Vue.extend({
},
remove(i) {
- this.announcements = this.announcements.filter((_, j) => j !== i);
- this.save();
+ this.$swal({
+ type: 'warning',
+ text: '%i18n:@_remove.are-you-sure%'.replace('$1', this.announcements.find((_, j) => j == i).title),
+ showCancelButton: true
+ }).then(res => {
+ if (!res.value) return;
+ this.announcements = this.announcements.filter((_, j) => j !== i);
+ this.save(true);
+ this.$swal({
+ type: 'success',
+ text: '%i18n:@_remove.removed%'
+ });
+ });
},
- save() {
+ save(silent) {
(this as any).api('admin/update-meta', {
broadcasts: this.announcements
}).then(() => {
- this.$swal({
- type: 'success',
- text: '%i18n:@saved%'
- });
+ if (!silent) {
+ this.$swal({
+ type: 'success',
+ text: '%i18n:@saved%'
+ });
+ }
}).catch(e => {
this.$swal({
type: 'error',
diff --git a/src/client/app/admin/views/instance.vue b/src/client/app/admin/views/instance.vue
index 85ef0a60c4..703d0f622b 100644
--- a/src/client/app/admin/views/instance.vue
+++ b/src/client/app/admin/views/instance.vue
@@ -6,6 +6,7 @@
<ui-input v-model="name">%i18n:@instance-name%</ui-input>
<ui-textarea v-model="description">%i18n:@instance-description%</ui-textarea>
<ui-input v-model="bannerUrl">%i18n:@banner-url%</ui-input>
+ <ui-input v-model="maxNoteTextLength">%i18n:@max-note-text-length%</ui-input>
<ui-button @click="updateMeta">%i18n:@save%</ui-button>
</section>
</ui-card>
@@ -39,6 +40,7 @@ export default Vue.extend({
bannerUrl: null,
name: null,
description: null,
+ maxNoteTextLength: null,
inviteCode: null,
};
},
@@ -48,6 +50,7 @@ export default Vue.extend({
this.bannerUrl = meta.bannerUrl;
this.name = meta.name;
this.description = meta.description;
+ this.maxNoteTextLength = meta.maxNoteTextLength;
});
},
@@ -69,7 +72,8 @@ export default Vue.extend({
disableLocalTimeline: this.disableLocalTimeline,
bannerUrl: this.bannerUrl,
name: this.name,
- description: this.description
+ description: this.description,
+ maxNoteTextLength: parseInt(this.maxNoteTextLength, 10)
}).then(() => {
this.$swal({
type: 'success',