From 54fdc220017122c8e30e0fb16f0dd2534fc60947 Mon Sep 17 00:00:00 2001
From: kPherox <admin@mail.kr-kp.com>
Date: Wed, 10 Jun 2020 03:24:55 +0900
Subject: Add profile fields form

---
 src/components/settings_modal/tabs/profile_tab.vue | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

(limited to 'src/components/settings_modal/tabs/profile_tab.vue')

diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index fff4f970..2fa3021e 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -95,6 +95,52 @@
           {{ $t('settings.discoverable') }}
         </Checkbox>
       </p>
+      <div v-if="maxFields > 0">
+        <p>{{ $t('settings.profile_fields.label') }}</p>
+        <div
+          v-for="(_, i) in newFields"
+          :key="i"
+          class="profile-fields"
+        >
+          <EmojiInput
+            v-model="newFields[i].name"
+            :suggest="emojiSuggestor"
+            hide-emoji-button
+          >
+            <input
+              v-model="newFields[i].name"
+              :placeholder="$t('settings.profile_fields.name')"
+            >
+          </EmojiInput>
+          <EmojiInput
+            v-model="newFields[i].value"
+            :suggest="emojiSuggestor"
+            hide-emoji-button
+          >
+            <input
+              v-model="newFields[i].value"
+              :placeholder="$t('settings.profile_fields.value')"
+            >
+          </EmojiInput>
+          <div
+            class="icon-container"
+          >
+            <i
+              v-show="newFields.length > 1"
+              class="icon-cancel"
+              @click="deleteField(i)"
+            />
+          </div>
+        </div>
+        <a
+          v-if="newFields.length < maxFields"
+          class="add-field faint"
+          @click="addField"
+        >
+          <i class="icon-plus" />
+          {{ $t("settings.profile_fields.add_field") }}
+        </a>
+      </div>
       <button
         :disabled="newName && newName.length === 0"
         class="btn btn-default"
-- 
cgit v1.2.3-70-g09d2


From bad3dacfac1ef3dd2c0f55b53fb78f4bf410a01e Mon Sep 17 00:00:00 2001
From: kPherox <admin@mail.kr-kp.com>
Date: Fri, 19 Jun 2020 21:18:36 +0900
Subject: implement user suggestor for profile fields

---
 src/components/settings_modal/tabs/profile_tab.js  | 6 ++++++
 src/components/settings_modal/tabs/profile_tab.vue | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/components/settings_modal/tabs/profile_tab.vue')

diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 896ff508..0874e0c8 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -65,6 +65,12 @@ const ProfileTab = {
         ...this.$store.state.instance.customEmoji
       ] })
     },
+    userSuggestor () {
+      return suggestor({
+        users: this.$store.state.users.users,
+        updateUsersList: (query) => this.$store.dispatch('searchUsers', { query })
+      })
+    },
     fieldsLimits () {
       return this.$store.state.instance.fieldsLimits
     },
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index 2fa3021e..20a68f7d 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -104,8 +104,9 @@
         >
           <EmojiInput
             v-model="newFields[i].name"
-            :suggest="emojiSuggestor"
+            enable-emoji-picker
             hide-emoji-button
+            :suggest="userSuggestor"
           >
             <input
               v-model="newFields[i].name"
@@ -114,8 +115,9 @@
           </EmojiInput>
           <EmojiInput
             v-model="newFields[i].value"
-            :suggest="emojiSuggestor"
+            enable-emoji-picker
             hide-emoji-button
+            :suggest="userSuggestor"
           >
             <input
               v-model="newFields[i].value"
-- 
cgit v1.2.3-70-g09d2


From 2451956d838d132a14a3089546ceac59c07e1b3a Mon Sep 17 00:00:00 2001
From: Sergey Suprunenko <suprunenko.s@gmail.com>
Date: Sun, 21 Jun 2020 14:59:05 +0200
Subject: Add 'bot' flag to Profile settings

---
 src/components/settings_modal/tabs/profile_tab.js  | 2 ++
 src/components/settings_modal/tabs/profile_tab.vue | 5 +++++
 src/i18n/en.json                                   | 1 +
 src/i18n/ru.json                                   | 1 +
 4 files changed, 9 insertions(+)

(limited to 'src/components/settings_modal/tabs/profile_tab.vue')

diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 8658b097..56e956cd 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -23,6 +23,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,
@@ -79,6 +80,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 fff4f970..decdb389 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -95,6 +95,11 @@
           {{ $t('settings.discoverable') }}
         </Checkbox>
       </p>
+      <p>
+        <Checkbox v-model="bot">
+          {{ $t('settings.bot') }}
+        </Checkbox>
+      </p>
       <button
         :disabled="newName && newName.length === 0"
         class="btn btn-default"
diff --git a/src/i18n/en.json b/src/i18n/en.json
index eefe10e5..4553d25d 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -266,6 +266,7 @@
     "block_import_error": "Error importing blocks",
     "blocks_imported": "Blocks imported! Processing them will take a while.",
     "blocks_tab": "Blocks",
+    "bot": "This is a bot account",
     "btnRadius": "Buttons",
     "cBlue": "Blue (Reply, follow)",
     "cGreen": "Green (Retweet)",
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index f9a72954..aa78db26 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -130,6 +130,7 @@
     "background": "Фон",
     "bio": "Описание",
     "btnRadius": "Кнопки",
+    "bot": "Это аккаунт бота",
     "cBlue": "Ответить, читать",
     "cGreen": "Повторить",
     "cOrange": "Нравится",
-- 
cgit v1.2.3-70-g09d2

