Files
atakanozbancom/Views/admin/newaffiliatepost.cshtml
T

61 lines
2.5 KiB
Plaintext
Raw Normal View History

@model atakanozbancom.Models.classes.AdminAffiliateLinkVM
@{
ViewBag.Title = "Add New Affiliate Link";
Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
<h2 class="text-white mt-3">Add New Affiliate Link</h2>
<hr />
@using (Html.BeginForm("newaffiliatepost", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(false, "", new { @class = "alert alert-danger" + (ViewData.ModelState.IsValid ? " d-none" : "") })
<div class="mb-3">
<label class="text-white">Logo</label>
<img id="logoPreview" style="display:none;width:64px;height:64px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;" class="mb-2" />
<input id="logoFile" type="file" name="logoFile" class="form-control bg-dark text-white" accept="image/*" />
<small class="text-muted">PNG, JPG, WEBP or GIF. You can also paste (Ctrl+V) an image directly.</small>
</div>
<div class="mb-3">
@Html.LabelFor(p => p.url, new { @class = "text-white" })
@Html.TextBoxFor(p => p.url, new { @class = "form-control bg-dark text-white", placeholder = "https://..." })
</div>
<div class="mb-3">
@Html.LabelFor(p => p.TitleEN, new { @class = "text-white" })
@Html.TextBoxFor(p => p.TitleEN, new { @class = "form-control bg-dark text-white", placeholder = "e.g. Hetzner" })
</div>
<div class="mb-3">
@Html.LabelFor(p => p.DescEN, new { @class = "text-white" })
@Html.TextAreaFor(p => p.DescEN, new { @class = "form-control bg-dark text-white", rows = 2, placeholder = "e.g. Get $20 free credit" })
</div>
<h3 class="mt-3 text-white">Translation (TR)</h3>
<div class="mb-3">
@Html.LabelFor(p => p.TitleTR, new { @class = "text-white" })
@Html.TextBoxFor(p => p.TitleTR, new { @class = "form-control bg-dark text-white" })
</div>
<div class="mb-3">
@Html.LabelFor(p => p.DescTR, new { @class = "text-white" })
@Html.TextAreaFor(p => p.DescTR, new { @class = "form-control bg-dark text-white", rows = 2 })
</div>
<div class="mb-3">
@Html.LabelFor(p => p.sort_order, new { @class = "text-white" })
@Html.TextBoxFor(p => p.sort_order, new { @class = "form-control bg-dark text-white", type = "number" })
<small class="text-muted">Lower numbers show first.</small>
</div>
<button class="btn btn-success">Save</button>
}
<script>
enablePasteUpload('#logoFile', '#logoPreview');
</script>