@model MyWebsite.Models.ResumeModel
@{
	ViewData["Title"] = "Edit " + (ViewData["Caption"] ?? "resume");
}

<header>
	&#xE760; <a asp-action="Index">Back to the list</a>
	<h1>Edit @(ViewData["Caption"] ?? "resume")</h1>
	Language: @(new System.Globalization.CultureInfo(Model.Language).DisplayName)<br />
	Previously updated on @Model.LastUpdate<br />

	<a class="comment" onclick="CopyToClipboard()">// &#xE16D; Copy to clipboard</a>
</header>

<article>
	<form method="post">
		<div asp-validation-summary="All" class="text-danger"></div>
		<input type="text" asp-for="Language" hidden />

		<textarea asp-for="Content" spellcheck="false" required></textarea>
		<span asp-validation-for="Content" class="text-danger"></span>

		<br />
		<input type="submit" value="Save" />
	</form>
</article>

@section Imports
{
	<style type="text/css">
		form
		{
			max-width: initial;
		}

		header .comment
		{
			cursor: pointer;
		}

		textarea
		{
			min-height: 500px;
		}
	</style>
	<script type="text/javascript">
		function CopyToClipboard()
		{
			document.querySelector("textarea").select();
			document.execCommand("copy");
			document.getSelection().removeAllRanges();

			alert("CV content copied");
		}
	</script>
}