Add support page, admin features, and auth hardening.
Rename public affiliate route to /support with localized nav labels, and include affiliate/social/wallpaper admin, 2FA login, and related site updates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
202dc16a52
commit
fc45c35dbe
@@ -0,0 +1,61 @@
|
||||
@model atakanozbancom.Models.classes.AdminAffiliateLinkVM
|
||||
@{
|
||||
ViewBag.Title = "affiliatelinkget";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="mt-3 text-white">Edit Affiliate Link</h2>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
<hr />
|
||||
|
||||
@using (Html.BeginForm("affiliatelinkget", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.HiddenFor(m => m.id)
|
||||
@Html.ValidationSummary(false, "", new { @class = "alert alert-danger" + (ViewData.ModelState.IsValid ? " d-none" : "") })
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="text-white">Current Logo</label><br />
|
||||
<img id="logoPreview" src="@Model.existingImage" alt="@Model.TitleEN" style="@(string.IsNullOrWhiteSpace(Model.existingImage) ? "display:none;" : "")width:64px;height:64px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;" />
|
||||
<input id="logoFile" type="file" name="logoFile" class="form-control bg-dark text-white mt-2" 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">Leave empty to keep the current logo.</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" })
|
||||
</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" })
|
||||
</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 })
|
||||
</div>
|
||||
|
||||
<h3 class="mt-3 text-white">Translation (TR)</h3>
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.TitleTR, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(m => m.TitleTR, new { @class = "form-control bg-dark text-white" })
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.DescTR, new { @class = "text-white" })
|
||||
@Html.TextAreaFor(m => m.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" })
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success">Save</button>
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
@using atakanozbancom.Models.classes
|
||||
@model List<affiliatelink>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "affiliatelinks";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="text-white mt-3 mb-3">Affiliate Links</h2>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
|
||||
<table class="table table-bordered mt-3">
|
||||
<tr class="bg-dark text-white">
|
||||
<th class="bg-dark text-white">Logo</th>
|
||||
<th class="bg-dark text-white">Title</th>
|
||||
<th class="bg-dark text-white">Description</th>
|
||||
<th class="bg-dark text-white">URL</th>
|
||||
<th class="bg-dark text-white">Order</th>
|
||||
<th class="bg-dark text-white">Edit</th>
|
||||
<th class="bg-dark text-white">Delete</th>
|
||||
</tr>
|
||||
@foreach (var x in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="bg-dark text-white"><img src="@x.image" alt="@x.title" style="width:40px;height:40px;object-fit:contain;background:#fff;border-radius:4px;padding:2px;" /></td>
|
||||
<td class="bg-dark text-white">@x.title</td>
|
||||
<td class="bg-dark text-white">@x.description</td>
|
||||
<td class="bg-dark text-white" style="word-break:break-all;">@x.url</td>
|
||||
<td class="bg-dark text-white">@x.sort_order</td>
|
||||
<td class="bg-dark text-white"><a href="/admin/affiliatelinkget/@x.id" class="btn btn-primary">Edit</a></td>
|
||||
<td class="bg-dark text-white">
|
||||
@using (Html.BeginForm("affiliatelinkdelete", "admin", new { id = x.id }, FormMethod.Post, new { onsubmit = "return confirm('Delete this affiliate link?');" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if (!Model.Any())
|
||||
{
|
||||
<tr>
|
||||
<td class="bg-dark text-white-50" colspan="7">No affiliate links yet.</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<a href="/admin/newaffiliatepost" class="btn btn-primary">Create New Affiliate Link</a>
|
||||
+33
-28
@@ -1,33 +1,38 @@
|
||||
@using atakanozbancom.Models.classes
|
||||
@model List<myprojects>
|
||||
|
||||
|
||||
@{
|
||||
@{
|
||||
ViewBag.Title = "index";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="text-white mt-3 mb-3">Posts</h2>
|
||||
|
||||
<table class="table table-bordered mt-3">
|
||||
<tr class="bg-dark text-white">
|
||||
<th class="bg-dark text-white">ID</th>
|
||||
<th class="bg-dark text-white">Title</th>
|
||||
<th class="bg-dark text-white">Description</th>
|
||||
<th class="bg-dark text-white">Edit</th>
|
||||
<th class="bg-dark text-white">Delete</th>
|
||||
</tr>
|
||||
@foreach (var x in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="bg-dark text-white">@x.id</td>
|
||||
<td class="bg-dark text-white">@x.title</td>
|
||||
<td class="bg-dark text-white">@x.description</td>
|
||||
<td class="bg-dark text-white"><a href="/admin/myprojectsget/@x.id" class="btn btn-primary">Edit</a></td>
|
||||
<td class="bg-dark text-white"><a href="/admin/myprojectsdelete/@x.id " class="btn btn-danger">Delete</a></td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
<a href="/admin/newmppost" class="btn btn-primary">Create New Post</a>
|
||||
<h2 class="text-white mt-3 mb-3">Dashboard</h2>
|
||||
<p class="text-white-50">Welcome back! Choose a section from the menu on the left to get started.</p>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="bg-dark border border-secondary rounded p-4 text-white">
|
||||
<h4>My Projects</h4>
|
||||
<p class="text-white-50 mb-3">@ViewBag.MyProjectsCount post(s) published.</p>
|
||||
<a href="/admin/myprojects" class="btn btn-primary">Manage My Projects</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="bg-dark border border-secondary rounded p-4 text-white">
|
||||
<h4>Affiliate Links</h4>
|
||||
<p class="text-white-50 mb-3">@ViewBag.AffiliateLinksCount link(s) published.</p>
|
||||
<a href="/admin/affiliatelinks" class="btn btn-primary">Manage Affiliate Links</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="bg-dark border border-secondary rounded p-4 text-white">
|
||||
<h4>Social Icons</h4>
|
||||
<p class="text-white-50 mb-3">@ViewBag.SocialIconsCount icon(s) in the footer.</p>
|
||||
<a href="/admin/socialicons" class="btn btn-primary">Manage Social Icons</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 mb-3">
|
||||
<div class="bg-dark border border-secondary rounded p-4 text-white">
|
||||
<h4>Wallpaper</h4>
|
||||
<p class="text-white-50 mb-3">Change the background image used across the site.</p>
|
||||
<a href="/admin/wallpaper" class="btn btn-primary">Manage Wallpaper</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
@using atakanozbancom.Models.classes
|
||||
@model List<myprojects>
|
||||
|
||||
|
||||
@{
|
||||
ViewBag.Title = "myprojects";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="text-white mt-3 mb-3">My Projects</h2>
|
||||
|
||||
<table class="table table-bordered mt-3">
|
||||
<tr class="bg-dark text-white">
|
||||
<th class="bg-dark text-white">ID</th>
|
||||
<th class="bg-dark text-white">Title</th>
|
||||
<th class="bg-dark text-white">Description</th>
|
||||
<th class="bg-dark text-white">Edit</th>
|
||||
<th class="bg-dark text-white">Delete</th>
|
||||
</tr>
|
||||
@foreach (var x in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="bg-dark text-white">@x.id</td>
|
||||
<td class="bg-dark text-white">@x.title</td>
|
||||
<td class="bg-dark text-white">@x.description</td>
|
||||
<td class="bg-dark text-white"><a href="/admin/myprojectsget/@x.id" class="btn btn-primary">Edit</a></td>
|
||||
<td class="bg-dark text-white">
|
||||
@using (Html.BeginForm("myprojectsdelete", "admin", new { id = x.id }, FormMethod.Post, new { onsubmit = "return confirm('Delete this project?');" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
<a href="/admin/newmppost" class="btn btn-primary">Create New Post</a>
|
||||
@@ -6,64 +6,138 @@
|
||||
}
|
||||
|
||||
<h2 class="mt-3 text-white">My Projects Edit Post</h2>
|
||||
|
||||
@if (TempData["ok"] != null)
|
||||
{
|
||||
<div class="alert alert-success">@TempData["ok"]</div>
|
||||
}
|
||||
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
<hr />
|
||||
|
||||
@using (Html.BeginForm("myprojectsget", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
@using (Html.BeginForm("myprojectsget", "admin", FormMethod.Post,
|
||||
new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.HiddenFor(m => m.id)
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.id, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(m => m.id, new { @class = "form-control bg-dark text-white", @readonly = "readonly" })
|
||||
</div>
|
||||
@Html.LabelFor(x => x.id, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(x => x.id, new { @class = "form-control bg-dark text-white", @readonly = "readonly" })
|
||||
<br />
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.TitleEN, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(m => m.TitleEN, new { @class = "form-control bg-dark text-white required" })
|
||||
</div>
|
||||
@Html.LabelFor(p => p.TitleEN, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(p => p.TitleEN, new { @class = "form-control bg-dark text-white required" })
|
||||
<br />
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.DescEN, new { @class = "text-white" })
|
||||
@Html.TextAreaFor(m => m.DescEN, new { @class = "form-control bg-dark text-white required", rows = "6" })
|
||||
</div>
|
||||
@Html.LabelFor(p => p.DescEN, new { @class = "text-white" })
|
||||
@Html.TextAreaFor(p => p.DescEN, new { @class = "form-control bg-dark text-white required" })
|
||||
<small class="text-muted">To add a link, use: [Link text](https://example.com)</small>
|
||||
<br />
|
||||
|
||||
if (!string.IsNullOrEmpty(Model.image))
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label class="text-white">Current Image</label>
|
||||
<br />
|
||||
<img src="@Model.image" style="max-width:200px;" class="mb-2" />
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="text-white">Change Image</label>
|
||||
<input type="file" name="file" class="form-control bg-dark text-white" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.iframe, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(m => m.iframe, new { @class = "form-control bg-dark text-white" })
|
||||
</div>
|
||||
|
||||
<h3 class="mt-3 text-white">Translation (TR)</h3>
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.TitleTR, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(m => m.TitleTR, new { @class = "form-control bg-dark text-white required" })
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(m => m.DescTR, new { @class = "text-white" })
|
||||
@Html.TextAreaFor(m => m.DescTR, new { @class = "form-control bg-dark text-white required", rows = "6" })
|
||||
</div>
|
||||
<h3 class="mt-3 text-white">Translation</h3>
|
||||
@Html.LabelFor(m => m.TitleTR, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(m => m.TitleTR, new { @class = "form-control bg-dark text-white required" })
|
||||
<br />
|
||||
@Html.LabelFor(m => m.DescTR, new { @class = "text-white" })
|
||||
@Html.TextAreaFor(m => m.DescTR, new { @class = "form-control bg-dark text-white required" })
|
||||
<small class="text-muted">To add a link, use: [Link text](https://example.com)</small>
|
||||
<br />
|
||||
|
||||
<button class="btn btn-success">Save</button>
|
||||
}
|
||||
}
|
||||
|
||||
<hr />
|
||||
<h3 class="mt-3 text-white">Media Manager</h3>
|
||||
|
||||
@if (Model.medias != null && Model.medias.Count > 0)
|
||||
{
|
||||
<div class="bg-dark p-3 rounded">
|
||||
@foreach (var m in Model.medias)
|
||||
{
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<div class="text-white">
|
||||
<b>@m.media_type</b>
|
||||
<span class="text-muted"> (order: @m.sort_order)</span>
|
||||
<div style="word-break:break-all;">@m.url</div>
|
||||
@*@if (!string.IsNullOrWhiteSpace(m.title))
|
||||
{
|
||||
<div class="text-muted">@m.title</div>
|
||||
}*@
|
||||
</div>
|
||||
|
||||
@using (Html.BeginForm("deletemedia", "admin", new { id = m.id, projectId = Model.id }, FormMethod.Post, new { onsubmit = "return confirm('Delete this media?');" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-danger btn-sm">Delete</button>
|
||||
}
|
||||
</div>
|
||||
<hr class="text-muted" />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted">No media for this project.</div>
|
||||
}
|
||||
|
||||
@using (Html.BeginForm("addmedia", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="projectId" value="@Model.id" />
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="text-white">Type</label>
|
||||
<select id="mediaType" name="mediaType" class="form-control bg-dark text-white">
|
||||
<option value="1">Image</option>
|
||||
<option value="2">Iframe</option>
|
||||
@*<option value="3">Video</option>*@
|
||||
@*<option value="4">Document</option>*@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- IFRAME URL -->
|
||||
<div id="urlWrap" class="mb-2" style="display:none;">
|
||||
<label class="text-white">URL</label>
|
||||
<input id="iframeUrl" name="iframeUrl" class="form-control bg-dark text-white" placeholder="https://..." />
|
||||
<small class="text-muted">Only for iframe embed links.</small>
|
||||
</div>
|
||||
|
||||
<!-- FILE UPLOAD -->
|
||||
<div id="fileWrap" class="mb-2">
|
||||
<label class="text-white">Upload</label>
|
||||
<input id="mediaFile" type="file" name="mediaFile" class="form-control bg-dark text-white" />
|
||||
<button type="button" class="btn btn-outline-light btn-sm mt-2" onclick="PasteImageModal.open('#mediaFile')">
|
||||
<i class="fa-solid fa-paste me-1"></i>Paste image
|
||||
</button>
|
||||
<small class="text-muted d-block mt-1">Upload image/document files.</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="text-white">Sort Order</label>
|
||||
<input name="sortOrder" type="number" value="0" class="form-control bg-dark text-white" />
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary">Add Media</button>
|
||||
}
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var sel = document.getElementById("mediaType");
|
||||
var urlWrap = document.getElementById("urlWrap");
|
||||
var fileWrap = document.getElementById("fileWrap");
|
||||
var iframeUrl = document.getElementById("iframeUrl");
|
||||
var mediaFile = document.getElementById("mediaFile");
|
||||
|
||||
function sync() {
|
||||
var isIframe = sel.value === "2"; // Iframe
|
||||
urlWrap.style.display = isIframe ? "block" : "none";
|
||||
fileWrap.style.display = isIframe ? "none" : "block";
|
||||
|
||||
// optional: clear the hidden field so server doesn't get junk
|
||||
if (isIframe) {
|
||||
if (mediaFile) mediaFile.value = "";
|
||||
} else {
|
||||
if (iframeUrl) iframeUrl.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
sel.addEventListener("change", sync);
|
||||
sync();
|
||||
})();
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
@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>
|
||||
}
|
||||
+102
-11
@@ -22,16 +22,7 @@
|
||||
<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" })
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="text-white">Project Image</label>
|
||||
<input type="file" name="file" class="form-control bg-dark text-white" />
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(p => p.iframe, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(p => p.iframe, new { @class = "form-control bg-dark text-white" })
|
||||
<small class="text-muted">To add a link, use: [Link text](https://example.com)</small>
|
||||
</div>
|
||||
|
||||
<h3 class="mt-3 text-white">Translation (TR)</h3>
|
||||
@@ -44,7 +35,107 @@
|
||||
<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" })
|
||||
<small class="text-muted">To add a link, use: [Link text](https://example.com)</small>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success">Save</button>
|
||||
}
|
||||
}
|
||||
|
||||
<hr />
|
||||
<h3 class="mt-3 text-white">Media Manager</h3>
|
||||
|
||||
@if (Model.medias != null && Model.medias.Count > 0)
|
||||
{
|
||||
<div class="bg-dark p-3 rounded">
|
||||
@foreach (var m in Model.medias)
|
||||
{
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<div class="text-white">
|
||||
<b>@m.media_type</b>
|
||||
<span class="text-muted"> (order: @m.sort_order)</span>
|
||||
<div style="word-break:break-all;">@m.url</div>
|
||||
@*@if (!string.IsNullOrWhiteSpace(m.title))
|
||||
{
|
||||
<div class="text-muted">@m.title</div>
|
||||
}*@
|
||||
</div>
|
||||
|
||||
@using (Html.BeginForm("deletemedia", "admin", new { id = m.id, projectId = Model.id }, FormMethod.Post, new { onsubmit = "return confirm('Delete this media?');" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-danger btn-sm">Delete</button>
|
||||
}
|
||||
</div>
|
||||
<hr class="text-muted" />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="text-muted">No media for this project.</div>
|
||||
}
|
||||
|
||||
@using (Html.BeginForm("addmedia", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<input type="hidden" name="projectId" value="@Model.id" />
|
||||
|
||||
<div class="mb-2">
|
||||
<label class="text-white">Type</label>
|
||||
<select id="mediaType" name="mediaType" class="form-control bg-dark text-white">
|
||||
<option value="1">Image</option>
|
||||
<option value="2">Iframe</option>
|
||||
@*<option value="3">Video</option>*@
|
||||
@*<option value="4">Document</option>*@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- IFRAME URL -->
|
||||
<div id="urlWrap" class="mb-2" style="display:none;">
|
||||
<label class="text-white">URL</label>
|
||||
<input id="iframeUrl" name="iframeUrl" class="form-control bg-dark text-white" placeholder="https://..." />
|
||||
<small class="text-muted">Only for iframe embed links.</small>
|
||||
</div>
|
||||
|
||||
<!-- FILE UPLOAD -->
|
||||
<div id="fileWrap" class="mb-2">
|
||||
<label class="text-white">Upload</label>
|
||||
<input id="mediaFile" type="file" name="mediaFile" class="form-control bg-dark text-white" />
|
||||
<button type="button" class="btn btn-outline-light btn-sm mt-2" onclick="PasteImageModal.open('#mediaFile')">
|
||||
<i class="fa-solid fa-paste me-1"></i>Paste image
|
||||
</button>
|
||||
<small class="text-muted d-block mt-1">Upload image/document files.</small>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="text-white">Sort Order</label>
|
||||
<input name="sortOrder" type="number" value="0" class="form-control bg-dark text-white" />
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary">Add Media</button>
|
||||
}
|
||||
|
||||
<script>(function () {
|
||||
var sel = document.getElementById("mediaType");
|
||||
var urlWrap = document.getElementById("urlWrap");
|
||||
var fileWrap = document.getElementById("fileWrap");
|
||||
var iframeUrl = document.getElementById("iframeUrl");
|
||||
var mediaFile = document.getElementById("mediaFile");
|
||||
|
||||
function sync() {
|
||||
var isIframe = sel.value === "2"; // Iframe
|
||||
urlWrap.style.display = isIframe ? "block" : "none";
|
||||
fileWrap.style.display = isIframe ? "none" : "block";
|
||||
|
||||
// optional: clear the hidden field so server doesn't get junk
|
||||
if (isIframe) {
|
||||
if (mediaFile) mediaFile.value = "";
|
||||
} else {
|
||||
if (iframeUrl) iframeUrl.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
sel.addEventListener("change", sync);
|
||||
sync();
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
@model atakanozbancom.Models.classes.AdminSocialIconVM
|
||||
@{
|
||||
ViewBag.Title = "Add New Social Icon";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" />
|
||||
|
||||
<h2 class="text-white mt-3">Add New Social Icon</h2>
|
||||
<hr />
|
||||
|
||||
@using (Html.BeginForm("newsocialicon", "admin", FormMethod.Post))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.ValidationSummary(false, "", new { @class = "alert alert-danger" + (ViewData.ModelState.IsValid ? " d-none" : "") })
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(p => p.icon, new { @class = "text-white" })
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-dark text-white fs-4" style="width:3rem;justify-content:center;">
|
||||
<i id="icon-preview" class="@Model.icon"></i>
|
||||
</span>
|
||||
@Html.TextBoxFor(p => p.icon, new { @class = "form-control bg-dark text-white", placeholder = "e.g. fa-brands fa-youtube", id = "icon-input" })
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
Any <a href="https://fontawesome.com/search?ic=brands" target="_blank" rel="noopener" class="text-info">Font Awesome</a> class name, e.g. <code>fa-brands fa-youtube</code> or <code>fa-solid fa-link</code>.
|
||||
</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.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>
|
||||
document.getElementById('icon-input').addEventListener('input', function () {
|
||||
document.getElementById('icon-preview').className = this.value;
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
@{
|
||||
// Kept for old bookmarks; controller redirects to UserSettings.
|
||||
Layout = null;
|
||||
Response.Redirect(Url.Action("UserSettings", "admin"));
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
@model atakanozbancom.Models.classes.AdminSocialIconVM
|
||||
@{
|
||||
ViewBag.Title = "socialiconget";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" />
|
||||
|
||||
<h2 class="mt-3 text-white">Edit Social Icon</h2>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
<hr />
|
||||
|
||||
@using (Html.BeginForm("socialiconget", "admin", FormMethod.Post))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.HiddenFor(m => m.id)
|
||||
@Html.ValidationSummary(false, "", new { @class = "alert alert-danger" + (ViewData.ModelState.IsValid ? " d-none" : "") })
|
||||
|
||||
<div class="mb-3">
|
||||
@Html.LabelFor(p => p.icon, new { @class = "text-white" })
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-dark text-white fs-4" style="width:3rem;justify-content:center;">
|
||||
<i id="icon-preview" class="@Model.icon"></i>
|
||||
</span>
|
||||
@Html.TextBoxFor(p => p.icon, new { @class = "form-control bg-dark text-white", id = "icon-input" })
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
Any <a href="https://fontawesome.com/search?ic=brands" target="_blank" rel="noopener" class="text-info">Font Awesome</a> class name, e.g. <code>fa-brands fa-youtube</code> or <code>fa-solid fa-link</code>.
|
||||
</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" })
|
||||
</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" })
|
||||
</div>
|
||||
|
||||
<button class="btn btn-success">Save</button>
|
||||
}
|
||||
|
||||
<script>
|
||||
document.getElementById('icon-input').addEventListener('input', function () {
|
||||
document.getElementById('icon-preview').className = this.value;
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,49 @@
|
||||
@using atakanozbancom.Models.classes
|
||||
@model List<socialicon>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "socialicons";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" />
|
||||
|
||||
<h2 class="text-white mt-3 mb-3">Social Icons</h2>
|
||||
<p class="text-white-50">These appear as the icon row at the bottom of every public page.</p>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
|
||||
<table class="table table-bordered mt-3">
|
||||
<tr class="bg-dark text-white">
|
||||
<th class="bg-dark text-white">Icon</th>
|
||||
<th class="bg-dark text-white">Class</th>
|
||||
<th class="bg-dark text-white">URL</th>
|
||||
<th class="bg-dark text-white">Order</th>
|
||||
<th class="bg-dark text-white">Edit</th>
|
||||
<th class="bg-dark text-white">Delete</th>
|
||||
</tr>
|
||||
@foreach (var x in Model)
|
||||
{
|
||||
<tr>
|
||||
<td class="bg-dark text-white fs-4"><i class="@x.icon"></i></td>
|
||||
<td class="bg-dark text-white">@x.icon</td>
|
||||
<td class="bg-dark text-white" style="word-break:break-all;">@x.url</td>
|
||||
<td class="bg-dark text-white">@x.sort_order</td>
|
||||
<td class="bg-dark text-white"><a href="/admin/socialiconget/@x.id" class="btn btn-primary">Edit</a></td>
|
||||
<td class="bg-dark text-white">
|
||||
@using (Html.BeginForm("socialicondelete", "admin", new { id = x.id }, FormMethod.Post, new { onsubmit = "return confirm('Delete this icon?');" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-danger">Delete</button>
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
@if (!Model.Any())
|
||||
{
|
||||
<tr>
|
||||
<td class="bg-dark text-white-50" colspan="6">No social icons yet.</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
<a href="/admin/newsocialicon" class="btn btn-primary">Create New Icon</a>
|
||||
@@ -0,0 +1,116 @@
|
||||
@{
|
||||
ViewBag.Title = "User Settings";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
var enabled = ViewBag.TwoFactorEnabled == true;
|
||||
}
|
||||
|
||||
<h2 class="text-white mt-3 mb-3">User Settings</h2>
|
||||
<p class="text-white-50">Account: <strong class="text-white">@ViewBag.Username</strong></p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6 mb-4">
|
||||
<div class="bg-dark border border-secondary rounded p-4 text-white h-100">
|
||||
<h4 class="mb-3">Change password</h4>
|
||||
|
||||
@if (TempData["pwdOk"] != null)
|
||||
{
|
||||
<div class="alert alert-success py-2">@TempData["pwdOk"]</div>
|
||||
}
|
||||
@if (TempData["pwdError"] != null)
|
||||
{
|
||||
<div class="alert alert-danger py-2">@TempData["pwdError"]</div>
|
||||
}
|
||||
|
||||
@using (Html.BeginForm("ChangePassword", "admin", FormMethod.Post))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Current password</label>
|
||||
<input type="password" name="currentPassword" class="form-control bg-dark text-white" autocomplete="current-password" required />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">New password</label>
|
||||
<input type="password" name="newPassword" class="form-control bg-dark text-white" autocomplete="new-password" minlength="8" required />
|
||||
<small class="text-muted">At least 8 characters.</small>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Confirm new password</label>
|
||||
<input type="password" name="confirmPassword" class="form-control bg-dark text-white" autocomplete="new-password" minlength="8" required />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Update password</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 mb-4">
|
||||
<div class="bg-dark border border-secondary rounded p-4 text-white h-100">
|
||||
<h4 class="mb-3">
|
||||
Two-factor authentication
|
||||
@if (enabled)
|
||||
{
|
||||
<span class="badge text-bg-success ms-2">Enabled</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="badge text-bg-secondary ms-2">Disabled</span>
|
||||
}
|
||||
</h4>
|
||||
|
||||
@if (TempData["tfaOk"] != null)
|
||||
{
|
||||
<div class="alert alert-success py-2">@TempData["tfaOk"]</div>
|
||||
}
|
||||
@if (TempData["tfaError"] != null)
|
||||
{
|
||||
<div class="alert alert-danger py-2">@TempData["tfaError"]</div>
|
||||
}
|
||||
|
||||
@if (enabled)
|
||||
{
|
||||
<p class="text-white-50">2FA is active. Enter a current authenticator code to disable it.</p>
|
||||
using (Html.BeginForm("DisableTwoFactor", "admin", FormMethod.Post))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Authenticator code</label>
|
||||
<input type="text" name="code" class="form-control bg-dark text-white" maxlength="6" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" required />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Disable two-factor authentication?');">Disable 2FA</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<ol class="text-white-50">
|
||||
<li>Open your authenticator app and scan the QR code below.</li>
|
||||
<li>Or enter this secret manually: <code class="text-white">@ViewBag.SetupSecret</code></li>
|
||||
<li>Enter the 6-digit code to confirm and enable 2FA.</li>
|
||||
</ol>
|
||||
|
||||
<div class="text-center my-3">
|
||||
<div id="totpQr" class="d-inline-block bg-white p-2 rounded"></div>
|
||||
</div>
|
||||
|
||||
using (Html.BeginForm("EnableTwoFactor", "admin", FormMethod.Post))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Authenticator code</label>
|
||||
<input type="text" name="code" class="form-control bg-dark text-white" maxlength="6" inputmode="numeric" pattern="[0-9]*" autocomplete="one-time-code" required />
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success">Enable 2FA</button>
|
||||
}
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
|
||||
<script>
|
||||
(function () {
|
||||
var uri = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject((string)ViewBag.OtpAuthUri));
|
||||
var el = document.getElementById('totpQr');
|
||||
if (el && uri && typeof QRCode !== 'undefined') {
|
||||
new QRCode(el, { text: uri, width: 200, height: 200 });
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
@{
|
||||
ViewBag.Title = "wallpaper";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="text-white mt-3 mb-3">Wallpaper</h2>
|
||||
<p class="text-white-50">This image is used as the background on every public page.</p>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="text-white d-block mb-2">Current wallpaper</label>
|
||||
<img src="@ViewBag.CurrentWallpaper" style="max-width:100%;max-height:300px;border-radius:8px;border:1px solid #444;" />
|
||||
</div>
|
||||
|
||||
@using (Html.BeginForm("Wallpaper", "admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="text-white">New wallpaper image</label>
|
||||
<img id="wallpaperPreview" style="display:none;max-width:100%;max-height:300px;border-radius:8px;" class="mb-2 d-block" />
|
||||
<input id="wallpaperFile" type="file" name="wallpaperFile" class="form-control bg-dark text-white" accept="image/*" />
|
||||
<button type="button" class="btn btn-outline-light btn-sm mt-2" onclick="PasteImageModal.open('#wallpaperFile', '#wallpaperPreview')">
|
||||
<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>
|
||||
|
||||
<button class="btn btn-success">Upload New Wallpaper</button>
|
||||
}
|
||||
|
||||
@using (Html.BeginForm("WallpaperReset", "admin", FormMethod.Post, new { onsubmit = "return confirm('Reset wallpaper to the default image?');" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-secondary mt-2">Reset to Default</button>
|
||||
}
|
||||
Reference in New Issue
Block a user