This commit is contained in:
İsmail ÇAĞDAŞ 2024-01-22 15:54:02 +03:00
Родитель 5ef3a76193
Коммит 3e7dc77b41
10 изменённых файлов: 108 добавлений и 115 удалений

Просмотреть файл

@ -9,9 +9,9 @@ http://qasample.aspnetboilerplate.com/
To run the sample:
- Open the solution with Visual Studio.
- Set `ModuleZeroSampleProject.Web` as your startup project.
- Check the connection string in Web.config and change if necessary.
- Run database migrations: Run 'Update-Database' command from Package Manager Console while ModuleZeroSampleProject.EntityFramework is selected as default project. This creates database and populates initial data.
- Run database migrations by running.`QuestionsAnswers.Migrator` project.
- Set `QuestionsAnswers.Web` as your startup project.
- Check the connection string in `appsettings.json` and change if necessary.
- Run the application! That's it.
![alt login form](https://raw.githubusercontent.com/aspnetboilerplate/questions-answers/master/doc/login-form.png)

Просмотреть файл

@ -26,7 +26,7 @@
"SortedBy": "Şuna Göre Sırala",
"SortAscending": "Artan Sırala",
"SortDescending": "Azalan Sırala",
"RememberMe": "Beni Hatırla"
"RememberMe": "Beni Hatırla",
"ThereAreNoQuestionsToShow" : "Gösterilecek soru bulunmuyor!"
}
}

Просмотреть файл

@ -26,8 +26,7 @@
"SortedBy": "Sorted by",
"SortAscending": "Sort by Ascending",
"SortDescending": "Sort by Descending",
"RememberMe": "Remember me"
"RememberMe": "Remember me",
"ThereAreNoQuestionsToShow" : "There are no questions to show!"
}
}

Просмотреть файл

@ -18,8 +18,8 @@ namespace QuestionsAnswers.Migrator
using (var bootstrapper = AbpBootstrapper.Create<QuestionsAnswersMigratorModule>())
{
bootstrapper.IocManager.IocContainer
.AddFacility<LoggingFacility>(
f => f.UseAbpLog4Net().WithConfig("log4net.config")
.AddFacility<LoggingFacility>(f => f.UseAbpLog4Net()
.WithConfig("log4net.config")
);
bootstrapper.Initialize();

Просмотреть файл

@ -19,6 +19,12 @@
</Content>
</ItemGroup>
<ItemGroup>
<None Update="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Abp.Castle.Log4Net" Version="9.0.0" />
<PackageReference Include="Castle.Windsor.MsDependencyInjection" Version="4.1.0" />

Просмотреть файл

@ -7,7 +7,6 @@
@section scripts {
<script src="~/view-resources/Views/Question/Index.js" asp-append-version="true"></script>
}
<div class="command-list row">

Просмотреть файл

@ -1,4 +1,5 @@
@using System.Globalization
@using Abp.Runtime.Session
@using Abp.Timing
@using QuestionsAnswers.Web.Views.Shared.Components.LanguageSelection
@using QuestionsAnswers.Web.Views.Shared.Components.TopMenu
@ -6,6 +7,7 @@
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
@using Abp.Web.Mvc.Alerts
@inject IAlertManager AlertManager
@inject IAbpSession AbpSession
@{
AbpAntiForgeryManager.SetCookie(Context);
}
@ -25,139 +27,122 @@
<!-- Global styles -->
<environment names="Development">
<link rel="stylesheet" href="~/lib/bootstrap-paper/bootstrap.css" />
<link rel="stylesheet" href="~/lib/toastr/toastr.css" />
<link rel="stylesheet" href="~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css" />
<link rel="stylesheet" href="~/lib/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="~/lib/bootstrap-paper/bootstrap.css"/>
<link rel="stylesheet" href="~/lib/toastr/toastr.css"/>
<link rel="stylesheet" href="~/lib/famfamfam-flags/dist/sprite/famfamfam-flags.css"/>
<link rel="stylesheet" href="~/lib/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="~/css/main.css" />
<link rel="stylesheet" href="~/css/main.css"/>
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="~/view-resources/Views/_Bundles/layout-libs.min.css" asp-append-version="true" />
<link rel="stylesheet" href="~/view-resources/Views/_Bundles/layout-libs.min.css" asp-append-version="true"/>
</environment>
<!-- View specific styles -->
@RenderSection("styles", required: false)
@*<script type="text/javascript">
//This is used to get the application's root path from javascript. It's useful if you're running application in a virtual directory under IIS.
var abp = abp || {}; abp.appPath = '@ApplicationPath';
</script>*@
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
@*<!--[if lt IE 9]>
<script src="@Url.Content("~/Scripts/others/html5shiv.js")"></script>
<script src="@Url.Content("~/Scripts/others/respond.min.js")"></script>
<![endif]-->*@
@*@Scripts.Render("~/Bundles/vendor/js/top")*@
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="~/"><i class="fa fa-cubes"></i> QuestionsAnswers</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
@await Component.InvokeAsync(typeof(TopMenuViewComponent), new { activeMenu = ViewBag.ActiveMenu })
</ul>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="~/"><i class="fa fa-cubes"></i> QuestionsAnswers</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
@await Component.InvokeAsync(typeof(TopMenuViewComponent), new {activeMenu = ViewBag.ActiveMenu})
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="@Url.Action("Logout", "Account")"><i class="fa fa-sign-out"></i> Logout</a>
</li>
</ul>
@if (AbpSession.UserId.HasValue)
{
<ul class="nav navbar-nav navbar-right">
@await Component.InvokeAsync(typeof(LanguageSelectionViewComponent))
<li>
<a href="@Url.Action("Logout", "Account")"><i class="fa fa-sign-out"></i> Logout</a>
</li>
</ul>
}
</div>
<ul class="nav navbar-nav navbar-right">
@await Component.InvokeAsync(typeof(LanguageSelectionViewComponent))
</ul>
</div>
</div>
</div>
<div class="container body-content">
@if (AlertManager.Alerts.Any())
{
<div id="AbpPageAlerts">
@foreach (var alertMessage in AlertManager.Alerts)
{
<div class="alert alert-@alertMessage.Type.ToString().ToLower() @(alertMessage.Dismissible ? "alert-dismisable" : "")" role="alert">
<h4 class="alert-heading">
@alertMessage.Title
@if (alertMessage.Dismissible)
{
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
}
</h4>
<div class="container body-content">
@if (AlertManager.Alerts.Any())
{
<div id="AbpPageAlerts">
@foreach (var alertMessage in AlertManager.Alerts)
{
<div class="alert alert-@alertMessage.Type.ToString().ToLower() @(alertMessage.Dismissible ? "alert-dismisable" : "")" role="alert">
<h4 class="alert-heading">
@alertMessage.Title
@if (alertMessage.Dismissible)
{
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
}
</h4>
<p>@alertMessage.Text</p>
</div>
}
</div>
}
<p>@alertMessage.Text</p>
</div>
}
</div>
}
@RenderBody()
</div>
@RenderBody()
</div>
<!-- Global scripts -->
<!-- Global scripts -->
<environment names="Development">
<script src="~/lib/json2/json2.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/lib/moment/min/moment-with-locales.js"></script>
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/blockUI/jquery.blockUI.js"></script>
<script src="~/lib/toastr/toastr.js"></script>
<script src="~/lib/sweetalert/dist/sweetalert.min.js"></script>
<script src="~/lib/spin.js/spin.js"></script>
<script src="~/lib/spin.js/jquery.spin.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/abp.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js"></script>
<script src="~/js/main.js" asp-append-version="true"></script>
<environment names="Development">
<script src="~/lib/json2/json2.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="~/lib/moment/min/moment-with-locales.js"></script>
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/blockUI/jquery.blockUI.js"></script>
<script src="~/lib/toastr/toastr.js"></script>
<script src="~/lib/sweetalert/dist/sweetalert.min.js"></script>
<script src="~/lib/spin.js/spin.js"></script>
<script src="~/lib/spin.js/jquery.spin.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/abp.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js"></script>
<script src="~/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js"></script>
<script src="~/js/main.js" asp-append-version="true"></script>
</environment>
</environment>
<environment names="Staging,Production">
<script src="~/view-resources/Views/_Bundles/layout-libs.min.js" asp-append-version="true"></script>
</environment>
<environment names="Staging,Production">
<script src="~/view-resources/Views/_Bundles/layout-libs.min.js" asp-append-version="true"></script>
</environment>
<script>
<script>
abp.localization.defaultSourceName = '@LocalizationSourceName';
if (moment) { //Localizing momentjs
moment.locale('@CultureInfo.CurrentUICulture.Name');
}
</script>
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
<script src="~/AbpServiceProxies/GetAll?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
<script src="~/AbpScripts/GetScripts?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
<script src="~/AbpServiceProxies/GetAll?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
<script src="~/AbpScripts/GetScripts?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
<!-- View specific scripts -->
<!-- View specific scripts -->
@RenderSection("scripts", required: false)
@RenderSection("scripts", required: false)
</body>
</html>
</html>

Просмотреть файл

@ -2,7 +2,7 @@
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="App_Data/Logs/Logs.txt" />
<file value="Logs/Logs.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />

Просмотреть файл

@ -2,7 +2,7 @@
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="../../../App_Data/Logs/Logs.txt" />
<file value="Logs/Logs.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />

Просмотреть файл

@ -19,7 +19,6 @@
skipCount: skipCount,
sorting: sorting
}).done(function (data) {
console.log(data);
if (append) {
for (var i = 0; i < data.items.length; i++) {
questions.push(data.items[i]);
@ -44,6 +43,11 @@
var questionList = $('#QuestionList');
questionList.empty();
if (questions.length == 0) {
questionList.append('<div class="col-xs-12 text-center">' + abp.localization.localize('ThereAreNoQuestionsToShow') + '</div>');
return;
}
for (var i = 0; i < questions.length; i++) {
var questionHtml = createQuestionHtml(questions[i]);
questionList.append(questionHtml);