Add project files.
This commit is contained in:
135
ConstructorAppUI/Views/Team/CreateTeam.cshtml
Normal file
135
ConstructorAppUI/Views/Team/CreateTeam.cshtml
Normal file
@@ -0,0 +1,135 @@
|
||||
@model CreateTeamDto
|
||||
@{
|
||||
ViewData["Title"] = "CreateTeam";
|
||||
Layout = "~/Views/AdminLayout/Index.cshtml";
|
||||
}
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<h4 class="page-title">Ana Sayfa Ekibimiz İşlemleri</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form asp-action="CreateTeam" method="post" enctype="multipart/form-data" id="sliderForm">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">Yeni Ekip Üye Girişi</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label for="NameSurname" class="col-md-2 col-form-label">Adı Soyadı</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="NameSurname" id="NameSurname">
|
||||
<span asp-validation-for="NameSurname" 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="Facebook" class="col-md-2 col-form-label">Facebook</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Facebook" id="Facebook">
|
||||
<span asp-validation-for="Facebook" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Instagram" class="col-md-2 col-form-label">Instagram</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Instagram" id="Instagram">
|
||||
<span asp-validation-for="Instagram" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Linkedin" class="col-md-2 col-form-label">Linkedin</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Linkedin" id="Linkedin">
|
||||
<span asp-validation-for="Linkedin" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Görsel -->
|
||||
<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">Tema Bütünlüğü için Görsel Boyutu 290x284 olmaldır.</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action">
|
||||
<div id="errorMessages" class="text-danger mb-3"></div>
|
||||
<button class="btn btn-success">Kaydet</button>
|
||||
<a href="/Team/Index/" class="btn btn-warning ml-2">Listeye Dön</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Formdaki alanlar boş geçilemesin *@
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const form = document.getElementById("sliderForm");
|
||||
const errorDiv = document.getElementById("errorMessages");
|
||||
|
||||
const fields = [
|
||||
{ id: "NameSurname", name: "Adı Soyadı" },
|
||||
{ id: "Title", name: "Ünvan" },
|
||||
{ id: "ImageFile", name: "Görsel" }
|
||||
];
|
||||
|
||||
// Her input için focus olduğunda çerçeveyi temizle
|
||||
fields.forEach(field => {
|
||||
const input = document.getElementById(field.id);
|
||||
input.addEventListener("focus", function () {
|
||||
input.style.border = "";
|
||||
errorDiv.innerHTML = ""; // Hataları da temizle (isteğe bağlı)
|
||||
});
|
||||
});
|
||||
|
||||
// Form submit kontrolü
|
||||
form.addEventListener("submit", function (e) {
|
||||
let isValid = true;
|
||||
let messages = [];
|
||||
|
||||
errorDiv.innerHTML = ""; // Önceki mesajları temizle
|
||||
|
||||
fields.forEach(field => {
|
||||
const input = document.getElementById(field.id);
|
||||
if (input.value.trim() === "") {
|
||||
isValid = false;
|
||||
messages.push(`<li>${field.name} alanı boş olamaz.</li>`);
|
||||
input.style.border = "2px solid red";
|
||||
}
|
||||
});
|
||||
|
||||
if (!isValid) {
|
||||
e.preventDefault();
|
||||
errorDiv.innerHTML = `<ul>${messages.join("")}</ul>`;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.input-error {
|
||||
border: 2px solid red !important;
|
||||
box-shadow: 0 0 4px rgba(255, 0, 0, 0.5);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
115
ConstructorAppUI/Views/Team/Index.cshtml
Normal file
115
ConstructorAppUI/Views/Team/Index.cshtml
Normal file
@@ -0,0 +1,115 @@
|
||||
@model List<ResultTeamDto>
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
Layout = "~/Views/AdminLayout/Index.cshtml";
|
||||
int count = 0;
|
||||
}
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<h4 class="page-title">Ana Sayfa Ekibimiz İşlemleri</h4>
|
||||
<a href="/Team/CreateTeam/" 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">Facebook</th>
|
||||
<th scope="col">Instagram</th>
|
||||
<th scope="col">Linkedin</th>
|
||||
<th scope="col">Görsel</th>
|
||||
<th scope="col">İşlemler</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (Model == null || !Model.Any())
|
||||
{
|
||||
<tr>
|
||||
<td colspan="3">Kayıt bulunamadı.</td>
|
||||
</tr>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
count++;
|
||||
<tr>
|
||||
<td>@count</td>
|
||||
<td>@item.NameSurname</td>
|
||||
<td>@item.Title</td>
|
||||
<td>@item.Facebook</td>
|
||||
<td>@item.Instagram</td>
|
||||
<td>@item.Linkedin</td>
|
||||
<td>
|
||||
<img width="75" height="75" src="@item.ImageUrl" alt="Görsel" />
|
||||
</td>
|
||||
<td>
|
||||
<a href="/Team/UpdateTeam/@item.TeamID" class="btn btn-outline-success">Güncelle</a>
|
||||
<button onclick="showDeleteConfirmation('@item.TeamID')" 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">Ekip Üyesi Sil</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Bu ekip üyesini 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 (teamId) {
|
||||
deleteForm.action = "/Team/DeleteTeam/" + teamId;
|
||||
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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
135
ConstructorAppUI/Views/Team/UpdateTeam.cshtml
Normal file
135
ConstructorAppUI/Views/Team/UpdateTeam.cshtml
Normal file
@@ -0,0 +1,135 @@
|
||||
@model UpdateTeamDto
|
||||
@{
|
||||
ViewData["Title"] = "UpdateTeam";
|
||||
Layout = "~/Views/AdminLayout/Index.cshtml";
|
||||
}
|
||||
|
||||
<div class="content">
|
||||
<div class="container-fluid">
|
||||
<h4 class="page-title">Ana Sayfa Ekibimiz İşlemleri</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form method="post" enctype="multipart/form-data" id="sliderForm">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">Ekip Üyesi Güncelleme</div>
|
||||
</div>
|
||||
<input type="hidden" asp-for="TeamID" />
|
||||
<div class="card-body">
|
||||
<div class="form-group row">
|
||||
<label for="NameSurname" class="col-md-2 col-form-label">Adı Soyadı</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="NameSurname" id="NameSurname">
|
||||
<span asp-validation-for="NameSurname" 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="Facebook" class="col-md-2 col-form-label">Facebook</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Facebook" id="Facebook">
|
||||
<span asp-validation-for="Facebook" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Instagram" class="col-md-2 col-form-label">Instagram</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Instagram" id="Instagram">
|
||||
<span asp-validation-for="Instagram" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="Linkedin" class="col-md-2 col-form-label">Linkedin</label>
|
||||
<div class="col-md-10">
|
||||
<input type="text" class="form-control" asp-for="Linkedin" id="Linkedin">
|
||||
<span asp-validation-for="Linkedin" class="text-danger"></span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Görsel -->
|
||||
<div class="form-group row">
|
||||
<label for="ImageFile" class="col-md-2 col-form-label">Görsel</label>
|
||||
<div class="col-md-10">
|
||||
<span class="badge badge-danger">Tema Bütünlüğü için Görsel Boyutu 290x284 olmaldır.</span>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<div id="errorMessages" class="text-danger mb-3"></div>
|
||||
<button class="btn btn-success">Kaydet</button>
|
||||
<a href="/Team/Index/" class="btn btn-warning ml-2">Listeye Dön</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@* Formdaki alanlar boş geçilemesin *@
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const form = document.getElementById("sliderForm");
|
||||
const errorDiv = document.getElementById("errorMessages");
|
||||
|
||||
const fields = [
|
||||
{ id: "NameSurname", name: "Adı Soyadı" },
|
||||
{ id: "Title", name: "Ünvan" },
|
||||
];
|
||||
|
||||
// Her input için focus olduğunda çerçeveyi temizle
|
||||
fields.forEach(field => {
|
||||
const input = document.getElementById(field.id);
|
||||
input.addEventListener("focus", function () {
|
||||
input.style.border = "";
|
||||
errorDiv.innerHTML = ""; // Hataları da temizle (isteğe bağlı)
|
||||
});
|
||||
});
|
||||
|
||||
// Form submit kontrolü
|
||||
form.addEventListener("submit", function (e) {
|
||||
let isValid = true;
|
||||
let messages = [];
|
||||
|
||||
errorDiv.innerHTML = ""; // Önceki mesajları temizle
|
||||
|
||||
fields.forEach(field => {
|
||||
const input = document.getElementById(field.id);
|
||||
if (input.value.trim() === "") {
|
||||
isValid = false;
|
||||
messages.push(`<li>${field.name} alanı boş olamaz.</li>`);
|
||||
input.style.border = "2px solid red";
|
||||
}
|
||||
});
|
||||
|
||||
if (!isValid) {
|
||||
e.preventDefault();
|
||||
errorDiv.innerHTML = `<ul>${messages.join("")}</ul>`;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.input-error {
|
||||
border: 2px solid red !important;
|
||||
box-shadow: 0 0 4px rgba(255, 0, 0, 0.5);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user