From bceb02d760f53877f0f677144bc468ffbc4e66f2 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 16 Nov 2018 05:47:29 +0900 Subject: [PATCH] local only visibility (#3254) * local only visibility * fix UI --- locales/ja-JP.yml | 7 ++++++ .../common/views/components/note-header.vue | 6 +++++ .../views/components/visibility-chooser.vue | 18 ++++++++++++++ .../app/desktop/views/components/note.vue | 24 ++++++++++++++++--- .../desktop/views/components/post-form.vue | 16 ++++++++++++- .../app/mobile/views/components/note.vue | 24 ++++++++++++++++--- .../app/mobile/views/components/post-form.vue | 11 ++++++++- src/docs/api/entities/note.yaml | 7 ++++++ src/models/note.ts | 1 + src/queue/index.ts | 2 ++ src/remote/activitypub/models/note.ts | 1 + src/server/activitypub.ts | 6 +++-- src/server/activitypub/outbox.ts | 3 ++- src/server/api/endpoints/notes/create.ts | 9 +++++++ src/services/note/create.ts | 15 ++++++++++++ 15 files changed, 139 insertions(+), 11 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index b7ef578c5..390bfc9f3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -96,6 +96,9 @@ common: specified: "ダイレクト" specified-desc: "指定したユーザーにのみ公開" private: "非公開" + local-public: "公開(ローカルのみ)" + local-home: "ホーム(ローカルのみ)" + local-followers: "フォロワー(ローカルのみ)" note-placeholders: a: "今どうしてる?" @@ -471,6 +474,9 @@ common/views/components/visibility-chooser.vue: specified: "ダイレクト" specified-desc: "指定したユーザーにのみ公開" private: "非公開" + local-public: "公開(ローカルのみ)" + local-home: "ホーム(ローカルのみ)" + local-followers: "フォロワー(ローカルのみ)" common/views/components/trends.vue: count: "{}人が投稿" @@ -761,6 +767,7 @@ desktop/views/components/post-form.vue: create-poll: "アンケートを作成" text-remain: "残り{}文字" recent-tags: "最近" + local-only-message: "この投稿はローカルにのみ公開されます" click-to-tagging: "クリックでタグ付け" visibility: "公開範囲" geolocation-alert: "お使いの端末は位置情報に対応していません" diff --git a/src/client/app/common/views/components/note-header.vue b/src/client/app/common/views/components/note-header.vue index 2c7ae0194..012b678ab 100644 --- a/src/client/app/common/views/components/note-header.vue +++ b/src/client/app/common/views/components/note-header.vue @@ -19,6 +19,9 @@ + + + @@ -115,4 +118,7 @@ export default Vue.extend({ > .visibility margin-left 8px + > .localOnly + margin-left 4px + diff --git a/src/client/app/common/views/components/visibility-chooser.vue b/src/client/app/common/views/components/visibility-chooser.vue index 896be039b..0335fba0e 100644 --- a/src/client/app/common/views/components/visibility-chooser.vue +++ b/src/client/app/common/views/components/visibility-chooser.vue @@ -35,6 +35,24 @@ {{ $t('private') }} +
+
+
+ {{ $t('local-public') }} +
+
+
+
+
+ {{ $t('local-home') }} +
+
+
+
+
+ {{ $t('local-followers') }} +
+
diff --git a/src/client/app/desktop/views/components/note.vue b/src/client/app/desktop/views/components/note.vue index e2b67c150..6bd467426 100644 --- a/src/client/app/desktop/views/components/note.vue +++ b/src/client/app/desktop/views/components/note.vue @@ -20,6 +20,15 @@ {{ note.user | userName }} {{ this.$t('reposted-by').substr(this.$t('reposted-by').indexOf('}') + 1) }} + + + + + + + + +
@@ -199,9 +208,6 @@ export default Vue.extend({ > span flex-shrink 0 - &:last-of-type - margin-right 8px - .name overflow hidden flex-shrink 1 @@ -215,6 +221,18 @@ export default Vue.extend({ flex-shrink 0 font-size 0.9em + > .visibility + margin-left 8px + + [data-icon] + margin-right 0 + + > .localOnly + margin-left 4px + + [data-icon] + margin-right 0 + & + article padding-top 8px diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index e05fab168..02478b4eb 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -14,6 +14,7 @@ {{ $t('recent-tags') }}: #{{ tag }} +
{{ $t('local-only-message') }}