Passage à ASP.NET vNext
This commit is contained in:
parent
ea90fefc31
commit
388b004837
1929 changed files with 104611 additions and 235941 deletions
22
Yavsc/Views/Shared/Authorize.cshtml
Normal file
22
Yavsc/Views/Shared/Authorize.cshtml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
@using AspNet.Security.OpenIdConnect.Extensions
|
||||
@using Microsoft.IdentityModel.Protocols.OpenIdConnect
|
||||
@using Mvc.Server.Models
|
||||
|
||||
@model Tuple<OpenIdConnectMessage, Application>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Authorization</h1>
|
||||
|
||||
<p class="lead text-left">Do you wanna grant <strong>@Model.Item2.DisplayName</strong> an access to your resources? (scopes requested: @Model.Item1.Scope)</p>
|
||||
|
||||
<form enctype="application/x-www-form-urlencoded" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
@foreach (var parameter in Model.Item1.Parameters) {
|
||||
<input type="hidden" name="@parameter.Key" value="@parameter.Value" />
|
||||
}
|
||||
|
||||
<input formaction="/connect/authorize/accept" class="btn btn-lg btn-success" name="Authorize" type="submit" value="Yeah, sure" />
|
||||
<input formaction="/connect/authorize/deny" class="btn btn-lg btn-danger" name="Deny" type="submit" value="Hell, no" />
|
||||
</form>
|
||||
</div>
|
||||
12
Yavsc/Views/Shared/Error.cshtml
Executable file
12
Yavsc/Views/Shared/Error.cshtml
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
@model Exception
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Oops!";
|
||||
}
|
||||
<h1 class="text-danger">Oops! an error occurs</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
@if (Model != null)
|
||||
{
|
||||
|
||||
@Html.ValueFor(model => model.Message)
|
||||
}
|
||||
19
Yavsc/Views/Shared/Logout.cshtml
Normal file
19
Yavsc/Views/Shared/Logout.cshtml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<div class="jumbotron">
|
||||
<h1>Log out</h1>
|
||||
<p class="lead text-left">Are you sure you want to sign out?</p>
|
||||
|
||||
@if (Model.Item2 != null && Model.Item2.Identity != null) {
|
||||
<p class="lead text-left">Connected user: @Model.Item2.Identity.Name</p>
|
||||
}
|
||||
|
||||
<form action="/connect/logout" enctype="application/x-www-form-urlencoded" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
@* Flow the logout request *@
|
||||
@foreach (var parameter in Model.Item1.Parameters) {
|
||||
<input type="hidden" name="@parameter.Key" value="@parameter.Value" />
|
||||
}
|
||||
|
||||
<input class="btn btn-lg btn-success" name="Authorize" type="submit" value="Yeah, sure" />
|
||||
</form>
|
||||
</div>
|
||||
12
Yavsc/Views/Shared/OidcError.cshtml
Normal file
12
Yavsc/Views/Shared/OidcError.cshtml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
@using Microsoft.IdentityModel.Protocols.OpenIdConnect
|
||||
@model OpenIdConnectMessage
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>An OpenID Connect error has occurred</h1>
|
||||
<p class="lead text-left">
|
||||
<strong>@Model.Error</strong>
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorDescription)) {
|
||||
<small>@Model.ErrorDescription</small>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
17
Yavsc/Views/Shared/SignIn.cshtml
Normal file
17
Yavsc/Views/Shared/SignIn.cshtml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
@using Microsoft.AspNet.Http.Authentication
|
||||
@model IEnumerable<AuthenticationDescription>
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>Authentication</h1>
|
||||
<p class="lead text-left">Sign in using one of these external providers:</p>
|
||||
|
||||
@foreach (var description in Model) {
|
||||
<form action="/signin" method="post">
|
||||
<input type="hidden" name="Provider" value="@description.AuthenticationScheme" />
|
||||
<input type="hidden" name="ReturnUrl" value="@ViewBag.ReturnUrl" />
|
||||
|
||||
<button class="btn btn-lg btn-success" type="submit">Connect using @description.DisplayName</button>
|
||||
</form>
|
||||
}
|
||||
</div>
|
||||
10
Yavsc/Views/Shared/Status.cshtml
Normal file
10
Yavsc/Views/Shared/Status.cshtml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
@{
|
||||
ViewBag.Title = "Oops!";
|
||||
}
|
||||
<h2 class="text-danger">Your request cannot be served</h2>
|
||||
|
||||
<code>
|
||||
@ViewBag.StatusCode
|
||||
</code>
|
||||
|
||||
85
Yavsc/Views/Shared/_DropFiles.cshtml
Normal file
85
Yavsc/Views/Shared/_DropFiles.cshtml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
@section header{
|
||||
<style>
|
||||
.box__dragndrop,
|
||||
.box__uploading,
|
||||
.box__success,
|
||||
.box__error {
|
||||
display: none;
|
||||
}
|
||||
.box.has-advanced-upload {
|
||||
background-color: white;
|
||||
outline: 2px dashed black;
|
||||
outline-offset: -10px;
|
||||
}
|
||||
.box.has-advanced-upload .box__dragndrop {
|
||||
display: inline;
|
||||
}
|
||||
.box.is-dragover {
|
||||
background-color: grey;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="~/lib/dropzone/basic.min.css" />
|
||||
<link rel="stylesheet" href="~/lib/dropzone/dropzone.min.css" />
|
||||
<script src="~/lib/dropzone/dropzone.min.js"> </script>
|
||||
<script src="~/lib/dropzone/dropzone-amd-module.min.js"> </script>
|
||||
}
|
||||
|
||||
@section scripts{
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
var isAdvancedUpload = function() {
|
||||
var div = document.createElement('div');
|
||||
return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && 'FormData' in window && 'FileReader' in window;
|
||||
}();
|
||||
|
||||
var $form = $('.box');
|
||||
|
||||
if (isAdvancedUpload) {
|
||||
$form.addClass('has-advanced-upload');
|
||||
}
|
||||
if (isAdvancedUpload) {
|
||||
|
||||
var droppedFiles = false;
|
||||
|
||||
$form.on('drag dragstart dragend dragover dragenter dragleave drop', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
})
|
||||
.on('dragover dragenter', function() {
|
||||
$form.addClass('is-dragover');
|
||||
})
|
||||
.on('dragleave dragend drop', function() {
|
||||
$form.removeClass('is-dragover');
|
||||
})
|
||||
.on('drop', function(e) {
|
||||
droppedFiles = e.originalEvent.dataTransfer.files;
|
||||
});
|
||||
|
||||
}
|
||||
$form.on('submit', function(e) {
|
||||
if ($form.hasClass('is-uploading')) return false;
|
||||
|
||||
$form.addClass('is-uploading').removeClass('is-error');
|
||||
|
||||
if (isAdvancedUpload) {
|
||||
// ajax for modern browsers
|
||||
} else {
|
||||
// ajax for legacy browsers
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
}
|
||||
|
||||
<form class="box" method="post" action="~/UserFiles/Create" enctype="multipart/form-data">
|
||||
<div class="box__input">
|
||||
<input class="box__file" type="file" name="files[]" id="file" data-multiple-caption="{count} files selected" multiple />
|
||||
<label for="file"><strong>Choose a file</strong><span class="box__dragndrop"> or drag it here</span>.</label>
|
||||
<button class="box__button" type="submit">Upload</button>
|
||||
</div>
|
||||
<div class="box__uploading">Uploading…</div>
|
||||
<div class="box__success">Done!</div>
|
||||
<div class="box__error">Error! <span></span>.</div>
|
||||
</form>
|
||||
64
Yavsc/Views/Shared/_Layout.cshtml
Executable file
64
Yavsc/Views/Shared/_Layout.cshtml
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
<!doctype html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
|
||||
<title>@ViewData["Title"] - @SiteSettings.Value.Title</title>
|
||||
<environment names="Development">
|
||||
<link rel="stylesheet" href="~/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</environment>
|
||||
<environment names="Staging,Production,yavsc,yavscpre,booking,lua">
|
||||
<link rel="stylesheet" href="~/css/bootstrap.min.css" asp-append-version="true"/>
|
||||
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
|
||||
</environment>
|
||||
<environment names="Development">
|
||||
<script src="~/js/jquery.js"></script>
|
||||
<script src="~/js/bootstrap.js"></script>
|
||||
<script src="~/js/site.js"></script>
|
||||
</environment>
|
||||
<environment names="Staging,Production,yavsc,yavscpre,booking,lua">
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js"
|
||||
asp-fallback-src="~/bower_components/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery">
|
||||
</script>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.5/bootstrap.min.js"
|
||||
asp-fallback-src="~/bower_components/bootstrap/dist/js/bootstrap.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
|
||||
</script>
|
||||
<script src="~/js/site.min.js" asp-append-version="true"></script>
|
||||
</environment>
|
||||
@RenderSection("header", required: false)
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-inverse navbar-static-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 asp-controller="Home" asp-action="Index" class="navbar-brand">@SiteSettings.Value.Title</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a asp-controller="Home" asp-action="Index">@SR["Home"]</a></li>
|
||||
<li><a asp-controller="Home" asp-action="About">@SR["About"] @SiteSettings.Value.Title</a> </li>
|
||||
<li><a asp-controller="Home" asp-action="Contact">@SR["Contact"]</a></li>
|
||||
</ul>
|
||||
@await Html.PartialAsync("_LoginPartial")
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<main class="container body-content" role="main">
|
||||
@RenderBody()
|
||||
</main>
|
||||
<hr />
|
||||
<footer>
|
||||
<p>Yavsc - Copyright © 2016 Paul Schneider</p>
|
||||
</footer>
|
||||
@RenderSection("scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
25
Yavsc/Views/Shared/_LoginPartial.cshtml
Executable file
25
Yavsc/Views/Shared/_LoginPartial.cshtml
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
@using System.Security.Claims
|
||||
|
||||
@if (User.IsSignedIn())
|
||||
{
|
||||
<form asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right">
|
||||
<language-layout>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a asp-controller="Manage" asp-action="Index" title="Manage">@SR["Hello"] @User.GetUserName()!</a>
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" class="btn btn-link navbar-btn navbar-link">@SR["Logout"]</button>
|
||||
</li>
|
||||
</ul>
|
||||
</language-layout>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{ <language-layout>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a asp-controller="Account" asp-action="Register">@SR["Register"]</a></li>
|
||||
<li><a asp-controller="Account" asp-action="Login">@SR["Login"]</a></li>
|
||||
</ul>
|
||||
</language-layout>
|
||||
}
|
||||
33
Yavsc/Views/Shared/_PerformerPartial.cshtml
Normal file
33
Yavsc/Views/Shared/_PerformerPartial.cshtml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
@model YavscWeb.Models.PerformerProfile
|
||||
|
||||
<div class="performer @(Model.Active?"active":"inactive")">
|
||||
@Model.Performer?.UserName (rating: @Model.Rate%)
|
||||
<ul>
|
||||
@if (Model.MinDailyCost != null) {
|
||||
<li>@SR["MinDailyCost"]: @Model.MinDailyCost€</li>
|
||||
}
|
||||
@if (Model.MinDailyCost != null) {
|
||||
<li>@SR["MaxDailyCost"]: @Model.MaxDailyCost€</li>
|
||||
}
|
||||
@if (Model.WebSite!=null) {
|
||||
<li>@SR["WebSite"]: @Model.WebSite</li>
|
||||
}
|
||||
@if (Model.DoesBlog) {
|
||||
<li> <a asp-controller="Blogspot" asp-action="UserPosts"
|
||||
asp-route-id="@Model.Performer.UserName">@SR["His blog"]</a>
|
||||
</li>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(
|
||||
Model.Performer?.DedicatedGoogleCalendar))
|
||||
{
|
||||
<li> @SR["Exposes his Google calendar!"]
|
||||
</li>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(
|
||||
Model.Performer?.GoogleRegId))
|
||||
{
|
||||
<li> @SR["Uses the mobile application, and receives push notifications"]
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
16
Yavsc/Views/Shared/_ValidationScriptsPartial.cshtml
Executable file
16
Yavsc/Views/Shared/_ValidationScriptsPartial.cshtml
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
<environment names="Development">
|
||||
<script src="~/lib/jquery-validation/jquery.validate.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
|
||||
</environment>
|
||||
<script src="~/js/jquery-ui.js" ></script>
|
||||
<script src="~/lib/jquery-validation/additional-methods.js" charset="UTF-8"></script>
|
||||
<environment names="Staging,Production,yavsc,yavscpre,booking,lua">
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation/jquery.validate.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator">
|
||||
</script>
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/mvc/5.2.3/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">
|
||||
</script>
|
||||
</environment>
|
||||
Loading…
Add table
Add a link
Reference in a new issue