Skip to content
Snippets Groups Projects
Verified Commit 84103703 authored by Miniontoby's avatar Miniontoby :writing_hand_tone1:
Browse files

Updated components and also routes for translation stuff

parent df1a3854
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@
</script>
<div>
{#if label && labelText}
<label for={id} class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{labelText}</label>
<label for={id} class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{labelText} {#if required}*{/if}</label>
{/if}
<select
......
......@@ -18,12 +18,12 @@
export let value = '';
const onInput = (/** @type {any} */ e) => {
//value = e.target.value;
// value = e.target.value;
}
</script>
<div>
{#if label && labelText}
<label for={id} class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{labelText}</label>
<label for={id} class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{labelText} {#if required}*{/if}</label>
{/if}
{#if type === 'textarea'}
......
......@@ -121,7 +121,8 @@
"info": {
"title": "User Info",
"edit": {
"title": "Edit User #{id}"
"title": "Edit User #{id}",
"button": "Edit User"
}
},
"create": {
......@@ -136,7 +137,8 @@
"info": {
"title": "Team Info",
"edit": {
"title": "Edit Team #{id}"
"title": "Edit Team #{id}",
"button": "Edit Team"
}
},
"create": {
......@@ -150,11 +152,16 @@
"description": "Here is a list of all the playlists"
},
"info": {
"title": "Playlist Info"
"title": "Playlist Info",
"edit": {
"title": "Edit Playlist #{id}",
"button": "Edit Playlist"
}
},
"create": {
"title": "Create Playlist"
}
},
"no_playlists": "No Playlists"
},
"songs": {
"list": {
......@@ -162,11 +169,16 @@
"description": "Here is a list of all the songs"
},
"info": {
"title": "Song Info"
"title": "Song Info",
"edit": {
"title": "Edit Song #{id}",
"button": "Edit Song"
}
},
"create": {
"title": "Create Song"
}
},
"no_songs": "No Songs"
}
},
"error": {
......
......@@ -24,9 +24,6 @@
let working = false;
/** @type {import('svelte/store').Writable<string>} */
getContext('title').set('playlists.info');
function handleDndConsiderSongs(e) {
songs = e.detail.items;
}
......@@ -40,9 +37,11 @@
playlist.songs = e.detail.items;
}
/** @type {import('svelte/store').Writable<string>} */
getContext('title').set('playlists.info');
</script>
<div transition:slide>
<h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white mb-6">Edit {$_('page.playlists.info.title')}</h1>
<h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white mb-6">{$_('page.playlists.info.edit.title', { values: { id: playlist.id } })}</h1>
{#if !working && form?.success}
<div class="mt-4" transition:slide>
......@@ -107,7 +106,7 @@
<input id="songs" name="songs" type="text" hidden bind:value={songsString} />
<button class="w-full text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" disabled={working}>{$_('actions.edit')}</button>
<button class="w-full text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" disabled={working}>{$_('actions.save')}</button>
</form>
</div>
<style>
......
......@@ -25,17 +25,17 @@
getContext('title').set('songs.info');
</script>
<div transition:slide>
<h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white mb-6">Edit {$_('page.songs.info.title')}</h1>
<h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white mb-6">{$_('page.songs.info.edit.title', { values: { id: song.id } })}</h1>
{#if !working && form?.success}
<div class="mt-4" transition:slide>
<Success message={$_('messages.successfully.updated')} />
<Success message={$_('messages.successfully.edited')} />
</div>
{/if}
{#if !working && form?.success === false}
<div class="mt-4" transition:slide>
<Error message={$_('messages.not_successfully.updated')} />
<Error message={$_('messages.not_successfully.edited')} />
</div>
{/if}
......
......@@ -18,7 +18,7 @@
<div transition:slide>
<h1 class="text-3xl font-bold">{$_('page.playlists.list.title')}</h1>
{#if authUser.roleId <= Roles.Leader}
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto($page.url.pathname + '/create', { replaceState: false })}>Create Playlist</button>
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto($page.url.pathname + '/create', { replaceState: false })}>{$_('page.playlists.create.title')}</button>
{/if}
<p>{$_('page.playlists.list.description')}</p>
<ul class="list-inside list-disc">
......@@ -26,7 +26,7 @@
<li><a href={$page.url.pathname + '/' + playlist.id}>[{playlist.team.name}] {playlist.date.toLocaleDateString()} - {playlist.name}</a></li>
{/each}
{#if playlists.length === 0}
<i>No Playlists</i>
<i>{$_('page.playlists.no_playlists')}</i>
{/if}
</ul>
</div>
......@@ -17,10 +17,10 @@
<div transition:slide>
<h1 class="text-3xl font-bold">{$_('page.playlists.info.title')}</h1>
{#if (authUser.roleId <= Roles.Leader)}
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto(location?.pathname + '/edit', { replaceState: false })}>Edit</button>
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto(location?.pathname + '/edit', { replaceState: false })}>{$_('page.playlists.info.edit.button')}</button>
{/if}
<p><strong>Name:</strong> {playlist.name}</p>
<p><strong>Date:</strong> {playlist.date}</p>
<p><strong>{$_('fields.playlist.name.label')}:</strong> {playlist.name}</p>
<p><strong>{$_('fields.playlist.date.label')}:</strong> {playlist.date.toLocaleDateString()}</p>
<br><hr /><br>
<h2 class="text-2xl font-bold">{$_('page.songs.list.title')}:</h2>
<ul class="list-inside list-disc">
......@@ -28,7 +28,7 @@
<li><a href={"/songs/" + song.id}>{song.name}</a></li>
{/each}
{#if playlist?.songs.length === 0}
<i>No songs</i>
<i>{$_('page.songs.no_songs')}</i>
{/if}
</ul>
</div>
......@@ -19,14 +19,14 @@
<h1 class="text-3xl font-bold">{$_('page.songs.list.title')}</h1>
<p>{$_('page.songs.list.description')}</p>
{#if (authUser.roleId <= Roles.Leader)}
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto(location?.pathname + '/create', { replaceState: false })}>Create</button>
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto(location?.pathname + '/create', { replaceState: false })}>{$_('page.songs.create.title')}</button>
{/if}
<ul class="list-inside list-disc">
{#each songs as song}
<li><a href={$page.url.pathname + "/" + song.id}>{song.name}</a></li>
{/each}
{#if songs.length === 0}
<i>No songs</i>
<i>{$_('page.songs.list.no_songs')}</i>
{/if}
</ul>
</div>
......@@ -19,11 +19,11 @@
<div transition:slide>
<h1 class="text-2xl font-bold">{$_('page.songs.info.title')}</h1>
{#if (authUser.roleId <= Roles.Leader)}
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto(location?.pathname + '/edit', { replaceState: false })}>Edit</button>
<button class="text-white bg-green-600 hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-2.5 py-1.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800" on:click={() => goto(location?.pathname + '/edit', { replaceState: false })}>{$_('page.songs.info.edit.button')}</button>
{/if}
<p><strong>Name:</strong> {song.name}</p>
<p><strong>{$_('fields.song.name.label')}:</strong> {song.name}</p>
<br><hr /><br>
<h3 class="text-xl font-bold">Lyrics:</h3>
<h3 class="text-xl font-bold">{$_('fields.song.lyrics.label')}:</h3><br>
<div class="song_container">
{#each songObject.couplets as couplet, i}
<div class="couplet">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment