2015-07-08 21:29:55 +00:00
|
|
|
<?php
|
|
|
|
\OCP\Util::addScript('weather', 'angular/angular.min');
|
|
|
|
\OCP\Util::addScript('weather', 'public/app');
|
|
|
|
\OCP\Util::addStyle('weather', 'style');
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="ng-scope" id="app" ng-app="Weather" ng-controller="WeatherController">
|
|
|
|
<div id="city-list-left">
|
|
|
|
<ul class="city-list">
|
2015-07-18 08:03:58 +00:00
|
|
|
<li ng-repeat="city in cities" class="city-list-item {{ city.id == selectedCityId ? 'selected' : ''}}">
|
2015-07-09 19:35:17 +00:00
|
|
|
<a href="#" ng-click="loadCity(city);">{{ city.name }}</a>
|
2015-07-08 21:29:55 +00:00
|
|
|
<div class="icon-delete svn delete action" ng-click="deleteCity(city);"></div>
|
|
|
|
</li>
|
|
|
|
<li>
|
2015-07-08 22:05:57 +00:00
|
|
|
<a href="#" ng-click="showAddCity = true;">Add a city...</a>
|
|
|
|
<div ng-show="showAddCity == true" id="create-city">
|
|
|
|
<h1>Add city</h1>
|
2015-07-08 21:29:55 +00:00
|
|
|
<hr>
|
2015-07-08 22:05:57 +00:00
|
|
|
<h2>City name</h2>
|
|
|
|
<span class="city-form-error" ng-show="addCityError != ''">{{ addCityError }}</span>
|
2015-07-08 21:29:55 +00:00
|
|
|
<form novalidate>
|
|
|
|
<input type="textbox" ng-model="city.name"/>
|
2015-07-08 22:05:57 +00:00
|
|
|
<input type="submit" value="Add" ng-click="addCity(city);"/>
|
|
|
|
<input type="button" value="Cancel" ng-click="showAddCity = false;"/>
|
2015-07-08 21:29:55 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2015-07-09 19:35:17 +00:00
|
|
|
<div id="city-right" ng-show="cityLoadError != ''">
|
|
|
|
<span class="city-load-error">{{ cityLoadError }}</span>
|
|
|
|
</div>
|
2015-07-18 07:46:06 +00:00
|
|
|
<div id="city-right" ng-show="currentCity != null" style="background-image: url('{{ owncloudAppImgPath }}/img/{{ currentCity.image }}');">
|
2015-07-11 15:43:34 +00:00
|
|
|
<div id="city-weather-panel">
|
2015-07-18 08:01:38 +00:00
|
|
|
<div class="city-name">
|
|
|
|
{{ currentCity.name }}, {{ currentCity.sys.country }}
|
|
|
|
<img class="home-icon" src="{{ owncloudAppImgPath }}/img/home-{{ selectedCityId == homeCity ? 'no' : '' }}pick.png" />
|
|
|
|
</div>
|
2015-07-11 15:43:34 +00:00
|
|
|
<div class="city-current-temp">{{ currentCity.main.temp }}°C</div>
|
|
|
|
<div class="city-current-pressure">Pressure: {{ currentCity.main.pressure }} hpa</div>
|
|
|
|
<div class="city-current-humidity">Humidity: {{ currentCity.main.humidity}}%</div>
|
|
|
|
<div class="city-current-weather">Cloudiness: {{ currentCity.weather[0].description }}</div>
|
|
|
|
<div class="city-current-wind">Wind: {{ currentCity.wind.speed }} m/s - {{ currentCity.wind.desc }}</div>
|
|
|
|
<div class="city-current-sunrise">Sunrise: {{ currentCity.sys.sunrise * 1000 | date:'HH:mm' }} Sunset: {{ currentCity.sys.sunset * 1000 | date:'HH:mm' }}</div>
|
|
|
|
</div>
|
2015-07-15 19:38:29 +00:00
|
|
|
<div id="city-forecast-panel">
|
|
|
|
<table>
|
|
|
|
<tr><th>Hour</th><th>Temperature</th><th>Weather</th><th>Pressure</th><th>Wind</th></tr>
|
|
|
|
<tr ng-repeat="forecast in currentCity.forecast">
|
|
|
|
<td>{{ forecast.hour * 1000 | date:'HH:mm'}}</td>
|
|
|
|
<td>{{ forecast.temperature }}°C</td>
|
|
|
|
<td>{{ forecast.weather }}</td>
|
|
|
|
<td>{{ forecast.pressure }}</td>
|
|
|
|
<td>{{ forecast.wind.speed }} m/s - {{ forecast.wind.desc }}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2015-07-08 21:29:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|