diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index 5de418a34..00ac76742 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -116,10 +116,11 @@ postProfileR = do siteLayout [whamlet|_{MsgProfileFor} ^{nameWidget userDisplayName userSurname}|] $ do setTitle . toHtml $ "Profil " <> userIdent - wrapForm formWidget def - { formAction = Just $ SomeRoute ProfileR - , formEncoding = formEnctype - } + let settingsForm = wrapForm formWidget def + { formAction = Just $ SomeRoute ProfileR + , formEncoding = formEnctype + } + $(widgetFile "profile") getProfileDataR :: Handler Html diff --git a/templates/default-layout.julius b/templates/default-layout.julius index dffe24834..8c7295843 100644 --- a/templates/default-layout.julius +++ b/templates/default-layout.julius @@ -44,30 +44,3 @@ if (I18n) { document.addEventListener('DOMContentLoaded', function() { setupDatepicker(document.body); }); - -/** - * The following code should be moved to profile.julius as soon as the widget file is actually used. - */ -(function() { - 'use strict'; - - var DEFAULT_THEME = 'theme--default'; - - document.addEventListener('DOMContentLoaded', function() { - - var themeSwitcher = document.querySelector('#theme-select'); - var currentTheme = DEFAULT_THEME; - - if (themeSwitcher) { - currentTheme = 'theme--' + themeSwitcher.value; - themeSwitcher.addEventListener('input', function() { - - var desiredTheme = 'theme--' + themeSwitcher.value; - document.body.classList.remove(currentTheme); - document.body.classList.add(desiredTheme); - currentTheme = desiredTheme; - }); - } - }); - -})();