From 61d40f40aee8b596f0b068091c43033ecf3aa25b Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org>
Date: Sat, 23 Jun 2018 07:53:15 +0000
Subject: allow default visibility scope to be configured

---
 src/components/user_settings/user_settings.vue | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'src/components/user_settings/user_settings.vue')

diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 881b0fa1..1a52da0f 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -10,9 +10,18 @@
         <input class='name-changer' id='username' v-model="newname"></input>
         <p>{{$t('settings.bio')}}</p>
         <textarea class="bio" v-model="newbio"></textarea>
-        <div class="setting-item">
+        <p>
           <input type="checkbox" v-model="newlocked" id="account-locked">
           <label for="account-locked">{{$t('settings.lock_account_description')}}</label>
+        </p>
+        <div v-if="scopeOptionsEnabled">
+          <label for="default-vis">{{$t('settings.default_vis')}}</label>
+          <div id="default-vis" class="visibility-tray">
+             <i v-on:click="changeVis('direct')" class="icon-mail-alt" :class="vis.direct"></i>
+             <i v-on:click="changeVis('private')" class="icon-lock" :class="vis.private"></i>
+             <i v-on:click="changeVis('unlisted')" class="icon-lock-open-alt" :class="vis.unlisted"></i>
+             <i v-on:click="changeVis('public')" class="icon-globe" :class="vis.public"></i>
+          </div>
         </div>
         <button :disabled='newname.length <= 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
       </div>
-- 
cgit v1.2.3-70-g09d2


From 56ddeec8f3452a5b75af713a40d0b5e8fa75b3cd Mon Sep 17 00:00:00 2001
From: Foxhkron <foxhkron@toromino.de>
Date: Sun, 19 Aug 2018 01:23:03 +0200
Subject: Merge upstream

---
 src/components/user_settings/user_settings.js  |  6 ++++-
 src/components/user_settings/user_settings.vue | 32 ++++++++++++++++++--------
 src/i18n/messages.js                           |  5 +++-
 3 files changed, 32 insertions(+), 11 deletions(-)

(limited to 'src/components/user_settings/user_settings.vue')

diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 2b2de913..f046885e 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -18,7 +18,8 @@ const UserSettings = {
       deleteAccountError: false,
       changePasswordInputs: [ '', '', '' ],
       changedPassword: false,
-      changePasswordError: false
+      changePasswordError: false,
+      activeTab: 'profile'
     }
   },
   components: {
@@ -235,6 +236,9 @@ const UserSettings = {
             this.changePasswordError = res.error
           }
         })
+    },
+    activateTab (tabName) {
+      this.activeTab = tabName
     }
   }
 }
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index 1a52da0f..c3ca1dbd 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -4,7 +4,12 @@
       {{$t('settings.user_settings')}}
     </div>
     <div class="panel-body profile-edit">
-      <div class="setting-item">
+      <div class="tab-switcher">
+        <button class="btn btn-default" @click="activateTab('profile')">{{$t('settings.profile_tab')}}</button>
+        <button class="btn btn-default" @click="activateTab('security')">{{$t('settings.security_tab')}}</button>
+        <button class="btn btn-default" @click="activateTab('data_import_export')" v-if="pleromaBackend">{{$t('settings.data_import_export_tab')}}</button>
+      </div>
+      <div class="setting-item" v-if="activeTab == 'profile'">
         <h2>{{$t('settings.name_bio')}}</h2>
         <p>{{$t('settings.name')}}</p>
         <input class='name-changer' id='username' v-model="newname"></input>
@@ -25,7 +30,7 @@
         </div>
         <button :disabled='newname.length <= 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
       </div>
-      <div class="setting-item">
+      <div class="setting-item" v-if="activeTab == 'profile'">
         <h2>{{$t('settings.avatar')}}</h2>
         <p>{{$t('settings.current_avatar')}}</p>
         <img :src="user.profile_image_url_original" class="old-avatar"></img>
@@ -38,7 +43,7 @@
         <i class="icon-spin4 animate-spin" v-if="uploading[0]"></i>
         <button class="btn btn-default" v-else-if="previews[0]" @click="submitAvatar">{{$t('general.submit')}}</button>
       </div>
-      <div class="setting-item">
+      <div class="setting-item" v-if="activeTab == 'profile'">
         <h2>{{$t('settings.profile_banner')}}</h2>
         <p>{{$t('settings.current_profile_banner')}}</p>
         <img :src="user.cover_photo" class="banner"></img>
@@ -51,7 +56,7 @@
         <i class=" icon-spin4 animate-spin uploading" v-if="uploading[1]"></i>
         <button class="btn btn-default" v-else-if="previews[1]" @click="submitBanner">{{$t('general.submit')}}</button>
       </div>
-      <div class="setting-item">
+      <div class="setting-item" v-if="activeTab == 'profile'">
         <h2>{{$t('settings.profile_background')}}</h2>
         <p>{{$t('settings.set_new_profile_background')}}</p>
         <img class="bg" v-bind:src="previews[2]" v-if="previews[2]">
@@ -62,7 +67,7 @@
         <i class=" icon-spin4 animate-spin uploading" v-if="uploading[2]"></i>
         <button class="btn btn-default" v-else-if="previews[2]" @click="submitBg">{{$t('general.submit')}}</button>
       </div>
-      <div class="setting-item">
+      <div class="setting-item" v-if="activeTab == 'security'">
         <h2>{{$t('settings.change_password')}}</h2>
         <div>
           <p>{{$t('settings.current_password')}}</p>
@@ -81,7 +86,7 @@
         <p v-else-if="changePasswordError !== false">{{$t('settings.change_password_error')}}</p>
         <p v-if="changePasswordError">{{changePasswordError}}</p>
       </div>
-      <div class="setting-item" v-if="pleromaBackend">
+      <div class="setting-item" v-if="pleromaBackend && activeTab == 'data_import_export'">
         <h2>{{$t('settings.follow_import')}}</h2>
         <p>{{$t('settings.import_followers_from_a_csv_file')}}</p>
         <form v-model="followImportForm">
@@ -98,15 +103,15 @@
           <p>{{$t('settings.follow_import_error')}}</p>
         </div>
       </div>
-      <div class="setting-item" v-if="enableFollowsExport">
+      <div class="setting-item" v-if="enableFollowsExport && activeTab == 'data_import_export'">
         <h2>{{$t('settings.follow_export')}}</h2>
         <button class="btn btn-default" @click="exportFollows">{{$t('settings.follow_export_button')}}</button>
       </div>
-      <div class="setting-item" v-else>
+      <div class="setting-item" v-else-if="activeTab == 'data_import_export'">
         <h2>{{$t('settings.follow_export_processing')}}</h2>
       </div>
       <hr>
-      <div class="setting-item">
+      <div class="setting-item" v-if="activeTab == 'security'">
         <h2>{{$t('settings.delete_account')}}</h2>
         <p v-if="!deletingAccount">{{$t('settings.delete_account_description')}}</p>
         <div v-if="deletingAccount">
@@ -146,4 +151,13 @@
     margin: 0.25em;
   }
 }
+
+.tab-switcher {
+  margin: 7px 7px;
+  display: inline-block;
+
+  button {
+    height: 30px;
+  }
+}
 </style>
diff --git a/src/i18n/messages.js b/src/i18n/messages.js
index 185db5d9..38e58c4c 100644
--- a/src/i18n/messages.js
+++ b/src/i18n/messages.js
@@ -333,7 +333,10 @@ const en = {
     changed_password: 'Password changed successfully!',
     change_password_error: 'There was an issue changing your password.',
     lock_account_description: 'Restrict your account to approved followers only',
-    default_vis: 'Default visibility scope'
+    default_vis: 'Default visibility scope',
+    profile_tab: 'Profile',
+    security_tab: 'Security',
+    data_import_export_tab: 'Data Import / Export'
   },
   notifications: {
     notifications: 'Notifications',
-- 
cgit v1.2.3-70-g09d2

