This commit is contained in:
Jottyfan
2023-09-15 16:48:42 +02:00
parent b9981e3dc5
commit 80696b0c0b
12 changed files with 258 additions and 10 deletions

View File

@ -1,5 +1,10 @@
package de.jottyfan.bico.modules;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import de.jottyfan.bico.modules.profile.ProfileService;
/**
*
* @author jotty
@ -7,4 +12,18 @@ package de.jottyfan.bico.modules;
*/
public abstract class CommonController {
@Autowired
private ProfileService profileService;
/**
* get the theme for the current session
*
* @return the theme; light or dark at the moment
*/
public Model useThemedModel(Model model) {
// TODO: add profile's user name
String username = "jotty";
model.addAttribute("theme", profileService.getTheme(username));
return model;
}
}