Projekt

Obecné

Profil

Stáhnout (11.2 KB) Statistiky
| Větev: | Revize:
1
<!doctype html>
2
<html ng-app="pvpk" lang="cs">
3
<head>
4
    <meta charset="utf-8">
5
    <title>Průjezd vozidel - Plzeňský kraj</title>
6
    <meta http-equiv="x-ua-compatible" content="ie=edge">
7

    
8
    <meta name="description" content="Zobrazení dat o průjezdu vozidel pro Plzeňský kraj">
9
    <meta name="viewport" content="width=device-width, initial-scale=1">
10

    
11
    <?php
12
    include_once __TOKEN_GENERATOR_PATH__;
13
    $token = generateToken();
14
    ?>
15
    <script>
16
        var __API_TOKEN__ = '<?=$token ?>';
17
    </script>
18
</head>
19
<body ng-controller="mainController" class="container-fluid">
20

    
21
<div id="loadingScreen" ng-show="showLoadingScreen">
22
    <h1 id="logo">
23
        <img src="./assets/images/logo.png" alt="logo" width="20" height="18">
24
        &nbsp;Průjezd vozidel&nbsp;
25
        <small>Plzeňský kraj</small>
26
    </h1>
27
    <div class="loading"></div>
28
    <noscript id="noscript">Aplikace vyžaduje Javascript. Aktivujte Javascript a znovu načtěte tuto stránku.
29
    </noscript>
30
</div>
31

    
32
<div class="row h-100" ng-init="load()">
33

    
34
    <!--SEARCH section-->
35
    <section class="search col-12 col-lg-3" id="search" ng-controller="searchController">
36

    
37
        <div class="w-100 searchWrapper">
38
            <header class="mt-2">
39
                <h1>
40
                    <img src="./assets/images/logo.png" alt="logo" width="20" height="18">&nbsp;Průjezd vozidel&nbsp;
41
                    <small>Plzeňský kraj</small>
42
                </h1>
43
            </header>
44

    
45
            <div class="mb-4 mt-4">
46
                <div class="form-group">
47
                    <label for="searchLocation" class="h5">Hledání - lokalit</label>
48
                    <input type="search" id="searchLocation" name="location"
49
                           class="form-control form-control-sm" placeholder="Město, ulice, ..."
50
                           ng-model="search.q" required maxlength="255" autocomplete="off"
51
                           ng-change="searchLocations()"
52
                           ng-model-options="{debounce: 600}">
53
                </div>
54
                <div class="custom-control custom-checkbox mb-3">
55
                    <input type="checkbox" id="searchIsDirection" name="searchIsDirection" class="custom-control-input"
56
                           checked required
57
                           ng-model="search.isDirection"
58
                           ng-change="searchLocations()"
59
                           ng-model-options="{debounce: 600}">
60
                    <label for="searchIsDirection" class="custom-control-label">Rozlišovat směr</label>
61
                </div>
62
            </div>
63

    
64
            <div class="result-locations mb-4 mt-4">
65
                <h5>Lokality</h5>
66

    
67
                <div class="list-group" ng-show="locations.length>0 && !showSearchLoading">
68
                    <a href="" id="location-{{location.id}}"
69
                       class="list-group-item list-group-item-action flex-column align-items-start"
70
                       ng-repeat="location in locations"
71
                       ng-click="selectDevice(location.id,location.direction)"
72
                       ng-class="{'active': $root.selectDevice.id == location.id && (!$root.selectDevice.direction  || $root.selectDevice.direction ==location.direction)}">
73

    
74
                        <div class="d-flex w-100 justify-content-between">
75
                            <h6 class="mb-1">{{location.name}}</h6>
76
                            <small ng-show="search.isDirection">{{location.direction ==1 ? 'po směru': 'proti směru' }}
77
                            </small>
78
                        </div>
79
                        <address class="small">{{location.street}}, {{location.town}}</address>
80

    
81
                    </a>
82
                </div>
83

    
84
                <div class="form-text text-center small" ng-show="locations.length==0 && !showSearchLoading">
85
                    Žádná lokalita
86
                </div>
87

    
88
                <div class="loading" ng-show="showSearchLoading"></div>
89
            </div>
90
        </div>
91
        <footer class="text-center text-muted mb-2 mt-2 w-100 small">
92
            © 2018 FAV, ZČU • version: {{ config.APP_VERSION }}
93
        </footer>
94
    </section>
95

    
96

    
97
    <!--INFO section-->
98
    <section class="info col-12 col-lg-5" id="info" ng-show="$root.selectDevice!=null"
99
             ng-controller="infoController">
100

    
101
        <header class="mt-2">
102
            <h4>{{$root.selectDevice.name}}
103
                <button type="button" class="close" aria-label="Close" ng-click="infoClose()">
104
                    <span aria-hidden="true">&times;</span>
105
                </button>
106
            </h4>
107
            <address>{{$root.selectDevice.street}}, {{$root.selectDevice.town}}</address>
108
        </header>
109

    
110
        <div class="form-inline mb-4 mt-2">
111
            <label for="selectDeviceDirection" class="=hidden"></label>
112
            <select id="selectDeviceDirection" class="custom-select custom-select-sm"
113
                    ng-model="$root.selectDevice.direction"
114
                    ng-change="changeDirection(direction.id)"
115
                    ng-options="direction.id as direction.name for direction in directions"
116
                    ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
117
            </select>
118
        </div>
119

    
120

    
121
        <div class="alert alert-warning" role="alert"
122
             ng-show="!(range.fromDate >= range.minDate && range.toDate <= range.maxDate && range.toDate >= range.minDate && range.fromDate <= range.maxDate)">
123

    
124
            Data jsou k dispozici jen v rosahu {{range.minDate | date:"dd.MM.yyyy"}} - {{range.maxDate| date:"dd.MM.yyyy"}}
125

    
126
        </div>
127

    
128

    
129
        <div class="mb-4 mt-4" ng-form="rangeForm">
130
            <div class="form-row">
131
                <div class="form-group col">
132
                    <label for="rangeFromDate">Období</label>
133
                    <input type="date" id="rangeFromDate"
134
                           class="form-control form-control-sm" ng-model="range.fromDate" required
135
                           ng-class="{ 'is-invalid': range.fromDate>range.toDate}"
136
                           ng-change="changeRange()"
137
                           ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
138
                    <div class="invalid-feedback">
139
                        Tento datum musí být menší.
140
                    </div>
141
                </div>
142

    
143
                <div class="form-group col">
144
                    <label for="rangeToDate" class="invisible">Období</label>
145
                    <input type="date" id="rangeToDate"
146
                           class="form-control form-control-sm" ng-model="range.toDate" required
147
                           ng-class="{ 'is-invalid': range.fromDate>range.toDate}"
148
                           ng-change="changeRange()"
149
                           ng-model-options="{updateOn: 'default', allowInvalid: true, debounce: 600}">
150
                    <div class="invalid-feedback">
151
                        Tento datum musí být vetší.
152
                    </div>
153
                </div>
154
            </div>
155
            <div class="form-row">
156
                <div class="form-group col">
157
                    <label for="rangeFromTime">
158
                        <div class="custom-control custom-checkbox">
159
                            <input type="checkbox" id="rangeIsTime" name="rangeIsTime" class="custom-control-input"
160
                                   checked required
161
                                   ng-model="range.isTime"
162
                                   ng-model-options="{debounce: 300}"
163
                                   ng-change="changeRange()">
164
                            <label for="rangeIsTime" class="custom-control-label">Zobrazit časové rozmezí dne</label>
165
                        </div>
166
                    </label>
167
                    <input type="time" id="rangeFromTime" class="form-control form-control-sm"
168
                           ng-model="range.fromTime" required
169
                           ng-class="{'is-invalid': range.fromTime>=range.toTime}"
170
                           ng-change="changeRange()"
171
                           ng-model-options="{debounce: 600}"
172
                           ng-show="range.isTime">
173
                    <div class="invalid-feedback" ng-show="range.isTime">
174
                        Tento čas musí být menší.
175
                    </div>
176
                </div>
177

    
178
                <div class="form-group col">
179
                    <label for="rangeToTime" class="invisible">Časové rozmezí dne</label>
180
                    <input type="time" id="rangeToTime" class="form-control form-control-sm"
181
                           ng-model="range.toTime" required
182
                           ng-class="{'is-invalid': range.fromTime>=range.toTime}"
183
                           ng-change="changeRange()"
184
                           ng-model-options="{debounce: 600}"
185
                           ng-show="range.isTime">
186
                    <div class="invalid-feedback" ng-show="range.isTime">
187
                        Tento čas musí být vetší.
188
                    </div>
189
                </div>
190
            </div>
191
        </div>
192

    
193
        <div class="loading" ng-show="showInfoLoading"></div>
194

    
195
        <div id="graphs" ng-show="$root.selectDevice!=null && $root.selectDevice.traffics.length>0 && !showInfoLoading">
196
            <h4 class="mt-4">{{range.isTime ? "Průměrná rychlost za den" : "Průměrná rychlost za jednotlivé dny"}}</h4>
197
            <graph-average-speed></graph-average-speed>
198

    
199
            <h4 class="mt-4">{{range.isTime ? "Počet vozidel za den" : "Průměrná rychlost za jednotlivé dny"}}</h4>
200
            <graph-number-vehicles></graph-number-vehicles>
201

    
202
            <div class="text-center">
203
                <a class="btn btn-dark" href="{{ urlExportCsv }}" role="button">Export CSV</a>
204
            </div>
205

    
206
            <div class="text-center mb-2 mt-2 w-100 small">
207
                zdroj dat: <a class="source-link" target="_blank" rel="noopener"
208
                              href="https://doprava.plzensky-kraj.cz">doprava.plzensky-kraj.cz</a>
209

    
210
            </div>
211
        </div>
212

    
213
        <div class="form-text text-center small"
214
             ng-show="$root.selectDevice && $root.selectDevice.traffics.length==0 && !showInfoLoading">
215
            Data nejsou k dispozici
216
        </div>
217
    </section>
218

    
219
    <!--MAP section-->
220
    <section class="map col-12" id="map"
221
             ng-class="{ 'col-lg-9': $root.selectDevice==null, 'col-lg-4': $root.selectDevice!=null }"
222
             ng-controller="mapController">
223
    </section>
224
</div>
225

    
226
<div class="modal fade" id="modalError" tabindex="-1" role="dialog">
227
    <div class="modal-dialog" role="document">
228
        <div class="modal-content">
229
            <div class="modal-header">
230
                <h5 class="modal-title">{{modalError.title}}</h5>
231
            </div>
232
            <div class="modal-body">
233
                <p>{{modalError.body}}</p>
234
            </div>
235
            <div class="modal-footer">
236
                <button type="button" class="btn btn-primary" data-dismiss="{{modalError.clickButton ? '' : 'modal'}}"
237
                        ng-click="modalError.clickButton && modalError.clickButton()">{{modalError.button}}
238
                </button>
239
            </div>
240
        </div>
241
    </div>
242
</div>
243

    
244

    
245
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk"
246
        type="text/javascript"></script>
247

    
248
</body>
249
</html>
    (1-1/1)