Skip to content

Commit

Permalink
Merge pull request #47 from simeneilevstjonn/develop
Browse files Browse the repository at this point in the history
beta1201a
  • Loading branch information
simeneilevstjonn authored Dec 1, 2019
2 parents a10474c + 779faf7 commit 5d4ce49
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 35 deletions.
11 changes: 5 additions & 6 deletions Areas/Identity/Pages/Account/ExternalLogin.cshtml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
@page
@model ExternalLoginModel
@{
ViewData["Title"] = "Register";
ViewData["Title"] = "Registrer deg";
}

<h1>@ViewData["Title"]</h1>
<h4>Associate your @Model.LoginProvider account.</h4>
<h4>Assosier din @Model.LoginProvider-bruker.</h4>
<hr />

<p class="text-info">
You've successfully authenticated with <strong>@Model.LoginProvider</strong>.
Please enter an email address for this site below and click the Register button to finish
logging in.
Du har autentisert med <strong>@Model.LoginProvider</strong>.
Vennligst skriv inn en e-postadresse for å fullrøre registeringen.
</p>

<div class="row">
Expand All @@ -23,7 +22,7 @@
<input asp-for="Input.Email" class="form-control" />
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Register</button>
<button type="submit" class="btn btn-primary">Registrer deg</button>
</form>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion Areas/Identity/Pages/Account/RegisterConfirmation.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

<h1>@ViewData["Title"]</h1>

<p>Bekreftelsese-post sendt. Vennligst sjekk dinn innboks.</p>
<p>Bekreftelsese-post sendt. Vennligst sjekk dinn innboks og spam-mappe. Du må verifisere e-postadressen for å kunne logge på igjen.
</p>
14 changes: 14 additions & 0 deletions Classes/Countdowns/CountdownBackground.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ public class CountdownBackground

public static Dictionary<string, CountdownBackground> Backgrounds = new Dictionary<string, CountdownBackground>
{
//special
{
"blank",
new CountdownBackground
{
Id = "blank",
CommonName = "Hvit bakgrunn",
Path = " ",
Css = string.Empty,
Html = string.Empty,
UseCCC = false
}
},

//Adobe Stock Images
{
"christmasinterior",
Expand Down
30 changes: 18 additions & 12 deletions Controllers/ConfigController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ private IActionResult CustomError(string message)

public IActionResult Birthday()
{
List<CountdownBackground> cbgs = new List<CountdownBackground>();
foreach (KeyValuePair<string, CountdownBackground> cb in CountdownBackground.Backgrounds)
{
cbgs.Add(cb.Value);
}
ViewData["IsPersonalCelebration"] = "true";
return View("CustomBuilder", new CustomBuilderViewModel
{
Expand All @@ -52,15 +57,17 @@ public IActionResult Birthday()
Description = "Bursdagsdato"
}
},
BackgroundOptions = new List<CountdownBackground>
{
CountdownBackground.Backgrounds["birthdaycake"]
}
BackgroundOptions = cbgs
});
}

public IActionResult Confirmation()
{
List<CountdownBackground> cbgs = new List<CountdownBackground>();
foreach (KeyValuePair<string, CountdownBackground> cb in CountdownBackground.Backgrounds)
{
cbgs.Add(cb.Value);
}
ViewData["IsPersonalCelebration"] = "true";
return View("CustomBuilder", new CustomBuilderViewModel
{
Expand All @@ -83,15 +90,17 @@ public IActionResult Confirmation()
Description = "Dato"
}
},
BackgroundOptions = new List<CountdownBackground>
{
CountdownBackground.Backgrounds["birthdaycake"]
}
BackgroundOptions = cbgs
});
}

public IActionResult Wedding()
{
List<CountdownBackground> cbgs = new List<CountdownBackground>();
foreach (KeyValuePair<string, CountdownBackground> cb in CountdownBackground.Backgrounds)
{
cbgs.Add(cb.Value);
}
ViewData["IsPersonalCelebration"] = "true";
return View("CustomBuilder", new CustomBuilderViewModel
{
Expand Down Expand Up @@ -121,10 +130,7 @@ public IActionResult Wedding()
Description = "Dato"
}
},
BackgroundOptions = new List<CountdownBackground>
{
CountdownBackground.Backgrounds["rose"]
}
BackgroundOptions = cbgs
});
}

Expand Down
5 changes: 5 additions & 0 deletions Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public IActionResult Copyright()
return View();
}

public IActionResult HowToIncludeSchool()
{
return View();
}

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
Expand Down
3 changes: 2 additions & 1 deletion Views/Config/MyCountdowns.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</div>
</div>
</div>
<div class="card">
<div class="card mb-1">
<button class="btn btn-block text-center" type="button" data-toggle="collapse" data-target="#@collapseid" aria-expanded="false" aria-controls="@collapseid" style="font-size: 14pt">
@name
</button>
Expand All @@ -71,6 +71,7 @@
<button class="btn btn-danger col m-1" data-toggle="modal" data-target="#@delmodid">Slett nedtelling</button>
</div>
</div>

}
<br />
<hr />
Expand Down
2 changes: 1 addition & 1 deletion Views/Home/Contact.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}
<div class="container">
<h1>Kontakt Oss</h1>
<p>Lurer du på noe, eller har en id&eacute; til FerieCountdown?</p>
<p>Har du et spørsmål, en id&eacute;, eller tider fra en skole. Her kan du sende inn en kontaktskjema.</p>
<form asp-area="" asp-controller="Home" asp-action="SubmitContactForm" class="needs-validation" novalidate id="contact-form">
<div class="form-group">
<label for="nameInput">Fullt navn</label>
Expand Down
16 changes: 16 additions & 0 deletions Views/Home/HowToIncludeSchool.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

@{
Layout = "_Container";
ViewData["Title"] = "Hvordan få med en skole på FerieCountdown";
}

<h1>Hvordan få med en skole på FerieCountdown</h1>

<p>
For å få med en skole på nettsiden må du sende inn et <a asp-controller="Home" asp-action="Contact">kontaktskjema</a> og inkludere følgende informasjon:
tidspunkt for skoleslutt mandag, tirsdag, onsdag, torsdag og fredag, tidspunkt for høstferie, juleferie, vinterferie, påskeferie og sommerferie.
Disse skal oppgis i UTC (Coordinated Universal Time). Du må også ha med skolenavn og kommune (for grunnskoler), fylkeskommuner (for videregående skoler) eller firmanavn (for privatskoler).
<br />
Dersom du finner feil med en allerede registrert skole, ber vi deg også ta kontakt.
</p>

6 changes: 3 additions & 3 deletions Views/Home/HttpError.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h1>@Model.ErrorTitle</h1>

<div class="flip-clock-wrapper" style="transform: scale(2); display: flex; align-items: center; justify-content: center; margin: 2em; padding: 4em">
<ul class="flip">
<ul class="flip play">
<li class="flip-clock-before">
<a href="#">
<div class="up">
Expand All @@ -45,7 +45,7 @@
</a>
</li>
</ul>
<ul class="flip">
<ul class="flip play">
<li class="flip-clock-before">
<a href="#">
<div class="up">
Expand All @@ -71,7 +71,7 @@
</a>
</li>
</ul>
<ul class="flip">
<ul class="flip play">
<li class="flip-clock-before">
<a href="#">
<div class="up">
Expand Down
120 changes: 115 additions & 5 deletions Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,121 @@
@{
@using Microsoft.AspNetCore.Identity
@using FerieCountdown.Classes.Io
@using System.Security.Claims;
@inject SignInManager<IdentityUser> SignInManager
@inject UserManager<IdentityUser> UserManager
@{
ViewData["Title"] = "Hjem";
ViewData["MetaDescription"] = "FerieCountdown er nettsiden der du kan telle ned til skoleferier, slutten på skoledager, helg, bursdager, nyttår og mye mer med dager, timer, minutter og sekunder!";
}

<script src="~/js/flipclock.js"></script>
<link rel="stylesheet" href="~/css/flipclock.css" />
<style>
body {
overflow-x: hidden;
@if (DateTime.UtcNow.Month == 12)
{
<text>
background-attachment: fixed;
background-repeat: no-repeat;
background-position: center;
background-image: url(https://static.feriecountdown.com/resources/background/christmaslivingroom.jpg);
}
.welcome-heading {
color: #f0eddf;
}
.mainpagecard {
background-color: #f0eddf;
</text>
}
}
</style>


<div class="text-center">
<h1 class="display-4">Velkommen til FerieCountdown beta!</h1>
<p>Prøv deg litt rundt. Finner du noe som er galt eller har en id&eacute; til noe som kan bli bedre, send gjerne en mail!<br />
Bruk mailadressen: <a href="mailto:[email protected]">beta-feedback@feriecountdown.com</a>
</p>
<h1 class="display-4 welcome-heading">Velkommen til nye FerieCountdown!</h1>
<div class="row p-2">
<div class="col col-sm-12 col-md-6 p-2">
<div class="card p-2 h-100 mainpagecard">
<h2>Hva er nytt</h2>
<p>
<table class="table">
<tbody>
<tr>
<th>Innlogging</th>
<td>Du kan nå <a asp-area="Identity" asp-page="/Account/Login">lage din egen</a> FerieCountdown-Bruker</td>
</tr>
<tr>
<th>Egne nedtellinger</th>
<td>Du kan nå <a asp-area="" asp-controller="Config" asp-action="Custom">lage helt egne</a> nedtellinger til hva som helst</td>
</tr>
<tr>
<th>Støtte for andre skoler og jobb</th>
<td>
Du kan nå <a asp-area="" asp-controller="Countdown" asp-action="SetLocale">velge din skole eller sette arbeidstider</a>. <a asp-area="" asp-controller="Home" asp-action="HowToIncludeSchool">Hvordan få med din skole.</a>
</td>
</tr>

</tbody>
</table>
</p>
</div>
</div>
@if (DateTime.UtcNow.Month == 12 && DateTime.UtcNow.Day < 25)
{
<div class="col col-sm-12 col-md-6 p-2">
<div class="card p-2 h-100 mainpagecard">
@if (DateTime.UtcNow.Day == 24)
{
<h2>Det er jul i dag!</h2>
}
else
{
@*<h2>Det er @(24 - DateTime.UtcNow.Day) dager til jul.</h2>*@
<h2>Nedtelling til julaften</h2>
<h3>I dag er det @DateTime.UtcNow.Day. desember</h3>
<div class="clock" style="margin:2em;" id="clock"></div>
<a asp-action="Christmaseve" asp-controller="Countdown">Se nedtelling</a>
}
</div>
</div>
}
@if (SignInManager.IsSignedIn(User))
{
Dictionary<string, string> ccdData = DbMaster.GetDictionaryFromSql($"SELECT TOP (10) [Id], [CountdownText] FROM [dbo].[CustomCountdowns] WHERE [Owner] = N'{User.FindFirstValue(ClaimTypes.NameIdentifier)}' ORDER BY [CountdownTime] DESC;");
@if (ccdData.Count > 0)
{
<div class="col col-sm-12 col-md-6 p-2">
<div class="card p-2 h-100 mainpagecard">
<h2>Neste egendefinerte nedtellinger</h2>
@foreach (KeyValuePair<string, string> data in ccdData)
{
<a href="/Countdown/Custom/@data.Key">@data.Value</a>
}
</div>
</div>
}
}

</div>
</div>

@section Scripts {
<script>
$(document).ready(function () {
var now = new Date();
var future = new Date("2019-12-24");
var diff = future.getTime() / 1000 - now.getTime() / 1000;
// Instantiate a coutdown FlipClock
clock = $('.clock').FlipClock(diff, {
clockFace: 'DailyCounter',
countdown: true,
language: 'no',
stop: function () {
window.location.reload();
}
});
});
</script>
}
2 changes: 1 addition & 1 deletion Views/Home/Privacy.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<h4>Sted/skole</h4>
<p>
For å kunne se nedtellinger til skoleferier og skoledager må du fortelle oss hvilken skole du går på. Dette er lagret i en cookie (informasjonskapsel) i nettleseren din. Det assosieres aldri med en bruker.
For å kunne se nedtellinger til skoleferier og skoledager må du fortelle oss hvilken skole du går på eller når du jobber. Dersom du bruker en av våre registrerte skoler lagres dette i en cookie i nettleseren din og assosieres ikke med en bruker. Setter du dine egne tider, vil denne dataen lagres på din bruker.
</p>

<h4>Nedtellingsdata</h4>
Expand Down
6 changes: 3 additions & 3 deletions Views/Shared/Error.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<h1>Internal Server Error</h1>

<div class="flip-clock-wrapper" style="transform: scale(2); display: flex; align-items: center; justify-content: center; margin: 2em; padding: 4em">
<ul class="flip">
<ul class="flip play">
<li class="flip-clock-before">
<a href="#">
<div class="up">
Expand All @@ -39,7 +39,7 @@
</a>
</li>
</ul>
<ul class="flip">
<ul class="flip play">
<li class="flip-clock-before">
<a href="#">
<div class="up">
Expand All @@ -65,7 +65,7 @@
</a>
</li>
</ul>
<ul class="flip">
<ul class="flip play">
<li class="flip-clock-before">
<a href="#">
<div class="up">
Expand Down
5 changes: 3 additions & 2 deletions Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,15 @@
</p>
</footer>


<environment include="Development">
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
</environment>
<environment exclude="Development">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</environment>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
Expand Down

0 comments on commit 5d4ce49

Please sign in to comment.