diff --git a/src/main/webapp/templates/forecastConfigurationForm.ftl b/src/main/webapp/templates/forecastConfigurationForm.ftl index 5b33181852c11f046845e4f01ce215c40ff83ce4..601f80a85eb1b3f4e6c69c14a2ec18ed1b280cfa 100755 --- a/src/main/webapp/templates/forecastConfigurationForm.ftl +++ b/src/main/webapp/templates/forecastConfigurationForm.ftl @@ -15,6 +15,7 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. --><#include "master.ftl"> +<#assign isGridForecastSupported = (user.organizationId.defaultGridWeatherStationDataSource?has_content)> <#macro page_head> <title>${i18nBundle.viewForecastConfiguration}</title> </#macro> @@ -229,7 +230,9 @@ }; // Setting weather station select list state correct on page load + <#if isGridForecastSupported> handleUseGridWeatherDataClicked(document.getElementById("useGridWeatherData")<#if forecastConfiguration.weatherStationPointOfInterestId?has_content && forecastConfiguration.weatherStationPointOfInterestId.pointOfInterestId?has_content>,${forecastConfiguration.weatherStationPointOfInterestId.pointOfInterestId}</#if>); + </#if> </script> </#macro> @@ -325,7 +328,9 @@ <div class="form-group"> <label for="weatherStationPointOfInterestId">${i18nBundle.weatherStationPointOfInterestId}</label> <select class="form-control" id="weatherStationPointOfInterestId" name="weatherStationPointOfInterestId" onblur="if(!document.getElementById('useGridWeatherData').checked) {validateField(this);};"> - <option value="-2">${i18nBundle.doNotUse} ${i18nBundle.weatherStationPointOfInterestId?lower_case}</option> + <#if isGridForecastSupported> + <option value="-2">${i18nBundle.doNotUse} ${i18nBundle.weatherStationPointOfInterestId?lower_case}</option> + </#if> <option value="-1"<#if !forecastConfiguration.weatherStationPointOfInterestId?has_content && !forecastConfiguration.useGridWeatherData> selected="selected"</#if>>${i18nBundle.pleaseSelect} ${i18nBundle.weatherStationPointOfInterestId?lower_case}</option> <#list weatherStationPointOfInterests?sort_by("name") as poi> <option value="${poi.pointOfInterestId}"<#if @@ -336,15 +341,17 @@ </select> <span class="help-block" id="${formId}_weatherStationPointOfInterestId_validation"></span> </div> - <input type="hidden" id="weatherStationPointOfInterestIdHidden" name="weatherStationPointOfInterestIdDisabled" value="-2" disabled="disabled"/> - <div class="form-group"> - <div class="checkbox"> - <label> - <input type="checkbox" id="useGridWeatherData" name="useGridWeatherData"<#if forecastConfiguration.useGridWeatherData?has_content && forecastConfiguration.useGridWeatherData == true> checked="checked"</#if> onclick="handleUseGridWeatherDataClicked(this);"/> - </label> - ${i18nBundle.useGridWeatherData} - <span class="help-block" id="${formId}_useGridWeatherData_validation"></span> - </div> + <#if isGridForecastSupported> + <input type="hidden" id="weatherStationPointOfInterestIdHidden" name="weatherStationPointOfInterestIdDisabled" value="-2" disabled="disabled"/> + <div class="form-group"> + <div class="checkbox"> + <label> + <input type="checkbox" id="useGridWeatherData" name="useGridWeatherData"<#if forecastConfiguration.useGridWeatherData?has_content && forecastConfiguration.useGridWeatherData == true> checked="checked"</#if> onclick="handleUseGridWeatherDataClicked(this);"/> + </label> + ${i18nBundle.useGridWeatherData} + <span class="help-block" id="${formId}_useGridWeatherData_validation"></span> + </div> + </#if> <#else> <input type="hidden" name="multipleNew" value="true"/> <div class="form-group">