Files
marechai/Marechai/Areas/Admin/Views/MachinePhotos/Create.cshtml
2020-05-24 02:12:37 +01:00

87 lines
3.6 KiB
Plaintext

@using Marechai.Database.Models
@using Microsoft.AspNetCore.Identity
@model Marechai.Areas.Admin.Models.MachinePhotoViewModel
@inject UserManager<ApplicationUser> UserManager
@{
ViewData["Title"] = "Create";
}
<h1>Create</h1>
<h4>Machine photo</h4>
<hr />
<div class="row">
<div class="col-md-8">
<p>
By uploading this photo you confirm you have the rights on it, and you authorize us the non-exclusive rights of show, and distribution, of the photo in database, and the associated mobile application, under the license chosen below.
</p>
<p>
You also confirm that this photo corresponds, to the best of your knowledge, to the specified machine, accompanying materials (such as box, cabling or manuals on the time of retail).
</p>
<p>
Photos that are not clear enough or of too small resolution will be removed of the database.
</p>
<p>
@* TODO Detect roles *@
This photo will not appear publicly until approved to an administrator.
</p>
<p>
Upload of inappropriate or unrelated photos will create a warning in your account. Several warnings mean your account would be terminated.
</p>
<p>
Removal of your account do not automatically revoke our license to use your photos. If you want to remove your photos contact with an administrator before you remove your account. Failure to do so makes us technically unable to remove your photos in the future.
</p>
</div>
</div>
<div class="row">
<div class="col-md-4">
<form asp-action="Create" enctype="multipart/form-data">
<div asp-validation-summary="ModelOnly" class="text-danger">
</div>
<div class="form-group">
<label asp-for="Machine" class="control-label">
</label>
<select asp-for="MachineId" class="form-control" asp-items="ViewBag.MachineId">
</select>
</div>
<div class="form-group">
<label asp-for="License" class="control-label">
</label>
<select asp-for="LicenseId" class="form-control" asp-items="ViewBag.LicenseId">
</select>
</div>
<div class="form-group">
<label asp-for="UploadUser" class="control-label">
</label>
<input asp-for="UploadUser" class="form-control" value="@UserManager.GetUserName(User)" readonly />
<span asp-validation-for="UploadUser" class="text-danger">
</span>
</div>
<div class="form-group">
<label asp-for="Source" class="control-label">
</label>
<input asp-for="Source" class="form-control" />
</div>
<div class="form-group">
<label asp-for="Photo" class="control-label">
</label>
<input asp-for="Photo" class="form-control" />
<span asp-validation-for="Photo" class="text-danger">
</span>
@if (Model?.ErrorMessage != null)
{
<span class="text-danger">@Model.ErrorMessage</span>
}
</div>
<div class="form-group">
<input class="btn btn-primary" type="submit" value="Create" />
<a asp-action="Index" class="btn btn-secondary">
Back to List
</a>
</div>
</form>
</div>
</div>
@section Scripts {
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}