Files
atakanozbancom/Views/admin/newaffiliatepost.cshtml
T

60 lines
2.6 KiB
Plaintext

@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 d-block" />
<input id="logoFile" type="file" name="logoFile" class="form-control bg-dark text-white" accept="image/*" />
<button type="button" class="btn btn-outline-light btn-sm mt-2" onclick="PasteImageModal.open('#logoFile', '#logoPreview')">
<i class="fa-solid fa-paste me-1"></i>Paste image
</button>
<small class="text-muted d-block mt-1">PNG, JPG, WEBP or GIF.</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>
}