Add project files.
This commit is contained in:
63
ConstructorAppUI/Views/Testimonial/CreateTestimonial.cshtml
Normal file
63
ConstructorAppUI/Views/Testimonial/CreateTestimonial.cshtml
Normal file
@@ -0,0 +1,63 @@
|
||||
@model CreateTestimonialDto
|
||||
@{
|
||||
ViewData["Title"] = "CreateTestimonial";
|
||||
Layout = "~/Views/AdminLayout/Index.cshtml";
|
||||
}
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<h4 class="page-title">Müşteri Yorumları İşlemleri</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form asp-action="CreateTestimonial" method="post" enctype="multipart/form-data">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">Yeni Müşteri Yorumu Girişi</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label for="Name" class="col-md-2 col-form-label">Adı/Soyadı</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Name" id="Name">
|
||||
<span asp-validation-for="Name" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Title" class="col-md-2 col-form-label">Ünvanı</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Title" id="Title">
|
||||
<span asp-validation-for="Title" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Comment" class="col-md-2 col-form-label">Yorum</label>
|
||||
<div class="col-md-10">
|
||||
<textarea rows="5" class="form-control" asp-for="Comment" id="Comment"></textarea>
|
||||
<span asp-validation-for="Comment" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ImageFile" class="col-md-2 col-form-label">Görsel</label>
|
||||
<div class="col-md-10">
|
||||
<input type="file" class="form-control" asp-for="ImageFile" id="ImageFile">
|
||||
<span asp-validation-for="ImageFile" class="text-danger"></span>
|
||||
<span class="badge badge-danger">Görsel Boyutu 80x80 olmaldır.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action">
|
||||
<button class="btn btn-success">Kaydet</button>
|
||||
<a href="/Testimonial/Index/" class="btn btn-warning ml-2">Listeye Dön</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
107
ConstructorAppUI/Views/Testimonial/Index.cshtml
Normal file
107
ConstructorAppUI/Views/Testimonial/Index.cshtml
Normal file
@@ -0,0 +1,107 @@
|
||||
@using ConstructorApp.EntityLayer.Entities
|
||||
@model List<ResultTestimonialDto>
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
Layout = "~/Views/AdminLayout/Index.cshtml";
|
||||
int count = 0;
|
||||
}
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<h4 class="page-title">Müşterilerden Gelenler İşlemleri</h4>
|
||||
<a href="/Testimonial/CreateTestimonial/" class="btn btn-outline-primary">Yeni Ekle</a>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<table class="table table-head-bg-success table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Adı Soyadı</th>
|
||||
<th scope="col">Ünvanı</th>
|
||||
<th scope="col">Yorum</th>
|
||||
<th scope="col">Görsel</th>
|
||||
<th scope="col">Durumu</th>
|
||||
<th scope="col">İşlemler</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
count++;
|
||||
<tr>
|
||||
<td>@count</td>
|
||||
<td>@item.Name</td>
|
||||
<td>@item.Title</td>
|
||||
<td>@item.Comment</td>
|
||||
<td>
|
||||
<img width="75" height="75" src="@item.ImageUrl" alt="Görsel" />
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge @(item.Status == TestimonialStatus.Confirmed ? "bg-success text-white" : item.Status == TestimonialStatus.Cancelled ? "bg-danger text-white" : "bg-secondary text-white")">
|
||||
@(item.Status == TestimonialStatus.Confirmed ? "Gösterimde" : item.Status == TestimonialStatus.Cancelled ? "Gösterimden Kaldırıldı" : "Onay Bekliyor")
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/Testimonial/UpdateTestimonial/@item.TestimonialID" class="btn btn-outline-success">Güncelle</a>
|
||||
<a href="/Testimonial/TestimonialStatusActive/@item.TestimonialID" class="btn btn-outline-info @(item.Status == TestimonialStatus.Confirmed ? "disabled" : "")">Onay</a>
|
||||
<a href="/Testimonial/TestimonialStatusPassive/@item.TestimonialID" class="btn btn-outline-dark @(item.Status == TestimonialStatus.Cancelled ? "disabled" : "")">Pasif</a>
|
||||
<button onclick="showDeleteConfirmation('@item.TestimonialID')" class="btn btn-outline-danger">Sil</button>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Confirmation Modal -->
|
||||
<div class="modal fade" id="deleteConfirmationModal" tabindex="-1" aria-labelledby="deleteConfirmationModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="deleteConfirmationModalLabel">Müşteri Yorumu Sil</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Bu müşteri yorumunu silmek istediğinize emin misiniz?
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">İptal</button>
|
||||
<form id="deleteForm" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="btn btn-danger">Sil</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var deleteModal = new bootstrap.Modal(document.getElementById('deleteConfirmationModal'));
|
||||
var deleteForm = document.getElementById('deleteForm');
|
||||
|
||||
// Delete modal açma işlevi
|
||||
window.showDeleteConfirmation = function (productId) {
|
||||
deleteForm.action = "/Testimonial/DeleteTestimonial/" + productId;
|
||||
deleteModal.show();
|
||||
};
|
||||
|
||||
// Modal'ın kapanma işlevi için data-bs-dismiss kullanımını kontrol edin
|
||||
document.querySelectorAll('[data-bs-dismiss="modal"]').forEach(function (element) {
|
||||
element.addEventListener('click', function () {
|
||||
deleteModal.hide();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
64
ConstructorAppUI/Views/Testimonial/UpdateTestimonial.cshtml
Normal file
64
ConstructorAppUI/Views/Testimonial/UpdateTestimonial.cshtml
Normal file
@@ -0,0 +1,64 @@
|
||||
@model UpdateTestimonialDto
|
||||
@{
|
||||
ViewData["Title"] = "UpdateTestimonial";
|
||||
Layout = "~/Views/AdminLayout/Index.cshtml";
|
||||
}
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<h4 class="page-title">Müşteri Yorumları İşlemleri</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">Yorum Güncelleme</div>
|
||||
</div>
|
||||
<input type="hidden" asp-for="TestimonialID" />
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label for="Name" class="col-md-2 col-form-label">Adı/Soyadı</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Name" id="Name">
|
||||
<span asp-validation-for="Name" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Title" class="col-md-2 col-form-label">Ünvanı</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Title" id="Title">
|
||||
<span asp-validation-for="Title" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Comment" class="col-md-2 col-form-label">Yorum</label>
|
||||
<div class="col-md-10">
|
||||
<textarea rows="5" class="form-control" asp-for="Comment" id="Comment"></textarea>
|
||||
<span asp-validation-for="Comment" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="ImageFile" class="col-md-2 col-form-label">Görsel</label>
|
||||
<div class="col-md-10">
|
||||
<input type="file" class="form-control" name="ImageFile" id="ImageFile">
|
||||
@if (!string.IsNullOrEmpty(Model.ImageUrl))
|
||||
{
|
||||
<img src="@Model.ImageUrl" alt="Görsel" class="img-fluid mt-2" style="width: 100px; height: 100px;">
|
||||
}
|
||||
</div>
|
||||
<span class="badge badge-danger">Görsel Boyutu 80x80 olmaldır.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<button class="btn btn-success">Kaydet</button>
|
||||
<a href="/Testimonial/Index/" class="btn btn-warning ml-2">Listeye Dön</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user