Add Data-Formations to View

main
Alex 2 years ago
parent 35c9c5da76
commit 46e1e49c4b

@ -18,13 +18,19 @@
document.getElementById("summary").value = game.summary; document.getElementById("summary").value = game.summary;
//document.getElementById("summary").value = "php translate(':summary', 'de') ".replace(':summary', game.summary); //document.getElementById("summary").value = "php translate(':summary', 'de') ".replace(':summary', game.summary);
document.getElementById("release_dates").value = game.release_dates; var first_release_date = new Date(game['first_release_date']*1000);
document.getElementById("release_date").value = first_release_date.getDate()+"."+(first_release_date.getMonth() + 1)+"."+first_release_date.getFullYear();
document.getElementById("platforms").value = formatCollectPlatformAbbreviations(game.platforms); document.getElementById("platforms").value = formatCollectPlatformAbbreviations(game.platforms);
document.getElementById("genres").value = game.genres; var genres = game.genres;
var genre_names = [];
genre_names = genres.map(genre => genre.name);
document.getElementById("genres").value = genre_names;
//document.querySelector('[alt="Game Cover "]').src = game.cover_image_path; //document.querySelector('[alt="Game Cover "]').src = game.cover_image_path;
} }
function formatCategoryToHumanReadable(category) { function formatCategoryToHumanReadable(category) {
let formatedCategory = ""; let formatedCategory = "";
switch (category) { switch (category) {
@ -132,8 +138,8 @@
<textarea name="summary" id="summary" placeholder="" x-model="gameDetails.summary" readonly rows="3" class="w-full p-2 border-gray-300 rounded-md focus:border-blue-500 focus:outline-none focus:shadow-outline-blue dark:bg-gray-700 dark:text-gray-100 dark:border-gray-600"></textarea> <textarea name="summary" id="summary" placeholder="" x-model="gameDetails.summary" readonly rows="3" class="w-full p-2 border-gray-300 rounded-md focus:border-blue-500 focus:outline-none focus:shadow-outline-blue dark:bg-gray-700 dark:text-gray-100 dark:border-gray-600"></textarea>
</div> </div>
<div> <div>
<label for="release_dates" class="block text-sm font-medium text-gray-700 dark:text-gray-400">Release Dates</label> <label for="first_release_date" class="block text-sm font-medium text-gray-700 dark:text-gray-400">Release Date</label>
<input type="text" name="release_dates" id="release_dates" x-model="gameDetails.release_dates" readonly class="w-full p-2 border-gray-300 rounded-md focus:border-blue-500 focus:outline-none focus:shadow-outline-blue dark:bg-gray-700 dark:text-gray-100 dark:border-gray-600"> <input type="text" name="first_release_date" id="release_date" x-model="gameDetails.first_release_date" readonly class="w-full p-2 border-gray-300 rounded-md focus:border-blue-500 focus:outline-none focus:shadow-outline-blue dark:bg-gray-700 dark:text-gray-100 dark:border-gray-600">
</div> </div>
<div> <div>
<label for="platforms" class="block text-sm font-medium text-gray-700 dark:text-gray-400">Platforms</label> <label for="platforms" class="block text-sm font-medium text-gray-700 dark:text-gray-400">Platforms</label>

Loading…
Cancel
Save