themeing
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user