Initial commit: open-source release of atakanozban.com
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
@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/*" />
|
||||
<small class="text-muted">Leave empty to keep the current logo. 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" })
|
||||
</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>
|
||||
}
|
||||
|
||||
<script>
|
||||
enablePasteUpload('#logoFile', '#logoPreview');
|
||||
</script>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,38 @@
|
||||
@{
|
||||
ViewBag.Title = "index";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,143 @@
|
||||
@model atakanozbancom.Models.classes.AdminMyProjectsEditVM
|
||||
|
||||
@{
|
||||
ViewBag.Title = "myprojectsget";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="mt-3 text-white">My Projects Edit Post</h2>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
<hr />
|
||||
|
||||
@using (Html.BeginForm("myprojectsget", "admin", FormMethod.Post,
|
||||
new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
@Html.HiddenFor(m => m.id)
|
||||
|
||||
@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 />
|
||||
|
||||
@Html.LabelFor(p => p.TitleEN, new { @class = "text-white" })
|
||||
@Html.TextBoxFor(p => p.TitleEN, new { @class = "form-control bg-dark text-white required" })
|
||||
<br />
|
||||
|
||||
@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 />
|
||||
|
||||
<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>
|
||||
<img id="mediaFilePreview" style="display:none;max-width:160px;max-height:120px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;" class="mb-2 d-block" />
|
||||
<input id="mediaFile" type="file" name="mediaFile" class="form-control bg-dark text-white" />
|
||||
<small class="text-muted">Upload image/document files. You can also paste (Ctrl+V) an image directly.</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();
|
||||
})();
|
||||
|
||||
enablePasteUpload('#mediaFile', '#mediaFilePreview');
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
@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>
|
||||
@@ -0,0 +1,140 @@
|
||||
@model atakanozbancom.Models.classes.AdminMyProjectsEditVM
|
||||
@{
|
||||
ViewBag.Title = "Add New Project";
|
||||
Layout = "~/Views/Shared/_AdminLayout.cshtml";
|
||||
}
|
||||
|
||||
<h2 class="text-white mt-3">Add New My Projects Post</h2>
|
||||
@if (TempData["ok"] != null)
|
||||
{<div class="alert alert-success">@TempData["ok"]</div>}
|
||||
<br />
|
||||
|
||||
@using (Html.BeginForm("newmppost", "admin", FormMethod.Post,
|
||||
new { enctype = "multipart/form-data" }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
<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" })
|
||||
<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>
|
||||
|
||||
<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" })
|
||||
<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>
|
||||
<img id="mediaFilePreview" style="display:none;max-width:160px;max-height:120px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;" class="mb-2 d-block" />
|
||||
<input id="mediaFile" type="file" name="mediaFile" class="form-control bg-dark text-white" />
|
||||
<small class="text-muted">Upload image/document files. You can also paste (Ctrl+V) an image directly.</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();
|
||||
})();
|
||||
|
||||
enablePasteUpload('#mediaFile', '#mediaFilePreview');</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,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,38 @@
|
||||
@{
|
||||
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/*" />
|
||||
<small class="text-muted">PNG, JPG, WEBP or GIF. You can also paste (Ctrl+V) an image directly.</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>
|
||||
}
|
||||
|
||||
<script>
|
||||
enablePasteUpload('#wallpaperFile', '#wallpaperPreview');
|
||||
</script>
|
||||
Reference in New Issue
Block a user