summaryrefslogtreecommitdiffstats
path: root/src/Pages/App/ReservationForm.cshtml
blob: 87df33749055ff2408cd863fefc56c5c61db4657 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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>
}