2015-07-08 21:29:55 +00:00
|
|
|
<?php
|
2017-07-03 20:33:26 +00:00
|
|
|
\OCP\Util::addScript('weather', 'angular.min');
|
|
|
|
\OCP\Util::addScript('weather', 'app');
|
2015-07-08 21:29:55 +00:00
|
|
|
\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>
|
2017-08-17 12:18:27 +00:00
|
|
|
<a href="#" ng-click="city.name = ''; addCityError = ''; showAddCity = true;"><?php p($l->t('Add a city')); ?>...</a>
|
2015-07-08 22:05:57 +00:00
|
|
|
<div ng-show="showAddCity == true" id="create-city">
|
2017-08-17 12:18:27 +00:00
|
|
|
<h1><?php p($l->t('Add city')); ?></h1>
|
2015-07-08 21:29:55 +00:00
|
|
|
<hr>
|
2017-08-17 12:18:27 +00:00
|
|
|
<h2><?php p($l->t('City name')); ?></h2>
|
2015-07-08 22:05:57 +00:00
|
|
|
<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"/>
|
2017-08-17 12:18:27 +00:00
|
|
|
<input type="submit" value="<?php p($l->t('Add')); ?>" ng-click="addCity(city);"/>
|
|
|
|
<input type="button" value="<?php p($l->t('Cancel')); ?>" ng-click="showAddCity = false;"/>
|
2015-07-08 21:29:55 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2015-10-25 09:57:07 +00:00
|
|
|
<div id="app-settings" class="ng-scope">
|
|
|
|
<div id="app-settings-header">
|
2017-08-17 12:18:27 +00:00
|
|
|
<button name="app settings" class="settings-button" data-apps-slide-toggle="#app-settings-content"><?php p($l->t('Settings')); ?></button>
|
2015-10-25 09:57:07 +00:00
|
|
|
</div>
|
|
|
|
<div style="display: none;" id="app-settings-content">
|
2017-08-17 12:18:27 +00:00
|
|
|
<h2><?php p($l->t('Metric')); ?></h2>
|
2015-10-25 10:30:05 +00:00
|
|
|
<select name="metric" ng-change="modifyMetric()" ng-model="metric">
|
|
|
|
<option value="metric">°C</option>
|
|
|
|
<option value="kelvin">°K</option>
|
|
|
|
<option value="imperial">°F</option>
|
|
|
|
</select>
|
2015-10-25 09:57:07 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-07-08 21:29:55 +00:00
|
|
|
</div>
|
2015-07-09 19:35:17 +00:00
|
|
|
<div id="city-right" ng-show="cityLoadError != ''">
|
2015-10-25 12:04:03 +00:00
|
|
|
<span class="city-load-error">
|
|
|
|
{{ cityLoadError }}<br /><br />
|
2017-08-17 12:18:27 +00:00
|
|
|
<a href="http://home.openweathermap.org/users/sign_in" ng-show="cityLoadNeedsAPIKey == true"><?php p($l->t('Click here to get an API key')); ?></a>
|
2015-10-25 12:04:03 +00:00
|
|
|
</span>
|
2015-07-09 19:35:17 +00:00
|
|
|
</div>
|
2016-12-27 22:41:14 +00:00
|
|
|
<div id="city-right" ng-show="cityLoadError == '' && currentCity != null" style="background-image: url('{{ owncloudAppImgPath }}{{ 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 }}
|
2016-12-27 22:41:14 +00:00
|
|
|
<img ng-show="selectedCityId == homeCity" src="{{ owncloudAppImgPath }}home-pick.png" />
|
|
|
|
<img class="home-icon" ng-click="setHome(selectedCityId);" ng-show="selectedCityId != homeCity" src="{{ owncloudAppImgPath }}home-nopick.png" />
|
2015-07-18 08:01:38 +00:00
|
|
|
</div>
|
2015-10-25 10:30:05 +00:00
|
|
|
<div class="city-current-temp">{{ currentCity.main.temp }}{{ metricRepresentation }}</div>
|
2017-08-17 12:18:27 +00:00
|
|
|
<div class="city-current-pressure"><?php p($l->t('Pressure')); ?>: {{ currentCity.main.pressure }} hpa</div>
|
|
|
|
<div class="city-current-humidity"><?php p($l->t('Humidity')); ?>: {{ currentCity.main.humidity}}%</div>
|
|
|
|
<div class="city-current-weather"><?php p($l->t('Cloudiness')); ?>: {{ currentCity.weather[0].description }}</div>
|
|
|
|
<div class="city-current-wind"><?php p($l->t('Wind')); ?>: {{ currentCity.wind.speed }} m/s - {{ currentCity.wind.desc }}</div>
|
2020-03-16 08:27:32 +00:00
|
|
|
<div class="city-current-sunrise"><?php p($l->t('Sunrise')); ?>: {{ currentCity.sys.sunrise * 1000 | date:'HH:mm' }}</div>
|
|
|
|
<div class=city-current-sunset"><?php p($l->t('Sunset')); ?>: {{ currentCity.sys.sunset * 1000 | date:'HH:mm' }}</div>
|
2015-07-11 15:43:34 +00:00
|
|
|
</div>
|
2015-07-15 19:38:29 +00:00
|
|
|
<div id="city-forecast-panel">
|
|
|
|
<table>
|
2017-08-17 12:18:27 +00:00
|
|
|
<tr>
|
2019-05-19 08:30:28 +00:00
|
|
|
<th><?php p($l->t('Date')); ?></th>
|
2017-08-17 12:18:27 +00:00
|
|
|
<th><?php p($l->t('Temperature')); ?></th>
|
|
|
|
<th><?php p($l->t('Weather')); ?></th>
|
|
|
|
<th><?php p($l->t('Pressure')); ?></th>
|
2019-05-27 15:36:04 +00:00
|
|
|
<th><?php p($l->t('Humidity')); ?></th>
|
2017-08-17 12:18:27 +00:00
|
|
|
<th><?php p($l->t('Wind')); ?></th>
|
|
|
|
</tr>
|
2015-07-15 19:38:29 +00:00
|
|
|
<tr ng-repeat="forecast in currentCity.forecast">
|
2019-05-19 08:30:28 +00:00
|
|
|
<td>{{ forecast.date }}</td>
|
2015-10-25 10:30:05 +00:00
|
|
|
<td>{{ forecast.temperature }}{{ metricRepresentation }}</td>
|
2015-07-15 19:38:29 +00:00
|
|
|
<td>{{ forecast.weather }}</td>
|
2019-05-27 15:36:04 +00:00
|
|
|
<td>{{ forecast.pressure }} hpa</td>
|
|
|
|
<td>{{ forecast.humidity }} %</td>
|
2015-07-15 19:38:29 +00:00
|
|
|
<td>{{ forecast.wind.speed }} m/s - {{ forecast.wind.desc }}</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2015-07-08 21:29:55 +00:00
|
|
|
</div>
|
|
|
|
</div>
|