2017-08-02 12:09:40 -07:00
|
|
|
<template>
|
2018-03-31 11:14:36 -07:00
|
|
|
<div class="settings panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2017-11-07 06:14:37 -08:00
|
|
|
{{$t('settings.user_settings')}}
|
2017-08-02 12:09:40 -07:00
|
|
|
</div>
|
|
|
|
<div class="panel-body profile-edit">
|
2018-08-27 12:22:25 -07:00
|
|
|
<tab-switcher>
|
2018-08-28 06:22:49 -07:00
|
|
|
<div :label="$t('settings.profile_tab')">
|
2018-08-27 12:22:25 -07:00
|
|
|
<div class="setting-item" >
|
|
|
|
<h2>{{$t('settings.name_bio')}}</h2>
|
|
|
|
<p>{{$t('settings.name')}}</p>
|
2018-12-13 04:58:38 -08:00
|
|
|
<input class='name-changer' id='username' v-model="newName"></input>
|
2018-08-27 12:22:25 -07:00
|
|
|
<p>{{$t('settings.bio')}}</p>
|
2018-12-13 04:58:38 -08:00
|
|
|
<textarea class="bio" v-model="newBio"></textarea>
|
2018-08-27 12:22:25 -07:00
|
|
|
<p>
|
2018-12-13 04:58:38 -08:00
|
|
|
<input type="checkbox" v-model="newLocked" id="account-locked">
|
2018-08-27 12:22:25 -07:00
|
|
|
<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">
|
2018-12-03 09:12:43 -08:00
|
|
|
<i v-on:click="changeVis('direct')" class="icon-mail-alt" :class="vis.direct" :title="$t('post_status.scope.direct')" ></i>
|
|
|
|
<i v-on:click="changeVis('private')" class="icon-lock" :class="vis.private" :title="$t('post_status.scope.private')"></i>
|
|
|
|
<i v-on:click="changeVis('unlisted')" class="icon-lock-open-alt" :class="vis.unlisted" :title="$t('post_status.scope.unlisted')"></i>
|
|
|
|
<i v-on:click="changeVis('public')" class="icon-globe" :class="vis.public" :title="$t('post_status.scope.public')"></i>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-21 20:54:05 -07:00
|
|
|
<p>
|
2018-12-13 04:58:38 -08:00
|
|
|
<input type="checkbox" v-model="newNoRichText" id="account-no-rich-text">
|
2018-09-21 20:54:05 -07:00
|
|
|
<label for="account-no-rich-text">{{$t('settings.no_rich_text_description')}}</label>
|
|
|
|
</p>
|
2018-12-13 04:58:38 -08:00
|
|
|
<p>
|
2019-01-29 14:11:40 -08:00
|
|
|
<input type="checkbox" v-model="hideFollowings" id="account-hide-followings">
|
|
|
|
<label for="account-hide-followings">{{$t('settings.hide_followings_description')}}</label>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<input type="checkbox" v-model="hideFollowers" id="account-hide-followers">
|
|
|
|
<label for="account-hide-followers">{{$t('settings.hide_followers_description')}}</label>
|
2018-12-13 04:58:38 -08:00
|
|
|
</p>
|
|
|
|
<button :disabled='newName.length <= 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
|
|
|
<div class="setting-item">
|
|
|
|
<h2>{{$t('settings.avatar')}}</h2>
|
|
|
|
<p>{{$t('settings.current_avatar')}}</p>
|
|
|
|
<img :src="user.profile_image_url_original" class="old-avatar"></img>
|
|
|
|
<p>{{$t('settings.set_new_avatar')}}</p>
|
2018-12-13 00:25:03 -08:00
|
|
|
<img class="new-avatar" v-bind:src="avatarPreview" v-if="avatarPreview">
|
2018-08-27 12:22:25 -07:00
|
|
|
</img>
|
|
|
|
<div>
|
2018-12-13 06:44:37 -08:00
|
|
|
<input type="file" @change="uploadFile('avatar', $event)" ></input>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
2018-12-13 00:25:03 -08:00
|
|
|
<i class="icon-spin4 animate-spin" v-if="avatarUploading"></i>
|
|
|
|
<button class="btn btn-default" v-else-if="avatarPreview" @click="submitAvatar">{{$t('general.submit')}}</button>
|
|
|
|
<div class='alert error' v-if="avatarUploadError">
|
|
|
|
Error: {{ avatarUploadError }}
|
2018-12-18 10:26:14 -08:00
|
|
|
<i class="button-icon icon-cancel" @click="clearUploadError('avatar')"></i>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="setting-item">
|
|
|
|
<h2>{{$t('settings.profile_banner')}}</h2>
|
|
|
|
<p>{{$t('settings.current_profile_banner')}}</p>
|
|
|
|
<img :src="user.cover_photo" class="banner"></img>
|
|
|
|
<p>{{$t('settings.set_new_profile_banner')}}</p>
|
2018-12-13 00:25:03 -08:00
|
|
|
<img class="banner" v-bind:src="bannerPreview" v-if="bannerPreview">
|
2018-08-27 12:22:25 -07:00
|
|
|
</img>
|
|
|
|
<div>
|
2018-12-13 06:44:37 -08:00
|
|
|
<input type="file" @change="uploadFile('banner', $event)" ></input>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
2018-12-13 00:25:03 -08:00
|
|
|
<i class=" icon-spin4 animate-spin uploading" v-if="bannerUploading"></i>
|
|
|
|
<button class="btn btn-default" v-else-if="bannerPreview" @click="submitBanner">{{$t('general.submit')}}</button>
|
|
|
|
<div class='alert error' v-if="bannerUploadError">
|
|
|
|
Error: {{ bannerUploadError }}
|
2018-12-18 10:26:14 -08:00
|
|
|
<i class="button-icon icon-cancel" @click="clearUploadError('banner')"></i>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="setting-item">
|
|
|
|
<h2>{{$t('settings.profile_background')}}</h2>
|
|
|
|
<p>{{$t('settings.set_new_profile_background')}}</p>
|
2018-12-13 00:25:03 -08:00
|
|
|
<img class="bg" v-bind:src="backgroundPreview" v-if="backgroundPreview">
|
2018-08-27 12:22:25 -07:00
|
|
|
</img>
|
|
|
|
<div>
|
2018-12-13 06:44:37 -08:00
|
|
|
<input type="file" @change="uploadFile('background', $event)" ></input>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
2018-12-13 00:25:03 -08:00
|
|
|
<i class=" icon-spin4 animate-spin uploading" v-if="backgroundUploading"></i>
|
|
|
|
<button class="btn btn-default" v-else-if="backgroundPreview" @click="submitBg">{{$t('general.submit')}}</button>
|
|
|
|
<div class='alert error' v-if="backgroundUploadError">
|
|
|
|
Error: {{ backgroundUploadError }}
|
2018-12-18 10:26:14 -08:00
|
|
|
<i class="button-icon icon-cancel" @click="clearUploadError('background')"></i>
|
2018-08-27 12:22:25 -07:00
|
|
|
</div>
|
2018-06-23 00:53:15 -07:00
|
|
|
</div>
|
2018-05-29 07:19:28 -07:00
|
|
|
</div>
|
2018-08-27 12:22:25 -07:00
|
|
|
|
2018-08-28 06:22:49 -07:00
|
|
|
<div :label="$t('settings.security_tab')">
|
2018-08-27 12:22:25 -07:00
|
|
|
<div class="setting-item">
|
|
|
|
<h2>{{$t('settings.change_password')}}</h2>
|
|
|
|
<div>
|
|
|
|
<p>{{$t('settings.current_password')}}</p>
|
|
|
|
<input type="password" v-model="changePasswordInputs[0]">
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<p>{{$t('settings.new_password')}}</p>
|
|
|
|
<input type="password" v-model="changePasswordInputs[1]">
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<p>{{$t('settings.confirm_new_password')}}</p>
|
|
|
|
<input type="password" v-model="changePasswordInputs[2]">
|
|
|
|
</div>
|
|
|
|
<button class="btn btn-default" @click="changePassword">{{$t('general.submit')}}</button>
|
|
|
|
<p v-if="changedPassword">{{$t('settings.changed_password')}}</p>
|
|
|
|
<p v-else-if="changePasswordError !== false">{{$t('settings.change_password_error')}}</p>
|
|
|
|
<p v-if="changePasswordError">{{changePasswordError}}</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="setting-item">
|
|
|
|
<h2>{{$t('settings.delete_account')}}</h2>
|
|
|
|
<p v-if="!deletingAccount">{{$t('settings.delete_account_description')}}</p>
|
|
|
|
<div v-if="deletingAccount">
|
|
|
|
<p>{{$t('settings.delete_account_instructions')}}</p>
|
|
|
|
<p>{{$t('login.password')}}</p>
|
|
|
|
<input type="password" v-model="deleteAccountConfirmPasswordInput">
|
|
|
|
<button class="btn btn-default" @click="deleteAccount">{{$t('settings.delete_account')}}</button>
|
|
|
|
</div>
|
|
|
|
<p v-if="deleteAccountError !== false">{{$t('settings.delete_account_error')}}</p>
|
|
|
|
<p v-if="deleteAccountError">{{deleteAccountError}}</p>
|
|
|
|
<button class="btn btn-default" v-if="!deletingAccount" @click="confirmDelete">{{$t('general.submit')}}</button>
|
|
|
|
</div>
|
2017-12-23 06:44:22 -08:00
|
|
|
</div>
|
2018-08-27 12:22:25 -07:00
|
|
|
|
2018-08-28 06:22:49 -07:00
|
|
|
<div :label="$t('settings.data_import_export_tab')" v-if="pleromaBackend">
|
2018-08-27 12:22:25 -07:00
|
|
|
<div class="setting-item">
|
|
|
|
<h2>{{$t('settings.follow_import')}}</h2>
|
|
|
|
<p>{{$t('settings.import_followers_from_a_csv_file')}}</p>
|
2019-01-31 07:00:31 -08:00
|
|
|
<form>
|
2018-08-27 12:22:25 -07:00
|
|
|
<input type="file" ref="followlist" v-on:change="followListChange"></input>
|
|
|
|
</form>
|
2018-12-13 00:25:03 -08:00
|
|
|
<i class=" icon-spin4 animate-spin uploading" v-if="followListUploading"></i>
|
2018-08-27 12:22:25 -07:00
|
|
|
<button class="btn btn-default" v-else @click="importFollows">{{$t('general.submit')}}</button>
|
|
|
|
<div v-if="followsImported">
|
|
|
|
<i class="icon-cross" @click="dismissImported"></i>
|
|
|
|
<p>{{$t('settings.follows_imported')}}</p>
|
|
|
|
</div>
|
|
|
|
<div v-else-if="followImportError">
|
|
|
|
<i class="icon-cross" @click="dismissImported"></i>
|
|
|
|
<p>{{$t('settings.follow_import_error')}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="setting-item" v-if="enableFollowsExport">
|
|
|
|
<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>
|
|
|
|
<h2>{{$t('settings.follow_export_processing')}}</h2>
|
|
|
|
</div>
|
2018-05-13 07:09:07 -07:00
|
|
|
</div>
|
2018-08-27 12:22:25 -07:00
|
|
|
</tab-switcher>
|
2017-08-02 12:09:40 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./user_settings.js">
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.profile-edit {
|
2018-04-07 09:30:27 -07:00
|
|
|
.bio {
|
|
|
|
margin: 0;
|
|
|
|
}
|
2018-03-31 11:14:36 -07:00
|
|
|
|
2018-04-07 09:30:27 -07:00
|
|
|
input[type=file] {
|
|
|
|
padding: 5px;
|
2018-05-29 12:44:45 -07:00
|
|
|
height: auto;
|
2018-04-07 09:30:27 -07:00
|
|
|
}
|
2018-03-31 11:14:36 -07:00
|
|
|
|
2018-04-07 09:30:27 -07:00
|
|
|
.banner {
|
|
|
|
max-width: 400px;
|
|
|
|
}
|
2017-08-02 12:09:40 -07:00
|
|
|
|
2018-04-07 09:30:27 -07:00
|
|
|
.uploading {
|
|
|
|
font-size: 1.5em;
|
|
|
|
margin: 0.25em;
|
|
|
|
}
|
2017-08-02 12:09:40 -07:00
|
|
|
}
|
|
|
|
</style>
|