stock images description properties file
This commit is contained in:
@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RestController
|
@RestController
|
||||||
public class Main extends SpringBootServletInitializer {
|
public class Main extends SpringBootServletInitializer {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(Main.class);
|
public static final Logger LOGGER = LogManager.getLogger(Main.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package de.jottyfan.camporganizer.module.staticpages;
|
package de.jottyfan.camporganizer.module.staticpages;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
@ -14,6 +16,9 @@ import de.jottyfan.camporganizer.module.camplist.CommonController;
|
|||||||
@Controller
|
@Controller
|
||||||
public class StaticPagesController extends CommonController {
|
public class StaticPagesController extends CommonController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StaticPagesService service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* load the index page
|
* load the index page
|
||||||
*
|
*
|
||||||
@ -21,7 +26,7 @@ public class StaticPagesController extends CommonController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public String getIndex() {
|
public String getIndex() {
|
||||||
return "/allgemeines";
|
return "redirect:/allgemeines";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,7 +75,8 @@ public class StaticPagesController extends CommonController {
|
|||||||
* @return the allgemeines page
|
* @return the allgemeines page
|
||||||
*/
|
*/
|
||||||
@GetMapping("/allgemeines")
|
@GetMapping("/allgemeines")
|
||||||
public String getAllgemeines() {
|
public String getAllgemeines(final Model model) {
|
||||||
|
model.addAttribute("title", service.getStockDescription());
|
||||||
return "/allgemeines";
|
return "/allgemeines";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
package de.jottyfan.camporganizer.module.staticpages;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.core.io.ResourceLoader;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import de.jottyfan.camporganizer.Main;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author jotty
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StaticPagesService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ResourceLoader resourceLoader;
|
||||||
|
|
||||||
|
public Properties getStockDescription() {
|
||||||
|
Resource resource = resourceLoader.getResource(
|
||||||
|
"classpath:/static/images/stock.properties"
|
||||||
|
);
|
||||||
|
Properties properties = new Properties();
|
||||||
|
try {
|
||||||
|
properties.load(resource.getInputStream());
|
||||||
|
} catch (IOException e) {
|
||||||
|
Main.LOGGER.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
10
src/main/resources/static/images/stock.properties
Normal file
10
src/main/resources/static/images/stock.properties
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
stock02 = Heimfreizeit - Spiele im Wertwiesenpark
|
||||||
|
stock25 = Olfen - Gutes Essen
|
||||||
|
stock27 = Olfen - Miniaturdorf im Wald
|
||||||
|
stock29 = Olfen - Die Frohe Stunde am Morgen
|
||||||
|
stock52 = Rehe 2 - Kreative Ideen
|
||||||
|
stock63 = Schweiz - Blaue Bergseen
|
||||||
|
stock71 = Heimfreizeit - Kreuzkirche ECG Heilbronn
|
||||||
|
stock83 = Schweiz - Aufstieg in die Berge
|
||||||
|
stock84 = Hohenhaslach - Mitten in den Weinbergen
|
||||||
|
stock85 = Rehe 2 - Gemeinsame Andacht
|
@ -23,10 +23,10 @@
|
|||||||
<div class="col-12 center mb-3">
|
<div class="col-12 center mb-3">
|
||||||
<a href="#" onclick="$('#fotoblock').fadeOut(1000); $('#welcomeblock').slideDown('slow');" class="btn btn-outline-secondary"><i class="fas fa-arrow-up"></i> Startseite</a>
|
<a href="#" onclick="$('#fotoblock').fadeOut(1000); $('#welcomeblock').slideDown('slow');" class="btn btn-outline-secondary"><i class="fas fa-arrow-up"></i> Startseite</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12" style="max-height: 100px; overflow: auto">
|
||||||
<th:block th:each="i : ${#numbers.sequence(1, 83)}">
|
<th:block th:each="n : ${#numbers.sequence(1, 85)}" th:with="i=${#strings.toString(n < 10 ? '0' + n : n)}">
|
||||||
<a th:href="'https://www.onkelwernerfreizeiten.de/stock/stock' + ${#strings.toString(i < 10 ? '0' + i : i)} + '.jpg'" data-fancybox="gallery" th:data-caption="'Bild ' + ${i}">
|
<a th:href="'https://www.onkelwernerfreizeiten.de/stock/stock' + ${i} + '.jpg'" data-fancybox="gallery" th:data-caption="${title['stock' + i]}">
|
||||||
<img th:src="'https://www.onkelwernerfreizeiten.de/stock/thumb_stock' + ${#strings.toString(i < 10 ? '0' + i : i)} + '.jpg'" height="96px" class="m-1" />
|
<img th:src="'https://www.onkelwernerfreizeiten.de/stock/thumb_stock' + ${i} + '.jpg'" height="96px" class="m-1" th:title="${title['stock' + i]}" />
|
||||||
</a>
|
</a>
|
||||||
</th:block>
|
</th:block>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
@ -59,9 +59,6 @@
|
|||||||
<div class="col-12 center mt-3">
|
<div class="col-12 center mt-3">
|
||||||
<a th:href="@{/camplist}" class="btn btn-outline-danger">zur Anmeldung</a>
|
<a th:href="@{/camplist}" class="btn btn-outline-danger">zur Anmeldung</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 center mt-3">
|
|
||||||
<a href="#" onclick="$('#fotoblock').slideUp('slow'); $('#infoblock').fadeIn(1000);" class="btn btn-outline-secondary"><i class="fas fa-arrow-down"></i> weitere Infos</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="infoblock" class="row displayblock" style="display: none">
|
<div id="infoblock" class="row displayblock" style="display: none">
|
||||||
<div class="col-12 center mb-3">
|
<div class="col-12 center mb-3">
|
||||||
|
Reference in New Issue
Block a user