Browse Source

refactor: Further sitename usage improvements

Owen Diffey 3 năm trước cách đây
mục cha
commit
1e028fa2de

+ 9 - 3
frontend/src/components/PlaylistItem.vue

@@ -16,8 +16,10 @@
 			</p>
 			<p class="item-description">
 				<span v-if="showOwner"
-					><a v-if="playlist.createdBy === 'Musare'" title="Musare"
-						>Musare</a
+					><a
+						v-if="playlist.createdBy === 'Musare'"
+						:title="sitename"
+						>{{ sitename }}</a
 					><user-id-to-username
 						v-else
 						:user-id="playlist.createdBy"
@@ -48,7 +50,8 @@ export default {
 	},
 	data() {
 		return {
-			utils
+			utils,
+			sitename: "Musare"
 		};
 	},
 	computed: {
@@ -58,6 +61,9 @@ export default {
 			} ${this.playlist.songs.length === 1 ? "song" : "songs"}`;
 		}
 	},
+	async mounted() {
+		this.sitename = await lofig.get("siteSettings.sitename");
+	},
 	methods: {
 		totalLength(playlist) {
 			let length = 0;

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

@@ -1,7 +1,7 @@
 <template>
 	<div class="youtube-tab section">
 		<div>
-			<label class="label"> Search for a song on Musare </label>
+			<label class="label"> Search for a song on {{ sitename }}</label>
 			<div class="control is-grouped input-with-button">
 				<p class="control is-expanded">
 					<input
@@ -151,6 +151,11 @@ import SearchQueryItem from "@/components/SearchQueryItem.vue";
 export default {
 	components: { SearchQueryItem, SongItem },
 	mixins: [SearchYoutube, SearchMusare],
+	data() {
+		return {
+			sitename: "Musare"
+		};
+	},
 	computed: {
 		...mapState("modals/editPlaylist", {
 			playlist: state => state.playlist
@@ -207,6 +212,9 @@ export default {
 				})
 			);
 		}
+	},
+	async mounted() {
+		this.sitename = await lofig.get("siteSettings.sitename");
 	}
 };
 </script>

+ 8 - 4
frontend/src/pages/Home.vue

@@ -147,8 +147,12 @@
 														element.type ===
 														'official'
 													"
-													title="Musare"
-													>Musare</span
+													:title="
+														siteSettings.sitename
+													"
+													>{{
+														siteSettings.sitename
+													}}</span
 												>
 												<user-id-to-username
 													v-else
@@ -385,8 +389,8 @@
 									<span class="host">
 										<span
 											v-if="station.type === 'official'"
-											title="Musare"
-											>Musare</span
+											:title="siteSettings.sitename"
+											>{{ siteSettings.sitename }}</span
 										>
 										<user-id-to-username
 											v-else

+ 1 - 3
frontend/src/pages/Settings/Tabs/Security.vue

@@ -100,9 +100,7 @@
 
 		<div v-if="!isGithubLinked">
 			<h4 class="section-title">Link your GitHub account</h4>
-			<p class="section-description">
-				Link your Musare account with GitHub
-			</p>
+			<p class="section-description">Link your account to GitHub</p>
 
 			<hr class="section-horizontal-rule" />
 

+ 1 - 3
frontend/src/pages/Station/index.vue

@@ -1472,9 +1472,7 @@ export default {
 							// on ios, playback will be forcibly paused locally
 							if (this.isApple) {
 								this.updateLocalPaused(true);
-								new Toast(
-									"Please click play manually to use Musare on iOS."
-								);
+								new Toast("Please click play manually on iOS.");
 							}
 						},
 						onError: err => {