-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ArticleRightSideBarWidgetOptions sınıfı yazıldı.
- Loading branch information
1 parent
1323ab2
commit f03a7a4
Showing
12 changed files
with
408 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
namespace BloggerWay.Entities.ComplexTypes | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace BloggerWay.Entities.ComplexTypes | ||
{ | ||
public enum FilterBy | ||
{ | ||
[Display(Name = "Kategori")] | ||
Category = 0, | ||
[Display(Name = "Tarih")] | ||
Date = 1, | ||
[Display(Name = "Okunma Sayısı")] | ||
ViewCount = 2, | ||
[Display(Name = "Yorum Sayısı")] | ||
CommentCount = 3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
namespace BloggerWay.Entities.ComplexTypes | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace BloggerWay.Entities.ComplexTypes | ||
{ | ||
public enum OrderBy | ||
{ | ||
[Display(Name = "Tarih")] | ||
Date = 0, | ||
[Display(Name = "Okunma Sayısı")] | ||
ViewCount = 1, | ||
[Display(Name = "Yorum Sayısı")] | ||
CommentCount = 2 | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
BloggerWay.Entities/Concrete/ArticleRightSideBarWidgetOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using BloggerWay.Entities.ComplexTypes; | ||
using System; | ||
using System.ComponentModel; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace BloggerWay.Entities.Concrete | ||
{ | ||
public class ArticleRightSideBarWidgetOptions | ||
{ | ||
[DisplayName("Widget Başlığı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[MaxLength(150, ErrorMessage = "{0} alanı en fazla {1} karakter olmalıdır.")] | ||
[MinLength(5, ErrorMessage = "{0} alanı en az {1} karakter olmalıdır.")] | ||
public string Header { get; set; } | ||
[DisplayName("Makale Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[Range(0, 50, ErrorMessage = "{0} alanı en az {1}, en fazla {2} olmalıdır.")] | ||
public int TakeSize { get; set; } | ||
[DisplayName("Kategori")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int CategoryId { get; set; } | ||
[DisplayName("Filtre Türü")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public FilterBy FilterBy { get; set; } | ||
[DisplayName("Sıralama Türü")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public OrderBy OrderBy { get; set; } | ||
[DisplayName("Sıralama Ölçütü")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public bool IsAscending { get; set; } | ||
[DisplayName("Başlangıç Tarihi")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[DataType(DataType.Date, ErrorMessage = "{0} alanı tarih formatında olmalıdır.")] | ||
public DateTime StartAt { get; set; } | ||
[DisplayName("Bitiş Tarihi")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[DataType(DataType.Date, ErrorMessage = "{0} alanı tarih formatında olmalıdır.")] | ||
public DateTime EndAt { get; set; } | ||
[DisplayName("Maksimum Okunma Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MaxViewCount { get; set; } | ||
[DisplayName("Minimum Okunma Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MinViewCount { get; set; } | ||
[DisplayName("Maksimum Yorum Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MaxCommentCount { get; set; } | ||
[DisplayName("Minimum Yorum Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MinCommentCount { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
BloggerWay.MVC/Areas/Admin/Models/ArticleRightSideBarWidgetOptionsViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using BloggerWay.Entities.ComplexTypes; | ||
using BloggerWay.Entities.Concrete; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace BloggerWay.MVC.Areas.Admin.Models | ||
{ | ||
public class ArticleRightSideBarWidgetOptionsViewModel | ||
{ | ||
[DisplayName("Widget Başlığı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[MaxLength(150, ErrorMessage = "{0} alanı en fazla {1} karakter olmalıdır.")] | ||
[MinLength(5, ErrorMessage = "{0} alanı en az {1} karakter olmalıdır.")] | ||
public string Header { get; set; } | ||
[DisplayName("Makale Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[Range(0, 50, ErrorMessage = "{0} alanı en az {1}, en fazla {2} olmalıdır.")] | ||
public int TakeSize { get; set; } | ||
[DisplayName("Kategori")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int CategoryId { get; set; } | ||
[DisplayName("Filtre Türü")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public FilterBy FilterBy { get; set; } | ||
[DisplayName("Sıralama Türü")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public OrderBy OrderBy { get; set; } | ||
[DisplayName("Sıralama Ölçütü")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public bool IsAscending { get; set; } | ||
[DisplayName("Başlangıç Tarihi")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[DataType(DataType.Date, ErrorMessage = "{0} alanı tarih formatında olmalıdır.")] | ||
public DateTime StartAt { get; set; } | ||
[DisplayName("Bitiş Tarihi")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
[DataType(DataType.Date, ErrorMessage = "{0} alanı tarih formatında olmalıdır.")] | ||
public DateTime EndAt { get; set; } | ||
[DisplayName("Maksimum Okunma Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MaxViewCount { get; set; } | ||
[DisplayName("Minimum Okunma Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MinViewCount { get; set; } | ||
[DisplayName("Maksimum Yorum Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MaxCommentCount { get; set; } | ||
[DisplayName("Minimum Yorum Sayısı")] | ||
[Required(ErrorMessage = "{0} alanı zorunludur.")] | ||
public int MinCommentCount { get; set; } | ||
public IList<Category> Categories { get; set; } | ||
} | ||
} |
114 changes: 114 additions & 0 deletions
114
BloggerWay.MVC/Areas/Admin/Views/Options/ArticleRightSideBarWidgetSettings.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
@using BloggerWay.Entities.ComplexTypes | ||
@model BloggerWay.MVC.Areas.Admin.Models.ArticleRightSideBarWidgetOptionsViewModel | ||
|
||
@{ | ||
Layout = "_Layout"; | ||
ViewBag.Title = "Makale Sayfaları için Widget Ayarları"; | ||
|
||
} | ||
<div class="row"> | ||
<div class="col-lg-8 offset-lg-2"> | ||
<div class="card mt-1 mb-1"> | ||
<div class="card-header"> | ||
<h4 class="text-center"><span class="fas fa-edit"></span> Makale Sayfaları için Widget Ayarları</h4> | ||
</div> | ||
<div class="card-body"> | ||
<form asp-controller="Options" asp-action="ArticleRightSideBarWidgetSettings" method="post" id="form-articlerightsidebarwidgetsettings-update"> | ||
<div asp-validation-summary="All" class="text-danger" id="validation-summary"></div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label asp-for="Header"></label> | ||
<input class="form-control" asp-for="Header" placeholder="Lütfen, tercih ettiğiniz widget başlığını giriniz." /> | ||
<span class="text-danger" asp-validation-for="Header"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label asp-for="TakeSize"></label> | ||
<input type="number" class="form-control" asp-for="TakeSize" /> | ||
<span class="text-danger" asp-validation-for="TakeSize"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="filterByList" asp-for="FilterBy"></label> | ||
<select id="filterByList" class="form-control" asp-for="FilterBy" asp-items="Html.GetEnumSelectList<FilterBy>()"> | ||
<option></option> | ||
</select> | ||
<span asp-validation-for="FilterBy" class="text-danger"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="categoryList" asp-for="CategoryId"></label> | ||
<select id="categoryList" class="form-control" asp-for="CategoryId" asp-items="@(new SelectList(Model.Categories,"Id","Name"))"> | ||
<option></option> | ||
</select> | ||
<span asp-validation-for="CategoryId" class="text-danger"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="orderByList" asp-for="OrderBy"></label> | ||
<select id="orderByList" class="form-control" asp-for="OrderBy" asp-items="Html.GetEnumSelectList<OrderBy>()"> | ||
<option></option> | ||
</select> | ||
<span asp-validation-for="OrderBy" class="text-danger"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="isAscendingList" asp-for="IsAscending"></label> | ||
<select id="isAscendingList" class="form-control" asp-for="IsAscending"> | ||
<option></option> | ||
<option value="true">Artan</option> | ||
<option value="false">Azalan</option> | ||
|
||
</select> | ||
<span asp-validation-for="IsAscending" class="text-danger"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="startAtDatePicker" asp-for="StartAt"></label> | ||
<input type="text" id="startAtDatePicker" class="form-control" value="@Model.StartAt.ToShortDateString()" asp-for="StartAt" /> | ||
<span asp-validation-for="StartAt" class="text-danger"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="endAtDatePicker" asp-for="EndAt"></label> | ||
<input type="text" id="endAtDatePicker" class="form-control" value="@Model.EndAt.ToShortDateString()" asp-for="EndAt" /> | ||
<span asp-validation-for="EndAt" class="text-danger"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label asp-for="MinViewCount"></label> | ||
<input type="number" class="form-control" asp-for="MinViewCount" /> | ||
<span class="text-danger" asp-validation-for="MinViewCount"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label asp-for="MaxViewCount"></label> | ||
<input type="number" class="form-control" asp-for="MaxViewCount" /> | ||
<span class="text-danger" asp-validation-for="MaxViewCount"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label asp-for="MinCommentCount"></label> | ||
<input type="number" class="form-control" asp-for="MinCommentCount" /> | ||
<span class="text-danger" asp-validation-for="MinCommentCount"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label asp-for="MaxCommentCount"></label> | ||
<input type="number" class="form-control" asp-for="MaxCommentCount" /> | ||
<span class="text-danger" asp-validation-for="MaxCommentCount"></span> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<button type="submit" class="btn btn-primary"><span class="fas fa-save"></span> Kaydet</button> | ||
<a class="btn btn-danger" asp-area="Admin" asp-controller="Home" asp-action="Index"><span class="fas fa-times"></span> İptal</a> | ||
</div> | ||
</div> | ||
|
||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@section Scripts | ||
{ | ||
<script src="https://cdn.jsdelivr.net/npm/select2@@4.1.0-beta.1/dist/js/select2.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js" integrity="sha512-uto9mlQzrs59VwILcLiRYeLKPPbS/bT71da/OEBYEwcdNUk8jYIy+D176RYoop1Da+f9mvkYrmj5MCLZWEtQuA==" crossorigin="anonymous"></script> | ||
<script src="~/AdminLTE/js/articleRightSideBarWidgetSettings.js" type="application/ecmascript"></script> | ||
} | ||
@section Styles | ||
{ | ||
<link href="https://cdn.jsdelivr.net/npm/select2@@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/themes/cupertino/jquery-ui.min.css" integrity="sha512-ug/p2fTnYRx/TfVgL8ejTWolaq93X+48/FLS9fKf7AiazbxHkSEENdzWkOxbjJO/X1grUPt9ERfBt21iLh2dxg==" crossorigin="anonymous" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/themes/cupertino/theme.min.css" integrity="sha512-adRIgePtMQgAVB+Mfkhl+Nyva/WllWlFzJyyhYCjznU3Di+Z4SsYi1Rqsep11PYLpUsW/SjE4NXUkIjabQJCOQ==" crossorigin="anonymous" /> | ||
<link href="~/AdminLTE/css/select2-bootstrap4.min.css" rel="stylesheet" /> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.