aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'juick-spring-www/src/main/java/com/juick/www/controllers')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/controllers/HelpController.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/HelpController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/HelpController.java
index 22ecacf3..7b1ec4d9 100644
--- a/juick-spring-www/src/main/java/com/juick/www/controllers/HelpController.java
+++ b/juick-spring-www/src/main/java/com/juick/www/controllers/HelpController.java
@@ -12,6 +12,7 @@ import javax.inject.Inject;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Locale;
+import java.util.Objects;
import java.util.Optional;
/**
@@ -33,24 +34,24 @@ public class HelpController {
String page = pageParam.orElse("index");
String lang = langParam.orElse(locale.getLanguage());
- String content = null;
String navigation = null;
if (langOrPageParam.isPresent()) {
String langOrPage = langOrPageParam.get();
- if (helpService.canLang(langOrPage)) {
+ if (helpService.canBeLang(langOrPage)) {
navigation = helpService.getHelp("navigation", langOrPage);
if (navigation != null)
lang = langOrPage;
}
- if (navigation == null && helpService.canPage(langOrPage))
+ if (navigation == null && helpService.canBePage(langOrPage))
page = langOrPage;
}
- if (content == null)
- content = helpService.getHelp(page, lang);
+ String content = helpService.getHelp(page, lang);
+ if (content == null && !Objects.equals("index", page))
+ content = helpService.getHelp("index", lang);
if (navigation == null)
navigation = helpService.getHelp("navigation", lang);