Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ziya Mollamahmut
committed
Aug 12, 2018
1 parent
071e5c3
commit 2779704
Showing
171 changed files
with
105,318 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.27703.2047 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyTrips", "MyTrips\MyTrips.csproj", "{BFDACA78-4F94-42F4-BE5E-058B037FD0FA}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{BFDACA78-4F94-42F4-BE5E-058B037FD0FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{BFDACA78-4F94-42F4-BE5E-058B037FD0FA}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{BFDACA78-4F94-42F4-BE5E-058B037FD0FA}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{BFDACA78-4F94-42F4-BE5E-058B037FD0FA}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {D6DFC55F-32C7-4E91-AB29-BBB66FB30763} | ||
EndGlobalSection | ||
EndGlobal |
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,27 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.App" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="Resources\MyDataAnnotations.Designer.cs"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>MyDataAnnotations.resx</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Update="Resources\MyDataAnnotations.resx"> | ||
<Generator>PublicResXFileCodeGenerator</Generator> | ||
<LastGenOutput>MyDataAnnotations.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
</Project> |
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,23 @@ | ||
@page | ||
@model ErrorModel | ||
@{ | ||
ViewData["Title"] = "Error"; | ||
} | ||
|
||
<h1 class="text-danger">Error.</h1> | ||
<h2 class="text-danger">An error occurred while processing your request.</h2> | ||
|
||
@if (Model.ShowRequestId) | ||
{ | ||
<p> | ||
<strong>Request ID:</strong> <code>@Model.RequestId</code> | ||
</p> | ||
} | ||
|
||
<h3>Development Mode</h3> | ||
<p> | ||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred. | ||
</p> | ||
<p> | ||
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application. | ||
</p> |
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,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace MyTrips.Pages | ||
{ | ||
public class ErrorModel : PageModel | ||
{ | ||
public string RequestId { get; set; } | ||
|
||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); | ||
|
||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] | ||
public void OnGet() | ||
{ | ||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; | ||
} | ||
} | ||
} |
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,18 @@ | ||
@page | ||
@model IndexModel | ||
@{ | ||
ViewData["Title"] = "Home page"; | ||
} | ||
|
||
@{ | ||
var culture = System.Globalization.CultureInfo.CurrentCulture.Name; | ||
} | ||
|
||
<div class="row"> | ||
<div class="col-md-3"> | ||
<h2>Samples</h2> | ||
<ul> | ||
<li><a asp-page="Trips" asp-route-culture="@culture">My Trips</a></li> | ||
</ul> | ||
</div> | ||
</div> |
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,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
|
||
namespace MyTrips.Pages | ||
{ | ||
public class IndexModel : PageModel | ||
{ | ||
public void OnGet() | ||
{ | ||
|
||
} | ||
} | ||
} |
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,41 @@ | ||
@using Microsoft.AspNetCore.Http.Features | ||
|
||
@{ | ||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>(); | ||
var showBanner = !consentFeature?.CanTrack ?? false; | ||
var cookieString = consentFeature?.CreateConsentCookie(); | ||
} | ||
|
||
@if (showBanner) | ||
{ | ||
<nav id="cookieConsent" class="navbar navbar-default navbar-fixed-top" role="alert"> | ||
<div class="container"> | ||
<div class="navbar-header"> | ||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#cookieConsent .navbar-collapse"> | ||
<span class="sr-only">Toggle cookie consent banner</span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
<span class="icon-bar"></span> | ||
</button> | ||
<span class="navbar-brand"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></span> | ||
</div> | ||
<div class="collapse navbar-collapse"> | ||
<p class="navbar-text"> | ||
Use this space to summarize your privacy and cookie use policy. | ||
</p> | ||
<div class="navbar-right"> | ||
<a asp-page="/Privacy" class="btn btn-info navbar-btn">Learn More</a> | ||
<button type="button" class="btn btn-default navbar-btn" data-cookie-string="@cookieString">Accept</button> | ||
</div> | ||
</div> | ||
</div> | ||
</nav> | ||
<script> | ||
(function () { | ||
document.querySelector("#cookieConsent button[data-cookie-string]").addEventListener("click", function (el) { | ||
document.cookie = el.target.dataset.cookieString; | ||
document.querySelector("#cookieConsent").classList.add("hidden"); | ||
}, false); | ||
})(); | ||
</script> | ||
} |
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,39 @@ | ||
@using System.Globalization; | ||
@using Microsoft.AspNetCore.Builder; | ||
@using Microsoft.Extensions.Options | ||
|
||
@inject IOptions<RequestLocalizationOptions> LocOps | ||
|
||
@{ | ||
var requestCulture = CultureInfo.CurrentCulture; | ||
var supportedCultures = LocOps.Value.SupportedUICultures | ||
.Select(c => new SelectListItem | ||
{ | ||
Value = c.TwoLetterISOLanguageName, | ||
Text = $"{c.DisplayName} ({c.NativeName})" | ||
}).ToList(); | ||
} | ||
|
||
<ul class="nav navbar-nav navbar-right"> | ||
<li class="dropdown"> | ||
<a class="dropdown-toggle" data-toggle="dropdown" href="#"> | ||
@($"{requestCulture.DisplayName} ({requestCulture.NativeName})") | ||
<span class="caret"></span> | ||
</a> | ||
<ul class="dropdown-menu"> | ||
@foreach (var culture in supportedCultures) | ||
{ | ||
if (culture.Value.ToLower() != requestCulture.Name.ToLower()) | ||
{ | ||
<li> | ||
<a | ||
asp-route-culture="@culture.Value" | ||
asp-route-returnUrl="@(Context.Request.Query["returnUrl"])"> | ||
@culture.Text | ||
</a> | ||
</li> | ||
} | ||
} | ||
</ul> | ||
</li> | ||
</ul> |
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,78 @@ | ||
@{ | ||
var culture = System.Globalization.CultureInfo.CurrentCulture.Name; | ||
} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>@ViewData["Title"] - MyTrips</title> | ||
|
||
<environment include="Development"> | ||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" /> | ||
<link rel="stylesheet" href="~/css/site.css" /> | ||
</environment> | ||
<environment exclude="Development"> | ||
<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css" | ||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css" | ||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" /> | ||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" /> | ||
</environment> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-inverse navbar-fixed-top"> | ||
<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 asp-page="/Index" class="navbar-brand">MyTrips</a> | ||
</div> | ||
<div class="navbar-collapse collapse"> | ||
<ul class="nav navbar-nav"> | ||
<li><a asp-page="/Index">Home</a></li> | ||
<li><a asp-page="/Trips" asp-route-culture="@culture">My Trips</a></li> | ||
</ul> | ||
<partial name="_LanguagePartial" /> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<partial name="_CookieConsentPartial" /> | ||
|
||
<div class="container body-content"> | ||
@RenderBody() | ||
<hr /> | ||
<footer> | ||
<p>© 2018 - MyTrips</p> | ||
</footer> | ||
</div> | ||
|
||
<environment include="Development"> | ||
<script src="~/lib/jquery/dist/jquery.js"></script> | ||
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script> | ||
<script src="~/js/site.js" asp-append-version="true"></script> | ||
</environment> | ||
<environment exclude="Development"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.3.1.min.js" | ||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js" | ||
asp-fallback-test="window.jQuery" | ||
crossorigin="anonymous" | ||
integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js" | ||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal" | ||
crossorigin="anonymous" | ||
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"> | ||
</script> | ||
<script src="~/js/site.min.js" asp-append-version="true"></script> | ||
</environment> | ||
|
||
@RenderSection("Scripts", required: false) | ||
</body> | ||
</html> |
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,67 @@ | ||
<environment include="Development"> | ||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script> | ||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script> | ||
</environment> | ||
<environment exclude="Development"> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.17.0/jquery.validate.min.js" | ||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.validator" | ||
crossorigin="anonymous" | ||
integrity="sha384-rZfj/ogBloos6wzLGpPkkOr/gpkBNLZ6b6yLy4o+ok+t/SAKlL5mvXLr0OXNi1Hp"> | ||
</script> | ||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validation.unobtrusive/3.2.9/jquery.validate.unobtrusive.min.js" | ||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js" | ||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive" | ||
crossorigin="anonymous" | ||
integrity="sha384-ifv0TYDWxBHzvAk2Z0n8R434FL1Rlv/Av18DXE43N/1rvHyOG4izKst0f2iSLdds"> | ||
</script> | ||
</environment> | ||
|
||
<!-- cldr scripts (needed for globalize) --> | ||
<script src="~/lib/cldrjs/dist/cldr.js"></script> | ||
<script src="~/lib/cldrjs/dist/cldr/event.js"></script> | ||
<script src="~/lib/cldrjs/dist/cldr/supplemental.js"></script> | ||
|
||
<!-- globalize scripts --> | ||
<script src="~/lib/globalize/dist/globalize.js"></script> | ||
<script src="~/lib/globalize/dist/globalize/number.js"></script> | ||
<script src="~/lib/globalize/dist/globalize/date.js"></script> | ||
|
||
<script src="~/lib/jquery-validation-globalize/jquery.validate.globalize.js"></script> | ||
|
||
@inject Microsoft.AspNetCore.Hosting.IHostingEnvironment HostingEnvironment | ||
@{ | ||
string GetDefaultLocale() | ||
{ | ||
const string localePattern = "lib\\cldr-data\\main\\{0}"; | ||
var currentCulture = System.Globalization.CultureInfo.CurrentCulture; | ||
var cultureToUse = "en"; //Default regionalisation to use | ||
if (System.IO.Directory.Exists(System.IO.Path.Combine(HostingEnvironment.WebRootPath, string.Format(localePattern, currentCulture.Name)))) | ||
cultureToUse = currentCulture.Name; | ||
else if (System.IO.Directory.Exists(System.IO.Path.Combine(HostingEnvironment.WebRootPath, string.Format(localePattern, currentCulture.TwoLetterISOLanguageName)))) | ||
cultureToUse = currentCulture.TwoLetterISOLanguageName; | ||
|
||
return cultureToUse; | ||
} | ||
} | ||
|
||
<script type="text/javascript"> | ||
var culture = "@GetDefaultLocale()"; | ||
$.when( | ||
$.get("/lib/cldr-data/supplemental/likelySubtags.json"), | ||
$.get("/lib/cldr-data/main/" + culture + "/numbers.json"), | ||
$.get("/lib/cldr-data/supplemental/numberingSystems.json"), | ||
$.get("/lib/cldr-data/main/" + culture + "/ca-gregorian.json"), | ||
$.get("/lib/cldr-data/main/" + culture +"/timeZoneNames.json"), | ||
$.get("/lib/cldr-data/supplemental/timeData.json"), | ||
$.get("/lib/cldr-data/supplemental/weekData.json") | ||
).then(function () { | ||
// Normalize $.get results, we only need the JSON, not the request statuses. | ||
return [].slice.apply(arguments, [0]).map(function (result) { | ||
return result[0]; | ||
}); | ||
}).then(Globalize.load).then(function () { | ||
Globalize.locale(culture); | ||
}); | ||
</script> |
Oops, something went wrong.