summaryrefslogtreecommitdiffstats
path: root/src/Pages/Shared/_Templates.cshtml
blob: b153a1e418f52cf8e09614e2d153cd177522787d (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
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>