Procházet zdrojové kódy

fix(EditUser): small layout improvements

Signed-off-by: Jonathan Graham <theflametrooper@gmail.com>
Jonathan Graham před 3 roky
rodič
revize
3cc3dd2041

+ 1 - 1
frontend/src/components/modals/EditPlaylist/Tabs/Settings.vue

@@ -4,7 +4,7 @@
 			<h4 class="section-title">Edit Details</h4>
 
 			<p class="section-description">
-				Change the display name and privacy of the playlist.
+				Change the display name and privacy of the playlist
 			</p>
 
 			<hr class="section-horizontal-rule" />

+ 82 - 58
frontend/src/components/modals/EditUser.vue

@@ -2,64 +2,78 @@
 	<div>
 		<modal title="Edit User">
 			<template #body v-if="user && user._id">
-				<p class="control has-addons">
-					<input
-						v-model="user.username"
-						class="input is-expanded"
-						type="text"
-						placeholder="Username"
-						autofocus
-					/>
-					<a class="button is-info" @click="updateUsername()"
-						>Update Username</a
-					>
-				</p>
-				<p class="control has-addons">
-					<input
-						v-model="user.email.address"
-						class="input is-expanded"
-						type="text"
-						placeholder="Email Address"
-						autofocus
-					/>
-					<a class="button is-info" @click="updateEmail()"
-						>Update Email Address</a
-					>
-				</p>
-				<p class="control has-addons">
-					<span class="select">
-						<select v-model="user.role">
-							<option>default</option>
-							<option>admin</option>
-						</select>
-					</span>
-					<a class="button is-info" @click="updateRole()"
-						>Update Role</a
-					>
-				</p>
-				<hr />
-				<p class="control has-addons">
-					<span class="select">
-						<select v-model="ban.expiresAt">
-							<option value="1h">1 Hour</option>
-							<option value="12h">12 Hours</option>
-							<option value="1d">1 Day</option>
-							<option value="1w">1 Week</option>
-							<option value="1m">1 Month</option>
-							<option value="3m">3 Months</option>
-							<option value="6m">6 Months</option>
-							<option value="1y">1 Year</option>
-						</select>
-					</span>
-					<input
-						v-model="ban.reason"
-						class="input is-expanded"
-						type="text"
-						placeholder="Ban reason"
-						autofocus
-					/>
-					<a class="button is-error" @click="banUser()">Ban user</a>
-				</p>
+				<div class="section">
+					<label class="label"> Change username </label>
+					<p class="control has-addons">
+						<input
+							v-model="user.username"
+							class="input is-expanded"
+							type="text"
+							placeholder="Username"
+							autofocus
+						/>
+						<a class="button is-info" @click="updateUsername()"
+							>Update Username</a
+						>
+					</p>
+
+					<label class="label"> Change email address </label>
+					<p class="control has-addons">
+						<input
+							v-model="user.email.address"
+							class="input is-expanded"
+							type="text"
+							placeholder="Email Address"
+							autofocus
+						/>
+						<a class="button is-info" @click="updateEmail()"
+							>Update Email Address</a
+						>
+					</p>
+
+					<label class="label"> Change user role </label>
+					<div class="control is-grouped input-with-button">
+						<div class="control is-expanded select">
+							<select v-model="user.role">
+								<option>default</option>
+								<option>admin</option>
+							</select>
+						</div>
+						<p class="control">
+							<a class="button is-info" @click="updateRole()"
+								>Update Role</a
+							>
+						</p>
+					</div>
+				</div>
+
+				<div class="section">
+					<label class="label"> Punish/Ban User </label>
+					<p class="control has-addons">
+						<span class="select">
+							<select v-model="ban.expiresAt">
+								<option value="1h">1 Hour</option>
+								<option value="12h">12 Hours</option>
+								<option value="1d">1 Day</option>
+								<option value="1w">1 Week</option>
+								<option value="1m">1 Month</option>
+								<option value="3m">3 Months</option>
+								<option value="6m">6 Months</option>
+								<option value="1y">1 Year</option>
+							</select>
+						</span>
+						<input
+							v-model="ban.reason"
+							class="input is-expanded"
+							type="text"
+							placeholder="Ban reason"
+							autofocus
+						/>
+						<a class="button is-danger" @click="banUser()"
+							>Ban user</a
+						>
+					</p>
+				</div>
 			</template>
 			<template #footer>
 				<!--button class='button is-warning'>
@@ -122,10 +136,12 @@ export default {
 		},
 		updateUsername() {
 			const { username } = this.user;
+
 			if (!validation.isLength(username, 2, 32))
 				return new Toast(
 					"Username must have between 2 and 32 characters."
 				);
+
 			if (!validation.regex.custom("a-zA-Z0-9_-").test(username))
 				return new Toast(
 					"Invalid username format. Allowed characters: a-z, A-Z, 0-9, _ and -."
@@ -142,10 +158,12 @@ export default {
 		},
 		updateEmail() {
 			const email = this.user.email.address;
+
 			if (!validation.isLength(email, 3, 254))
 				return new Toast(
 					"Email must have between 3 and 254 characters."
 				);
+
 			if (
 				email.indexOf("@") !== email.lastIndexOf("@") ||
 				!validation.regex.emailSimple.test(email) ||
@@ -174,10 +192,12 @@ export default {
 		},
 		banUser() {
 			const { reason } = this.ban;
+
 			if (!validation.isLength(reason, 1, 64))
 				return new Toast(
 					"Reason must have between 1 and 64 characters."
 				);
+
 			if (!validation.regex.ascii.test(reason))
 				return new Toast(
 					"Invalid reason format. Only ascii characters are allowed."
@@ -205,6 +225,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.section {
+	padding: 15px 0 !important;
+}
+
 .save-changes {
 	color: var(--white);
 }

+ 1 - 1
frontend/src/components/modals/Report.vue

@@ -155,7 +155,7 @@
 									? "multiple reports"
 									: "a report"
 							}}
-							about this song already.
+							about this song already
 						</p>
 
 						<hr class="section-horizontal-rule" />

+ 2 - 2
frontend/src/components/modals/RequestSong.vue

@@ -6,7 +6,7 @@
 
 				<h4 class="section-title">Choose a song</h4>
 				<p class="section-description">
-					Choose a song by searching or using a link from YouTube.
+					Choose a song by searching or using a link from YouTube
 				</p>
 
 				<br />
@@ -89,7 +89,7 @@
 
 					<h4 class="section-title">Import a playlist</h4>
 					<p class="section-description">
-						Import a playlist by using a link from YouTube.
+						Import a playlist by using a link from YouTube
 					</p>
 
 					<br />

+ 1 - 1
frontend/src/pages/Profile/Tabs/Playlists.vue

@@ -15,7 +15,7 @@
 						? "and manage your personal"
 						: `${username}'s`
 				}}
-				playlists.
+				playlists
 			</p>
 
 			<hr class="section-horizontal-rule" />

+ 1 - 1
frontend/src/pages/Profile/Tabs/RecentActivity.vue

@@ -6,7 +6,7 @@
 			<p class="section-description">
 				This is a log of all actions
 				{{ userId === myUserId ? "you have" : `${username} has` }}
-				taken recently.
+				taken recently
 			</p>
 
 			<hr class="section-horizontal-rule" />

+ 2 - 2
frontend/src/pages/Settings/Tabs/Account.vue

@@ -2,7 +2,7 @@
 	<div class="content account-tab">
 		<h4 class="section-title">Change account details</h4>
 
-		<p class="section-description">Keep these details up-to-date.</p>
+		<p class="section-description">Keep these details up-to-date</p>
 
 		<hr class="section-horizontal-rule" />
 
@@ -70,7 +70,7 @@
 		<h4 class="section-title">Remove any data we hold on you</h4>
 
 		<p class="section-description">
-			Permanently remove your account and/or data we store on you.
+			Permanently remove your account and/or data we store on you
 		</p>
 
 		<hr class="section-horizontal-rule" />

+ 1 - 1
frontend/src/pages/Settings/Tabs/Preferences.vue

@@ -2,7 +2,7 @@
 	<div class="content preferences-tab">
 		<h4 class="section-title">Change preferences</h4>
 
-		<p class="section-description">Tailor these settings to your liking.</p>
+		<p class="section-description">Tailor these settings to your liking</p>
 
 		<hr class="section-horizontal-rule" />
 

+ 1 - 1
frontend/src/pages/Settings/Tabs/Profile.vue

@@ -2,7 +2,7 @@
 	<div class="content profile-tab">
 		<h4 class="section-title">Change Profile</h4>
 		<p class="section-description">
-			Edit your public profile so users can find out more about you.
+			Edit your public profile so users can find out more about you
 		</p>
 
 		<hr class="section-horizontal-rule" />

+ 5 - 5
frontend/src/pages/Settings/Tabs/Security.vue

@@ -4,7 +4,7 @@
 			<h4 class="section-title">Change password</h4>
 
 			<p class="section-description">
-				You will need to know your previous password.
+				You will need to know your previous password
 			</p>
 
 			<hr class="section-horizontal-rule" />
@@ -85,7 +85,7 @@
 		<div v-if="!isPasswordLinked">
 			<h4 class="section-title">Add a password</h4>
 			<p class="section-description">
-				Add a password, as an alternative to signing in with GitHub.
+				Add a password, as an alternative to signing in with GitHub
 			</p>
 
 			<hr class="section-horizontal-rule" />
@@ -101,7 +101,7 @@
 		<div v-if="!isGithubLinked">
 			<h4 class="section-title">Link your GitHub account</h4>
 			<p class="section-description">
-				Link your Musare account with GitHub.
+				Link your Musare account with GitHub
 			</p>
 
 			<hr class="section-horizontal-rule" />
@@ -119,7 +119,7 @@
 		<div v-if="isPasswordLinked && isGithubLinked">
 			<h4 class="section-title">Remove login methods</h4>
 			<p class="section-description">
-				Remove your password as a login method or unlink GitHub.
+				Remove your password as a login method or unlink GitHub
 			</p>
 
 			<hr class="section-horizontal-rule" />
@@ -145,7 +145,7 @@
 		<div>
 			<h4 class="section-title">Log out everywhere</h4>
 			<p class="section-description">
-				Remove all currently logged-in sessions for your account.
+				Remove all currently logged-in sessions for your account
 			</p>
 
 			<hr class="section-horizontal-rule" />