mirror of
https://github.com/guilhermewerner/site-pi
synced 2025-06-16 13:54:20 +00:00
Initial commit
This commit is contained in:
104
SitePi/Views/Home/Index.cshtml
Normal file
104
SitePi/Views/Home/Index.cshtml
Normal file
@ -0,0 +1,104 @@
|
||||
@{
|
||||
ViewData["Title"] = "Início";
|
||||
}
|
||||
|
||||
<div class="container">
|
||||
<div class="py-3">
|
||||
<h3>@ViewData["Title"]</h3>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<span class="text-muted">Users</span>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="text-right">
|
||||
<a asp-area="" asp-controller="User" asp-action="New">
|
||||
<i class="fas fa-plus-circle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-borderless table-hover">
|
||||
<thead class="border-bottom">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nome</th>
|
||||
<th>Email</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (User u in ViewBag.Users)
|
||||
{
|
||||
<tr>
|
||||
<td>@u.Id</td>
|
||||
<td>@u.Name</td>
|
||||
<td>@u.Email</td>
|
||||
<th>
|
||||
<a class="text-decoration-none pr-2" asp-area="" asp-controller="User" asp-action="Edit" asp-route-id="@u.Id">
|
||||
<i class="fas fa-pen"></i>
|
||||
</a>
|
||||
<a class="text-decoration-none pr-2" asp-area="" asp-controller="User" asp-action="Index" asp-route-id="@u.Id">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
</a>
|
||||
<a class="text-decoration-none pr-2" asp-area="" asp-controller="User" asp-action="Delete" asp-route-id="@u.Id">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br />
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<span class="text-muted">Bots</span>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="text-right">
|
||||
<a asp-area="" asp-controller="Quiz" asp-action="Index">
|
||||
<i class="fas fa-plus-circle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-borderless table-hover">
|
||||
<thead class="border-bottom">
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
<th>Criatividade</th>
|
||||
<th>Liderança</th>
|
||||
<th>Individualista</th>
|
||||
<th>Insegurança</th>
|
||||
<th>Opções</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (Bot b in ViewBag.Bots)
|
||||
{
|
||||
<tr>
|
||||
<td>@b.Name</td>
|
||||
<td>@b.PercentageA %</td>
|
||||
<td>@b.PercentageB %</td>
|
||||
<td>@b.PercentageC %</td>
|
||||
<td>@b.PercentageD %</td>
|
||||
<th>
|
||||
<a class="text-decoration-none pr-2" asp-area="" asp-controller="Home" asp-action="BaixarBot" asp-route-id="@b.Id">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
<a class="text-decoration-none pr-2" asp-area="" asp-controller="Home" asp-action="DeleteBot" asp-route-id="@b.Id">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
187
SitePi/Views/Quiz/Index.cshtml
Normal file
187
SitePi/Views/Quiz/Index.cshtml
Normal file
@ -0,0 +1,187 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Quiz";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
@model SitePi.Models.Responds
|
||||
|
||||
<div class="container">
|
||||
<div class="py-3">
|
||||
<h3>@ViewData["Title"]</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label><b>Usuario:</b></label>
|
||||
<select class="form-control" asp-for="UserId">
|
||||
<option></option>
|
||||
@foreach (User u in ViewBag.Users)
|
||||
{
|
||||
<option value="@u.Id">@u.Name</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="text-muted">Responda o quiz para gerar um Bot</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@{
|
||||
int i = 1;
|
||||
}
|
||||
@foreach (Question q in ViewBag.Questions)
|
||||
{
|
||||
int j = 1;
|
||||
<h5 style="margin-bottom: 20px;">@i. @q.Text</h5>
|
||||
<div class="form-group">
|
||||
@foreach (Choice c in ViewBag.Choices)
|
||||
{
|
||||
@if (c.QuestionId == q.Id)
|
||||
{
|
||||
@switch (j)
|
||||
{
|
||||
case 1:
|
||||
<p>a) @c.Text</p>
|
||||
break;
|
||||
case 2:
|
||||
<p>b) @c.Text</p>
|
||||
break;
|
||||
case 3:
|
||||
<p>c) @c.Text</p>
|
||||
break;
|
||||
case 4:
|
||||
<p>d) @c.Text</p>
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
</div>
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_1">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 2:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_2">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 3:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_3">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 4:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_4">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 5:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_5">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 6:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_6">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 7:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_7">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 8:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_8">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
case 9:
|
||||
<div class="form-group">
|
||||
<label for="@q.Id"><b>Resposta:</b></label>
|
||||
<select class="form-control" id="@q.Id" asp-for="Profile_9">
|
||||
<option></option>
|
||||
<option value="a">A</option>
|
||||
<option value="b">B</option>
|
||||
<option value="c">C</option>
|
||||
<option value="d">D</option>
|
||||
</select>
|
||||
</div>
|
||||
break;
|
||||
}
|
||||
<hr />
|
||||
i++;
|
||||
}
|
||||
<div class="text-right">
|
||||
<button type="submit" class="btn btn-primary">Enviar</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
</div>
|
25
SitePi/Views/Shared/Error.cshtml
Normal file
25
SitePi/Views/Shared/Error.cshtml
Normal file
@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
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>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
25
SitePi/Views/Shared/_CookieConsentPartial.cshtml
Normal file
25
SitePi/Views/Shared/_CookieConsentPartial.cshtml
Normal file
@ -0,0 +1,25 @@
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
|
||||
@{
|
||||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
|
||||
var showBanner = !consentFeature?.CanTrack ?? false;
|
||||
var cookieString = consentFeature?.CreateConsentCookie();
|
||||
}
|
||||
|
||||
@if (showBanner)
|
||||
{
|
||||
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
Use this space to summarize your privacy and cookie use policy. <a asp-area="" asp-controller="Home" asp-action="Privacy">Learn More</a>.
|
||||
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString">
|
||||
<span aria-hidden="true">Accept</span>
|
||||
</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var button = document.querySelector("#cookieConsent button[data-cookie-string]");
|
||||
button.addEventListener("click", function (event) {
|
||||
document.cookie = button.dataset.cookieString;
|
||||
}, false);
|
||||
})();
|
||||
</script>
|
||||
}
|
47
SitePi/Views/Shared/_Layout.cshtml
Normal file
47
SitePi/Views/Shared/_Layout.cshtml
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>@ViewData["Title"]</title>
|
||||
<meta charset='utf-8' />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css?v={random number/string}" />
|
||||
<link rel="stylesheet" href="~/css/themes/theme_dark.css" />
|
||||
<link href="~/lib/font-awesome/css/all.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="">
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index" asp-route-id="">
|
||||
Projeto PI
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
|
||||
<!-- Latest compiled JavaScript -->
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation/dist/additional-methods.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
|
||||
</body>
|
||||
</html>
|
18
SitePi/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
18
SitePi/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
@ -0,0 +1,18 @@
|
||||
<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://cdnjs.cloudflare.com/ajax/libs/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="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A=">
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/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="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
|
||||
</script>
|
||||
</environment>
|
53
SitePi/Views/User/Form.cshtml
Normal file
53
SitePi/Views/User/Form.cshtml
Normal file
@ -0,0 +1,53 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Form";
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
|
||||
@model SitePi.Models.User
|
||||
|
||||
<div class="container">
|
||||
<div class="py-3">
|
||||
<h3>@ViewData["Title"]</h3>
|
||||
</div>
|
||||
<div class="card">
|
||||
<form method="post">
|
||||
<div class="card-header">
|
||||
<span class="text-muted">Novo Usuario</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label>User Name</label>
|
||||
<input asp-for="Name" class="form-control">
|
||||
<small>
|
||||
<span asp-validation-for="Name" class="text-danger"></span>
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Email Address</label>
|
||||
<input asp-for="Email" class="form-control">
|
||||
<small>
|
||||
<span asp-validation-for="Email" class="text-danger"></span>
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Senha</label>
|
||||
<input type="password" asp-for="PasswordHash" class="form-control">
|
||||
<small>
|
||||
<span asp-validation-for="PasswordHash" class="text-danger"></span>
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Confirmar Senha</label>
|
||||
<input type="password" asp-for="PasswordConfirm" class="form-control">
|
||||
<small>
|
||||
<span asp-validation-for="PasswordConfirm" class="text-danger"></span>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<button type="submit" class="btn btn-primary">Confirmar</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
32
SitePi/Views/User/Index.cshtml
Normal file
32
SitePi/Views/User/Index.cshtml
Normal file
@ -0,0 +1,32 @@
|
||||
@{
|
||||
ViewData["Title"] = "Início";
|
||||
}
|
||||
|
||||
<div class="container">
|
||||
<div class="py-3">
|
||||
<h3>@ViewData["Title"]</h3>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="text-muted">Users</span>
|
||||
</div>
|
||||
<table class="table table-borderless table-hover">
|
||||
<thead class="border-bottom">
|
||||
<tr>
|
||||
<th>Criatividade</th>
|
||||
<th>Liderança</th>
|
||||
<th>Individualista</th>
|
||||
<th>Insegurança</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>@ViewData["TotalA"]</td>
|
||||
<td>@ViewData["TotalB"]</td>
|
||||
<td>@ViewData["TotalC"]</td>
|
||||
<td>@ViewData["TotalD"]</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
3
SitePi/Views/_ViewImports.cshtml
Normal file
3
SitePi/Views/_ViewImports.cshtml
Normal file
@ -0,0 +1,3 @@
|
||||
@using SitePi
|
||||
@using SitePi.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
3
SitePi/Views/_ViewStart.cshtml
Normal file
3
SitePi/Views/_ViewStart.cshtml
Normal file
@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
Reference in New Issue
Block a user