Skip to content

Commit

Permalink
välicommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ArttuKuikka committed Nov 19, 2023
1 parent f8b706c commit 218f771
Show file tree
Hide file tree
Showing 9 changed files with 424 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Controllers/AanestysController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ public AanestysController(ApplicationDbContext db)
{
this.db = db;
}
public IActionResult Tulokset()
{
return View();
}



[HttpGet]
[Route("api/v1/Aanestys/Tulokset")]
public async Task<IActionResult> ApiTulokset(int? start, int take)
public IActionResult ApiTulokset(int? start, int take)
{
if (start == null)
{
Expand All @@ -46,7 +51,7 @@ public async Task<IActionResult> ApiTulokset(int? start, int take)

[HttpGet]
[Route("api/v1/Aanestys/Tulos")]
public async Task<IActionResult> ApiTulos(int weekId, int Year)
public IActionResult ApiTulos(int weekId, int Year)
{

var ruokalistaObject = db.Ruokalista.Where(x => x.Year == Year).FirstOrDefault(x => x.WeekId == weekId);
Expand Down
3 changes: 2 additions & 1 deletion Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

namespace RuokalistaServer.Controllers
{
public class HomeController : Controller
[ApiExplorerSettings(IgnoreApi = true)]
public class HomeController : Controller
{

private ApplicationDbContext db;
Expand Down
8 changes: 6 additions & 2 deletions Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">


<li class="nav-item">
<a class="nav-link " style="color: white" href="/Aanestys/Tulokset">Äänestystulokset</a>
</li>

<li class="nav-item">
<a class="nav-link " style="color: white" href="/swagger">API</a>
</li>
Expand All @@ -60,7 +64,7 @@

<footer class="border-top footer text-muted">
<div class="container">
&copy; 2022 - Arttu Kuikka
&copy; @DateTime.Now.Year.ToString() - Arttu Kuikka
</div>
</footer>

Expand Down
33 changes: 33 additions & 0 deletions Views/Aanestys/Tulokset.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

@{
ViewData["Title"] = "Äänestystulokset";
}

<link rel="stylesheet" href="/css/faq.css">
<script src="/js/faq.js"></script>

<link rel="stylesheet" href="/css/aanestys.css">
<script src="/js/aanestys.js"></script>

<h2>Ruokien äänestystulokset</h2>

<section class="faq-container">
<div class="faq-one">

<!-- faq question -->
<h3 class="faq-page">Mikä tämä sivu on?</h3>

<!-- faq answer -->
<div class="faq-body">
<p>
Tällä sivulla on näkyvissä joka viikon äänestystulokset
</p>

</div>
</div>
<hr class="hr-line">
</section>
<br />

<div id="aanestysDiv" class="aanestysContent">
</div>
3 changes: 3 additions & 0 deletions Views/Aanestys/_ViewStart.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}
108 changes: 108 additions & 0 deletions wwwroot/css/aanestys.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
.aanestysContent {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
text-align:center;
}


#content {
background-color: #222; /* Even darker grey background for the central div */
border-radius: 20px; /* Rounded corners */
padding: 10px 10px 50px;
text-align: left;
margin: 10px;
min-width: 90%
}

.color-bar {
width: 100%;
height: 30px;
display: flex;
}

.dayTitle {
font-family: Segoe UI;
font-size: 1em;
color: white;
margin: 0px 0px 3px 5px;
}

.section {
margin: 25px 0px 0px 0px;
}

.color-bar2 {
width: 100%;
height: 30px;
display: flex;
}


.color-segment {
flex: 0 0 auto;
height: 100%;
}

/* Define the colors for each segment */
.color-4 {
background-color: #00A351;
}

.color-3 {
background-color: #92C894;
}

.color-2 {
background-color: #EC9899;
}

.color-1 {
background-color: #E02A39;

}

.color-base {
background-color: white;
}

.prosentage-4 {
font-family: 'Segoe UI';
color: #00A351;
text-align: end;
margin: 30px -0px 0px 0px;
font-size: 1.2em;
}

.prosentage-3 {
font-family: 'Segoe UI';
color: #92c894;
text-align: end;
margin: 30px -0px 0px 0px;
font-size: 1.2em;
}

.prosentage-2 {
font-family: 'Segoe UI';
color: #EC9899;
text-align: end;
margin: 30px -0px 0px 0px;
font-size: 1.2em;
}

.prosentage-1 {
font-family: 'Segoe UI';
color: #E02A39;
text-align: end;
margin: 30px -0px 0px 0px;
font-size: 1.2em;
}

.prosentage-base {
font-family: 'Segoe UI';
color: white;
text-align: end;
margin: 30px -0px 0px 0px;
font-size: 1em;
}
63 changes: 63 additions & 0 deletions wwwroot/css/faq.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.faq-heading {
border-bottom: #777;
padding: 20px 60px;
}

.faq-container {
display: flex;
justify-content: center;
flex-direction: column;
}

.hr-line {
width: 60%;
margin: auto;
}
/* Style the buttons that are used to open and close the faq-page body */
.faq-page {
/* background-color: #eee; */

cursor: pointer;
padding: 10px 10px;
width: 60%;
border: none;
outline: none;
transition: 0.4s;
margin: auto;
}

.faq-body {
margin: auto;
/* text-align: center; */
width: 50%;
padding: auto;
}


/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
.active,
.faq-page:hover {
background-color: #565656;
}

/* Style the faq-page panel. Note: hidden by default */
.faq-body {
padding: 0 18px;
background-color: #565656;
display: none;
overflow: hidden;
}

.faq-page:after {
content: '\02795';
/* Unicode character for "plus" sign (+) */
font-size: 13px;
color: #777;
float: right;
margin-left: 5px;
}

.active:after {
content: "\2796";
/* Unicode character for "minus" sign (-) */
}
Loading

0 comments on commit 218f771

Please sign in to comment.