<commit_before><template>
	<div class="profile">
		<div class="container no-sidebar">
			<div class="columns">
				<!-- heading -->
				<div class="column">
					<h2 class="view-title">
						{{ $t('page.profile') }}
					</h2>
				</div>
			</div>
			<div v-if="ready.users && user" class="columns">
				<div class="column col-4 col-xl-6 col-sm-12 mt-4">
					<div class="panel">
						<div class="panel-header text-center">
							<figure v-if="users[user].photo" class="avatar avatar-xxl mb-2">
								<img :src="users[user].photo" alt="Avatar" />
							</figure>
							<figure
								v-else-if="userName"
								class="avatar avatar-xxl mb-2"
								:data-initial="userName.substring(0,2).toUpperCase()"
							></figure>
							<div v-if="userName" class="panel-title h5">{{ userName }}</div>
							<div v-if="roleName" class="panel-subtitle text-gray">{{ $t('role.' + roleName) }}</div>
						</div>
						<div class="panel-body">
							<div v-if="users[user].email" class="tile tile-centered mb-2">
								<div class="tile-content">
									<div class="tile-title text-bold">{{ $t('field.email') }}</div>
									<div class="tile-subtitle text-gray">{{ users[user].email }}</div>
								</div>
								<div class="tile-icon text-gray">
									<ion-icon name="mail-outline" class="icon-1-5x"></ion-icon>
								</div>
							</div>
							<div v-if="users[user].photo" class="tile tile-centered mb-2">
								<div class="tile-content">
									<div class="tile-title text-bold">{{ $t('field.photo') }}</div>
									<div class="tile-subtitle text-gray">{{ users[user].photo.substr(0,40) }}...</div>
								</div>
								<div class="tile-icon text-gray">
									<ion-icon name="camera-outline" class="icon-1-5x"></ion-icon>
								</div>
							</div>
						</div>
						<div v-if="role" class="panel-footer">
							<router-link
								to="/settings"
								class="btn btn-secondary btn-block text-uppercase mb-1"
								@click.native="open = false"
							>
								<ion-icon name="options"></ion-icon>
								{{ $t('page.settings')}}
								<ion-icon name="create-outline" class="float-right ml-2"></ion-icon>
							</router-link>
						</div>
					</div>
				</div>
				<div v-if="role > 1" class="column col-4 col-xl-6 col-sm-12 mt-4">
					<div class="columns">
						<div class="column col-12">
							<div class="panel">
								<div class="panel-body text-center pb-3">
									<div v-if="!ready.setlists" class="loading loading-xl d-block text-huge">&nbsp;</div>
									<div v-else class="text-huge">{{ Object.keys(setlistsFromUser).length }}</div>
									<div class="panel-title h5">
										<ion-icon name="list" class="mr-2"></ion-icon>
										{{ $t('widget.setlistsCreated')}}
									</div>
								</div>
							</div>
						</div>
						<div class="column col-12 mt-4">
							<div class="panel">
								<div class="panel-body text-center pb-3">
									<div v-if="!ready.setlists" class="loading loading-xl d-block text-huge">&nbsp;</div>
									<div v-else class="text-huge">
										<span class="text-gray">~</span>{{ songsFromUser }}<span class="text-transparent">~</span>
									</div>
									<div class="panel-title h5">
										<ion-icon name="musical-notes" class="mr-2"></ion-icon>
										{{ $t('widget.songsPerformed') }}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- not logged in -->
			<div v-if="ready.users && !user" class="columns">
				<div class="column col-">
					<div class="empty">
						<div class="empty-icon">
							<ion-icon name="eye-off-outline" class="icon-4x"></ion-icon>
						</div>
						<p class="empty-title h5">{{ $t('text.pageNotAvailable') }}</p>
						<p class="empty-subtitle">{{ $t('text.signInForAccess') }}</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	name: 'profile',
	props: ['setlists', 'user', 'users', 'role', 'roleName', 'ready'],
	computed: {
		userName () {
			return this.ready.users ? this.users[this.user].name : '';
		},
		setlistsFromUser () {
			return Object.filter(this.setlists, s => s.creator == this.user);
		},
		songsFromUser () {
			let list = this.setlistsFromUser;
			return Object.keys(list).reduce((previous, key) => previous + list[key].songs.length, 0);
		}
	}
}
</script>
<commit_msg>🔨 fix profile avatar initials<commit_after><template>
	<div class="profile">
		<div class="container no-sidebar">
			<div class="columns">
				<!-- heading -->
				<div class="column">
					<h2 class="view-title">
						{{ $t('page.profile') }}
					</h2>
				</div>
			</div>
			<div v-if="ready.users && user" class="columns">
				<div class="column col-4 col-xl-6 col-sm-12 mt-4">
					<div class="panel">
						<div class="panel-header text-center">
							<div class="mb-3">
								<figure v-if="users[user].photo" id="preview" class="avatar avatar-xxl">
									<img :src="users[user].photo" alt="Avatar" />
								</figure>
								<figure
									v-else-if="users[user].name"
									id="preview"
									class="avatar avatar-xxl"
									:data-initial="initials(users[user].name)"
								></figure>
								<span v-else class="avatar avatar-xxl flex-center">
									<ion-icon class="icon-2x" name="person"></ion-icon>
								</span>
							</div>
							<div v-if="users[user].name" class="panel-title h5">{{ users[user].name }}</div>
							<div v-if="roleName" class="panel-subtitle text-gray">{{ $t('role.' + roleName) }}</div>
						</div>
						<div class="panel-body">
							<div v-if="users[user].email" class="tile tile-centered mb-2">
								<div class="tile-content">
									<div class="tile-title text-bold">{{ $t('field.email') }}</div>
									<div class="tile-subtitle text-gray">{{ users[user].email }}</div>
								</div>
								<div class="tile-icon text-gray">
									<ion-icon name="mail-outline" class="icon-1-5x"></ion-icon>
								</div>
							</div>
							<div v-if="users[user].photo" class="tile tile-centered mb-2">
								<div class="tile-content">
									<div class="tile-title text-bold">{{ $t('field.photo') }}</div>
									<div class="tile-subtitle text-gray">{{ users[user].photo.substr(0,40) }}...</div>
								</div>
								<div class="tile-icon text-gray">
									<ion-icon name="camera-outline" class="icon-1-5x"></ion-icon>
								</div>
							</div>
						</div>
						<div v-if="role" class="panel-footer">
							<router-link
								to="/settings"
								class="btn btn-secondary btn-block text-uppercase mb-1"
								@click.native="open = false"
							>
								<ion-icon name="options"></ion-icon>
								{{ $t('page.settings')}}
								<ion-icon name="create-outline" class="float-right ml-2"></ion-icon>
							</router-link>
						</div>
					</div>
				</div>
				<div v-if="role > 1" class="column col-4 col-xl-6 col-sm-12 mt-4">
					<div class="columns">
						<div class="column col-12">
							<div class="panel">
								<div class="panel-body text-center pb-3">
									<div v-if="!ready.setlists" class="loading loading-xl d-block text-huge">&nbsp;</div>
									<div v-else class="text-huge">{{ Object.keys(setlistsFromUser).length }}</div>
									<div class="panel-title h5">
										<ion-icon name="list" class="mr-2"></ion-icon>
										{{ $t('widget.setlistsCreated')}}
									</div>
								</div>
							</div>
						</div>
						<div class="column col-12 mt-4">
							<div class="panel">
								<div class="panel-body text-center pb-3">
									<div v-if="!ready.setlists" class="loading loading-xl d-block text-huge">&nbsp;</div>
									<div v-else class="text-huge">
										<span class="text-gray">~</span>{{ songsFromUser }}<span class="text-transparent">~</span>
									</div>
									<div class="panel-title h5">
										<ion-icon name="musical-notes" class="mr-2"></ion-icon>
										{{ $t('widget.songsPerformed') }}
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- not logged in -->
			<div v-if="ready.users && !user" class="columns">
				<div class="column col-">
					<div class="empty">
						<div class="empty-icon">
							<ion-icon name="eye-off-outline" class="icon-4x"></ion-icon>
						</div>
						<p class="empty-title h5">{{ $t('text.pageNotAvailable') }}</p>
						<p class="empty-subtitle">{{ $t('text.signInForAccess') }}</p>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
export default {
	name: 'profile',
	props: ['setlists', 'user', 'users', 'role', 'roleName', 'ready'],
	computed: {
		setlistsFromUser () {
			return Object.filter(this.setlists, s => s.creator == this.user);
		},
		songsFromUser () {
			let list = this.setlistsFromUser;
			return Object.keys(list).reduce((previous, key) => previous + list[key].songs.length, 0);
		}
	}
}
</script>

{'fraction_non_alphanumeric': 0.21125962845491617, 'fraction_numerical': 0.0095151789759855, 'mean_word_length': 2.415473887814313, 'pattern_counts': {'":': 0, '<': 243, '<?xml version=': 0, '>': 249, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '474691', 'n_tokens_mistral': 4292, 'n_tokens_neox': 3039, 'n_words': 586}