summaryrefslogtreecommitdiffstats
path: root/src/Pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/Pages')
-rw-r--r--src/Pages/App/Cabins.cshtml17
-rw-r--r--src/Pages/App/Cabins.cshtml.cs14
-rw-r--r--src/Pages/App/Index.cshtml22
-rw-r--r--src/Pages/App/Index.cshtml.cs12
-rw-r--r--src/Pages/App/Info.cshtml10
-rw-r--r--src/Pages/App/Info.cshtml.cs12
-rw-r--r--src/Pages/App/ReservationForm.cshtml88
-rw-r--r--src/Pages/App/ReservationForm.cshtml.cs24
-rw-r--r--src/Pages/App/Reservations.cshtml18
-rw-r--r--src/Pages/App/Reservations.cshtml.cs12
-rw-r--r--src/Pages/App/Terms.cshtml10
-rw-r--r--src/Pages/App/Terms.cshtml.cs12
-rw-r--r--src/Pages/App/Users.cshtml11
-rw-r--r--src/Pages/App/Users.cshtml.cs14
-rw-r--r--src/Pages/Error.cshtml26
-rw-r--r--src/Pages/Error.cshtml.cs27
-rw-r--r--src/Pages/Login.cshtml93
-rw-r--r--src/Pages/Login.cshtml.cs13
-rw-r--r--src/Pages/Shared/_Layout.cshtml59
-rw-r--r--src/Pages/Shared/_Scripts.cshtml23
-rw-r--r--src/Pages/Shared/_Sidebar.cshtml32
-rw-r--r--src/Pages/Shared/_Stylesheets.cshtml15
-rw-r--r--src/Pages/Shared/_Templates.cshtml210
-rw-r--r--src/Pages/Shared/_TopNavbar.cshtml30
-rw-r--r--src/Pages/_ViewImports.cshtml3
-rw-r--r--src/Pages/_ViewStart.cshtml3
26 files changed, 810 insertions, 0 deletions
diff --git a/src/Pages/App/Cabins.cshtml b/src/Pages/App/Cabins.cshtml
new file mode 100644
index 0000000..7387151
--- /dev/null
+++ b/src/Pages/App/Cabins.cshtml
@@ -0,0 +1,17 @@
+@page
+@model IOL.Fagprove.Pages.App.Cabins
+
+@{
+ ViewData["Title"] = "Hytter";
+}
+
+<div id="cabinGrid"
+ style="min-height: 100px">
+</div>
+<div class="ui modal"
+ id="cabinModal">
+</div>
+@section Scripts
+{
+ <script src="~/scripts/cabins.js" asp-append-version="true"></script>
+} \ No newline at end of file
diff --git a/src/Pages/App/Cabins.cshtml.cs b/src/Pages/App/Cabins.cshtml.cs
new file mode 100644
index 0000000..5a94c08
--- /dev/null
+++ b/src/Pages/App/Cabins.cshtml.cs
@@ -0,0 +1,14 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class Cabins : PageModel
+ {
+ public ActionResult OnGet()
+ {
+ if (!User.IsInRole("Administrator")) return Redirect("/app");
+ return Page();
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/App/Index.cshtml b/src/Pages/App/Index.cshtml
new file mode 100644
index 0000000..0599255
--- /dev/null
+++ b/src/Pages/App/Index.cshtml
@@ -0,0 +1,22 @@
+@page
+@using System.Security.Claims
+@using IOL.Fagprove.Utilities
+@model IOL.Fagprove.Pages.App.Index
+@{
+ ViewData["Title"] = "Hjem";
+}
+<div class="ui segment middle aligned">
+ <h1>Hei @User.GetClaimValue(ClaimTypes.Name)</h1>
+ <a class="ui link"
+ href="/app/reservationform">
+ Gå til reservasjonskjema
+ </a>
+ <div class="ui divider"></div>
+ <h2>Her kommer en oversikt over dine reservasjoner.</h2>
+</div>
+
+@section Scripts
+{
+ <script asp-append-version="true"
+ src="~/scripts/reservations.js"></script>
+}
diff --git a/src/Pages/App/Index.cshtml.cs b/src/Pages/App/Index.cshtml.cs
new file mode 100644
index 0000000..8f27af8
--- /dev/null
+++ b/src/Pages/App/Index.cshtml.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class Index : PageModel
+ {
+ public void OnGet()
+ {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/App/Info.cshtml b/src/Pages/App/Info.cshtml
new file mode 100644
index 0000000..f4c1f3c
--- /dev/null
+++ b/src/Pages/App/Info.cshtml
@@ -0,0 +1,10 @@
+@page
+@model IOL.Fagprove.Pages.App.Info
+
+@{
+ ViewData["Title"] = "Infoside";
+}
+<div class="ui segment">
+ <h1>Infoside</h1>
+ <p>Her kommer det noe snart...</p>
+</div> \ No newline at end of file
diff --git a/src/Pages/App/Info.cshtml.cs b/src/Pages/App/Info.cshtml.cs
new file mode 100644
index 0000000..541c090
--- /dev/null
+++ b/src/Pages/App/Info.cshtml.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class Info : PageModel
+ {
+ public void OnGet()
+ {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/App/ReservationForm.cshtml b/src/Pages/App/ReservationForm.cshtml
new file mode 100644
index 0000000..87df337
--- /dev/null
+++ b/src/Pages/App/ReservationForm.cshtml
@@ -0,0 +1,88 @@
+@page
+@using IOL.Fagprove.Data
+@using IOL.Fagprove.Utilities
+@model IOL.Fagprove.Pages.App.ReservationForm
+@{
+ ViewData["Title"] = "Ny reservasjon";
+}
+
+<div class="ui segment"
+ id="newReservationSteps">
+ <h2>1. Velg hytten du vil reservere</h2>
+ <form class="ui form"
+ id="newReservationForm"
+ onsubmit="return false">
+ <div>
+ @foreach (var field in StaticData.CabinFields.Where(field => Model.Cabins.Any(c => c.CategoryId == field.Id)))
+ {
+ <h3>@field.Name</h3>
+ <div class="ui cards">
+ @foreach (var cabin in Model.Cabins.Where(c => c.CategoryId == field.Id))
+ {
+ <div class="card">
+ <div class="content">
+ <div class="header">
+ @cabin.Name
+ <i class="icon checkmark green card-title"
+ style="display: none">
+ </i>
+ </div>
+ <div class="meta">
+ @if (cabin.Capacity != null)
+ {
+ <span>Sengeplasser: @cabin.Capacity</span>
+ }
+ @if (cabin.Price.IsPresent())
+ {
+ <span>Pris per natt: @cabin.Price</span>
+ }
+ </div>
+ @if (cabin.Description.IsPresent())
+ {
+ <div class="description">@cabin.Description</div>
+ }
+ </div>
+ <div class="extra content">
+ <button class="ui button choose-cabin-button"
+ onclick="pickCabin(this, '@cabin.Id')">
+ Velg
+ </button>
+ </div>
+ </div>
+ }
+ </div>
+ }
+ </div>
+ <div class="ui divider"></div>
+ <div id="second-step" style="display: none">
+ <h2>2. Velg dato for innsjekk/utsjekk</h2>
+ <div class="field">
+ <div id="calendar"></div>
+ </div>
+ <div class="field">
+ <label for="">Kommentar</label>
+ <textarea id="comment" style="max-width: 320px;"></textarea>
+ </div>
+ <div class="field">
+ <div class="ui checkbox"
+ id="consent">
+ <input name="consent"
+ type="checkbox">
+ <label>
+ Jeg samtykker til
+ <a href="/app/terms">Bruksvilkårene</a>.
+ </label>
+ </div>
+ </div>
+ <button class="ui huge green button"
+ id="submitReservation">
+ Send til godkjenning
+ </button>
+ </div>
+ </form>
+</div>
+
+@section Scripts
+{
+ <script src="~/scripts/reservationForm.js"></script>
+}
diff --git a/src/Pages/App/ReservationForm.cshtml.cs b/src/Pages/App/ReservationForm.cshtml.cs
new file mode 100644
index 0000000..e509a46
--- /dev/null
+++ b/src/Pages/App/ReservationForm.cshtml.cs
@@ -0,0 +1,24 @@
+using System.Collections.Generic;
+using System.Linq;
+using IOL.Fagprove.Data;
+using IOL.Fagprove.Data.Models;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class ReservationForm : PageModel
+ {
+ public List<ReservationObject> Cabins { get; set; }
+ private readonly AppDbContext _context;
+
+ public ReservationForm(AppDbContext context)
+ {
+ _context = context;
+ }
+
+ public void OnGet()
+ {
+ Cabins = _context.Cabins.ToList();
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/App/Reservations.cshtml b/src/Pages/App/Reservations.cshtml
new file mode 100644
index 0000000..867da6c
--- /dev/null
+++ b/src/Pages/App/Reservations.cshtml
@@ -0,0 +1,18 @@
+@page
+@model IOL.Fagprove.Pages.App.Reservations
+
+@{
+ ViewData["Title"] = "Reservasjoner";
+}
+<div id="reservationsGrid"
+ style="min-height: 100px">
+</div>
+<div class="ui modal"
+ id="reservationModal">
+</div>
+
+@section Scripts
+{
+ <script src="~/scripts/reservations.js"
+ asp-append-version="true"></script>
+} \ No newline at end of file
diff --git a/src/Pages/App/Reservations.cshtml.cs b/src/Pages/App/Reservations.cshtml.cs
new file mode 100644
index 0000000..62775e1
--- /dev/null
+++ b/src/Pages/App/Reservations.cshtml.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class Reservations : PageModel
+ {
+ public void OnGet()
+ {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/App/Terms.cshtml b/src/Pages/App/Terms.cshtml
new file mode 100644
index 0000000..e4d8449
--- /dev/null
+++ b/src/Pages/App/Terms.cshtml
@@ -0,0 +1,10 @@
+@page
+@model IOL.Fagprove.Pages.App.Terms
+
+@{
+ ViewData["Title"] = "Bruksvilkår";
+}
+<div class="ui segment">
+ <h1>Bruksvilkår</h1>
+ <p>Her kommer det noe snart...</p>
+</div>
diff --git a/src/Pages/App/Terms.cshtml.cs b/src/Pages/App/Terms.cshtml.cs
new file mode 100644
index 0000000..2f05cc1
--- /dev/null
+++ b/src/Pages/App/Terms.cshtml.cs
@@ -0,0 +1,12 @@
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class Terms : PageModel
+ {
+ public void OnGet()
+ {
+
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/App/Users.cshtml b/src/Pages/App/Users.cshtml
new file mode 100644
index 0000000..5a57e17
--- /dev/null
+++ b/src/Pages/App/Users.cshtml
@@ -0,0 +1,11 @@
+@page
+@model IOL.Fagprove.Pages.App.Users
+
+@{
+ ViewData["Title"] = "Brukere";
+}
+<div id="usersGrid" style="min-height: 100px"></div>
+@section Scripts
+{
+ <script src="~/scripts/users.js" asp-append-version="true"></script>
+}
diff --git a/src/Pages/App/Users.cshtml.cs b/src/Pages/App/Users.cshtml.cs
new file mode 100644
index 0000000..e7a1ceb
--- /dev/null
+++ b/src/Pages/App/Users.cshtml.cs
@@ -0,0 +1,14 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages.App
+{
+ public class Users : PageModel
+ {
+ public ActionResult OnGet()
+ {
+ if (!User.IsInRole("Administrator")) return Redirect("/app");
+ return Page();
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/Error.cshtml b/src/Pages/Error.cshtml
new file mode 100644
index 0000000..1d1a20e
--- /dev/null
+++ b/src/Pages/Error.cshtml
@@ -0,0 +1,26 @@
+@page
+@model IOL.Fagprove.Pages.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 the <strong>Development</strong> environment displays 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>
diff --git a/src/Pages/Error.cshtml.cs b/src/Pages/Error.cshtml.cs
new file mode 100644
index 0000000..e25c362
--- /dev/null
+++ b/src/Pages/Error.cshtml.cs
@@ -0,0 +1,27 @@
+using System.Diagnostics;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.Extensions.Logging;
+
+namespace IOL.Fagprove.Pages
+{
+ [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
+ public class ErrorModel : PageModel
+ {
+ public string RequestId { get; set; }
+
+ public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
+
+ private readonly ILogger<ErrorModel> _logger;
+
+ public ErrorModel(ILogger<ErrorModel> logger)
+ {
+ _logger = logger;
+ }
+
+ public void OnGet()
+ {
+ RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
+ }
+ }
+}
diff --git a/src/Pages/Login.cshtml b/src/Pages/Login.cshtml
new file mode 100644
index 0000000..31553bb
--- /dev/null
+++ b/src/Pages/Login.cshtml
@@ -0,0 +1,93 @@
+@page
+@using Microsoft.AspNetCore.Mvc.TagHelpers
+@model IOL.Fagprove.Pages.LoginModel
+@{
+ Layout = null;
+}
+
+<!DOCTYPE html>
+<html lang="no">
+<head>
+ <meta charset="utf-8"/>
+ <meta content="width=device-width, initial-scale=1.0"
+ name="viewport"/>
+ <partial name="Shared/_Favicons"/>
+ <partial name="Shared/_Stylesheets"/>
+ <link rel="stylesheet" href="~/styles/login.css">
+ <title>Logg inn - Protekt IT</title>
+</head>
+<body>
+<main>
+ <div class="ui segment">
+ <form class="ui large form"
+ id="login-form"
+ onsubmit="return false;">
+ <div class="ui error message"
+ id="error">
+ </div>
+ @Html.AntiForgeryToken()
+ <div class="field">
+ <div class="ui left icon input">
+ <i class="user icon"></i>
+ <input name="username"
+ placeholder="E-post"
+ required
+ autocomplete="username"
+ type="email">
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui left icon input">
+ <i class="lock icon"></i>
+ <input name="password"
+ placeholder="Passord"
+ required
+ autocomplete="current-password"
+ type="password">
+ </div>
+ </div>
+ <button class="ui fluid submit positive button">Logg inn</button>
+ <div class="ui divider"></div>
+ <a href="#"
+ id="forgot-pass-link"
+ title="Få nytt passord">
+ Glemt passord?
+ </a>
+ </form>
+ </div>
+</main>
+<footer>
+ <p>
+ Utviklet av
+ <a href="https://protektit.no"
+ title="Gå til Protekt IT AS sine hjemmesider">
+ Protekt IT AS
+ </a>
+ </p>
+</footer>
+<div class="ui modal mini top aligned"
+ id="forgot-form-modal">
+ <i class="close icon"></i>
+ <div class="content">
+ <form class="ui form"
+ id="forgot-form"
+ onsubmit="return false;">
+ <div class="field">
+ <div class="ui left icon input">
+ <i class="user icon"></i>
+ <input id="forgot-email"
+ placeholder="E-postadresse"
+ type="email">
+ </div>
+ </div>
+ <button class="ui fluid submit positive button"
+ disabled>
+ Send nytt passord
+ </button>
+ </form>
+ </div>
+</div>
+<partial name="Shared/_Scripts"/>
+<script src="~/scripts/login.js"></script>
+</body>
+</html> \ No newline at end of file
diff --git a/src/Pages/Login.cshtml.cs b/src/Pages/Login.cshtml.cs
new file mode 100644
index 0000000..11508d3
--- /dev/null
+++ b/src/Pages/Login.cshtml.cs
@@ -0,0 +1,13 @@
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+
+namespace IOL.Fagprove.Pages
+{
+ public class LoginModel : PageModel
+ {
+ public ActionResult OnGet() {
+ if (!User.Identity.IsAuthenticated) return Page();
+ return Redirect("/app");
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Pages/Shared/_Layout.cshtml b/src/Pages/Shared/_Layout.cshtml
new file mode 100644
index 0000000..e59dedd
--- /dev/null
+++ b/src/Pages/Shared/_Layout.cshtml
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html lang="no">
+<head>
+ <meta charset="utf-8" />
+ <meta content="width=device-width, initial-scale=1.0"
+ name="viewport" />
+ <partial name="_Stylesheets" />
+ @RenderSection("Head", required: false)
+ <title>@ViewData["Title"] - Reservasjonstjeneste</title>
+</head>
+<body class="pusher pusable">
+<partial name="_Sidebar" />
+<partial name="_TopNavbar" />
+<main class="pusher main-content">
+ @RenderBody()
+</main>
+<aside class="ui small modal"
+ id="profile-settings-modal">
+ <div class="content">
+ <form class="ui form"
+ id="edit-profile-form"
+ onsubmit="return false">
+ <div class="field">
+ <label for="password">Nytt passord</label>
+ <div class="ui left icon input">
+ <i class="lock icon"></i>
+ <input autocomplete="new-password"
+ id="password"
+ minlength="6"
+ name="password"
+ placeholder="Passord"
+ required
+ type="password">
+ </div>
+ </div>
+ <div class="field">
+ <label for="password-again">Gjenta passord</label>
+ <div class="ui left icon input">
+ <i class="lock icon"></i>
+ <input autocomplete="new-password"
+ id="password-again"
+ minlength="6"
+ name="password-again"
+ placeholder="Gjenta passord"
+ required
+ type="password">
+ </div>
+ </div>
+ <div class="field">
+ <button class="ui positive button">Lagre</button>
+ </div>
+ </form>
+ </div>
+</aside>
+<partial name="_Templates" />
+<partial name="_Scripts" />
+@RenderSection("Scripts", required: false)
+</body>
+</html>
diff --git a/src/Pages/Shared/_Scripts.cshtml b/src/Pages/Shared/_Scripts.cshtml
new file mode 100644
index 0000000..121f9db
--- /dev/null
+++ b/src/Pages/Shared/_Scripts.cshtml
@@ -0,0 +1,23 @@
+<script asp-append-version="true"
+ asp-fallback-src="//code.jquery.com/jquery-3.4.1.min.js"
+ src="~/libraries/jquery/dist/jquery.min.js"></script>
+<script asp-append-version="true"
+ src="~/libraries/kendo/kendo.all.min.js"></script>
+<script asp-append-version="true"
+ src="~/libraries/fomantic/dist/semantic.min.js"></script>
+<script asp-append-version="true"
+ src="~/libraries/kendo/kendo.messages.nb-NO.min.js"></script>
+<script asp-append-version="true"
+ src="~/libraries/kendo/kendo.culture.no.min.js"></script>
+<script asp-append-version="true"
+ src="~/libraries/jquery-pjax/jquery.pjax.js"></script>
+<script asp-append-version="true"
+ src="~/libraries/jquery-steps/jquery.steps.min.js"></script>
+<script asp-append-version="true"
+ src="~/scripts/base.js"></script>
+<script asp-append-version="true"
+ src="~/scripts/prototypes.js"></script>
+<script asp-append-version="true"
+ src="~/scripts/utils.js"></script>
+<script asp-append-version="true"
+ src="~/scripts/index.js"></script>
diff --git a/src/Pages/Shared/_Sidebar.cshtml b/src/Pages/Shared/_Sidebar.cshtml
new file mode 100644
index 0000000..b708daa
--- /dev/null
+++ b/src/Pages/Shared/_Sidebar.cshtml
@@ -0,0 +1,32 @@
+<!-- Sidebar -->
+<nav class="ui sidebar vertical labeled icon menu"
+ id="sidebar">
+ <a class="item"
+ href="/app">
+ <i class="icon far fa-home"></i>
+ Hjem
+ </a>
+ <a class="item"
+ href="/app/info">
+ <i class="icon far fa-info-circle"></i>
+ Informasjon
+ </a>
+ @if (User.IsInRole("Administrator"))
+ {
+ <a class="item"
+ href="/app/users">
+ <i class="icon far fa-users"></i>
+ Brukere
+ </a>
+ <a class="item"
+ href="/app/reservations">
+ <i class="icon far fa-clipboard-list"></i>
+ Reservasjoner
+ </a>
+ <a class="item"
+ href="/app/cabins">
+ <i class="icon far fa-hotel"></i>
+ Hytter
+ </a>
+ }
+</nav>
diff --git a/src/Pages/Shared/_Stylesheets.cshtml b/src/Pages/Shared/_Stylesheets.cshtml
new file mode 100644
index 0000000..0b506c3
--- /dev/null
+++ b/src/Pages/Shared/_Stylesheets.cshtml
@@ -0,0 +1,15 @@
+<link asp-append-version="true"
+ href="~/libraries/fomantic/dist/semantic.min.css"
+ rel="stylesheet">
+<link asp-append-version="true"
+ href="~/libraries/kendo/kendo.material-v2.min.css"
+ rel="stylesheet">
+<link asp-append-version="true"
+ href="~/libraries/fontawesome/css/fontawesome.min.css"
+ rel="stylesheet">
+<link asp-append-version="true"
+ href="~/libraries/fontawesome/css/regular.min.css"
+ rel="stylesheet">
+<link asp-append-version="true"
+ href="~/styles/index.css"
+ rel="stylesheet">
diff --git a/src/Pages/Shared/_Templates.cshtml b/src/Pages/Shared/_Templates.cshtml
new file mode 100644
index 0000000..b153a1e
--- /dev/null
+++ b/src/Pages/Shared/_Templates.cshtml
@@ -0,0 +1,210 @@
+@using IOL.Fagprove.Data
+<div style="display: none">
+ <script id="editCabinInfoModalTemplate"
+ type="text/x-kendo-template">
+<i class="close icon"></i>
+<div class="header">
+ Rediger #= data.name #
+</div>
+<div class="content">
+ <form class="ui form"
+ id="editCabinForm"
+ onsubmit="return false">
+ <input type="hidden" name="id" id="id" value="#= data.id #">
+ <div class="two fields">
+ <div class="field required">
+ <label for="name">Navn</label>
+ <input id="name"
+ name="name"
+ required
+ value="#= data.name #"
+ type="text">
+ </div>
+ <div class="field">
+ <label for="categoryId">Hyttefelt</label>
+ <select class="ui selection dropdown"
+ id="categoryId"
+ name="categoryId">
+ @foreach (var field in StaticData.CabinFields)
+ {
+ <option value="@field.Id">@field.Name</option>
+ }
+ </select>
+ </div>
+ </div>
+ <div class="two fields">
+ <div class="field">
+ <label for="price">Pris pr. natt</label>
+ <input id="price"
+ name="price"
+ value="#= data.price #"
+ type="text">
+ </div>
+ <div class="field">
+ <label for="capacity">Sengeplasser</label>
+ <input id="capacity"
+ name="capacity"
+ value="#= data.capacity #"
+ type="number">
+ </div>
+ </div>
+ <div class="field">
+ <label for="description">Beskrivelse</label>
+ <textarea id="description"
+ name="description"
+ type="text">#= data.description #</textarea>
+ </div>
+ </form>
+</div>
+<div class="actions">
+ <div class="ui black deny button">
+ Avbryt
+ </div>
+ <div class="ui green right labeled icon button"
+ id="submitEditCabinForm">
+ Oppdater
+ <i class="checkmark icon"></i>
+ </div>
+</div>
+ </script>
+
+ <script id="newCabinInfoModalTemplate"
+ type="text/x-kendo-template">
+<i class="close icon"></i>
+<div class="header">
+ Ny hytte
+</div>
+<div class="content">
+ <form class="ui form"
+ id="newCabinForm"
+ onsubmit="return false">
+ <div class="two fields">
+ <div class="field required">
+ <label for="name">Navn</label>
+ <input id="name"
+ name="name"
+ required
+ type="text">
+ </div>
+ <div class="field">
+ <label for="categoryId">Hyttefelt</label>
+ <select class="ui selection dropdown"
+ id="categoryId"
+ name="categoryId">
+ @foreach (var field in StaticData.CabinFields)
+ {
+ <option value="@field.Id">@field.Name</option>
+ }
+ </select>
+ </div>
+ </div>
+ <div class="two fields">
+ <div class="field">
+ <label for="price">Pris pr. natt</label>
+ <input id="price"
+ name="price"
+ type="text">
+ </div>
+ <div class="field">
+ <label for="capacity">Sengeplasser</label>
+ <input id="capacity"
+ name="capacity"
+ type="number">
+ </div>
+ </div>
+ <div class="field">
+ <label for="description">Beskrivelse</label>
+ <textarea id="description"
+ name="description"
+ type="text"></textarea>
+ </div>
+ </form>
+</div>
+<div class="actions">
+ <div class="ui black deny button">
+ Avbryt
+ </div>
+ <div class="ui green right labeled icon button"
+ id="submitNewCabinForm">
+ Lagre
+ <i class="checkmark icon"></i>
+ </div>
+</div>
+</script>
+
+ <script id="cabinRowCommandButtons"
+ type="text/x-kendo-template">
+ <div class="ui compact buttons">
+ <button class='ui compact button primary' onclick="openEditCabinModal(this)">Rediger</button>
+ <button class='ui compact button red' onclick="deleteCabin(this)">Slett</button>
+ </div>
+ </script>reservationsRowCommandButtons
+ <script id="reservationsRowCommandButtons"
+ type="text/x-kendo-template">
+ <div class="ui compact buttons">
+ <button class="ui compact button primary" onclick="inspectReservation(this)">Detaljer</button>
+ # if(data.status !== 3 && data.status !== 1) { #
+ <button class='ui compact button green' onclick="grantReservation(this)">Godkjenn</button>
+ # } #
+ # if(data.status !== 3 && data.status !== 2) { #
+ <button class='ui compact button red' onclick="rejectReservation(this)">Avvis</button>
+ # } #
+ </div>
+ </script>
+ <script id="reservationStatusTextTemplate"
+ type="text/x-kendo-template">
+ # switch (data.status) {
+ case 0: #
+ <span class='ui teal label'>VENTENDE</span>
+ # break; #
+ # case 1: #
+ <span class='ui green label'>GODKJENT</span>
+ # break; #
+ # case 2: #
+ <span class='ui red label'>AVVIST</span>
+ # break; #
+ # case 3: #
+ <span class='ui grey label'>INAKTIV</span>
+ # break; #
+ # }#
+ </script>
+
+ <script id="reservationInfoTemplate" type="text/x-kendo-template">
+ <i class="close icon"></i>
+ <div class="header">
+ Reservasjon - #= data.name #
+ </div>
+ <div class="content">
+ <div class="description">
+ <div class="ui header">#= data.name #</div>
+ <p>Fra: #= data.from #</p>
+ <p>Til: #= data.to #</p>
+ <p>Hytte: #= data.cabin #</p>
+ <p>Status: #= data.status #</p>
+ # switch (data.status) {
+ case 0: #
+ <p>Status: <span class='ui teal label'>VENTENDE</span></p>
+ # break; #
+ # case 1: #
+ <p>Status: <span class='ui green label'>GODKJENT</span></p>
+ # break; #
+ # case 2: #
+ <p>Status: <span class='ui red label'>AVVIST</span></p>
+ # break; #
+ # case 3: #
+ <p>Status: <span class='ui grey label'>INAKTIV</span></p>
+ # break; #
+ # }#
+ # if(data.description) { #
+ <span class="ui large text">Kommentar</span>
+ <p>#= data.description #</p>
+ # } #
+ </div>
+ </div>
+ <div class="actions">
+ <div class="ui deny button">
+ Lukk
+ </div>
+ </div>
+ </script>
+</div>
diff --git a/src/Pages/Shared/_TopNavbar.cshtml b/src/Pages/Shared/_TopNavbar.cshtml
new file mode 100644
index 0000000..6d71cd3
--- /dev/null
+++ b/src/Pages/Shared/_TopNavbar.cshtml
@@ -0,0 +1,30 @@
+<!-- Top navbar -->
+<nav class="ui top fixed icon menu" id="navbar">
+ <div class="left menu">
+ <a class="item"
+ data-target="#sidebar"
+ href="#"
+ id="sidebar-menu-toggler">
+ <i class="sidebar icon"></i>
+ </a>
+ <div class="item"><span class="ui large text">@ViewData["Title"]</span></div>
+ </div>
+ <div class="right menu basic">
+ <div class="ui dropdown item">
+ <i class="user circle outline large icon"></i>
+ @User.Identity.Name
+ <div class="menu large">
+ <div class="item"
+ id="profile-options-button">
+ <i class="user cog icon"></i>
+ Innstillinger
+ </div>
+ <div class="item"
+ id="log-out-button">
+ <i class="sign out alternate icon"></i>
+ Logg ut
+ </div>
+ </div>
+ </div>
+ </div>
+</nav>
diff --git a/src/Pages/_ViewImports.cshtml b/src/Pages/_ViewImports.cshtml
new file mode 100644
index 0000000..ce091e4
--- /dev/null
+++ b/src/Pages/_ViewImports.cshtml
@@ -0,0 +1,3 @@
+@using IOL.Fagprove
+@namespace PIT.ReservationService.Pages
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
diff --git a/src/Pages/_ViewStart.cshtml b/src/Pages/_ViewStart.cshtml
new file mode 100644
index 0000000..a5f1004
--- /dev/null
+++ b/src/Pages/_ViewStart.cshtml
@@ -0,0 +1,3 @@
+@{
+ Layout = "_Layout";
+}