Skip to content

Commit

Permalink
Attempted Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbarba19 committed Jun 6, 2024
1 parent 950a794 commit 5253f6e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 28 deletions.
5 changes: 2 additions & 3 deletions app/femr/ui/controllers/SettingsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public SettingsController(AssetsFinder assetsFinder,

public Result index() {
CurrentUser currentUser = sessionService.retrieveCurrentUserSession();
Form<EditViewModel> editViewModelForm = formFactory.form(EditViewModel.class).bindFromRequest();
return ok(femr.ui.views.html.settings.index.render(currentUser, editViewModelForm, assetsFinder));
return ok(femr.ui.views.html.settings.index.render(currentUser, assetsFinder));
}

public Result update() {
Expand All @@ -52,7 +51,7 @@ public Result update() {

Form<EditViewModel> editViewModelForm = formFactory.form(EditViewModel.class).bindFromRequest();
if (editViewModelForm.hasErrors()) {
return badRequest(index.render(currentUser, editViewModelForm, assetsFinder));
return badRequest(index.render(currentUser, assetsFinder));
}

EditViewModel viewModel = editViewModelForm.get();
Expand Down
4 changes: 2 additions & 2 deletions app/femr/ui/views/partials/authenticated.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
4 changes: 2 additions & 2 deletions app/femr/ui/views/partials/shared/searchBox.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
.then(response => response.json())
.then(data => {
languageData = data;
//const initialLanguage = localStorage.getItem('languageCode') || 'en';
const initialLanguage = @currentUser.getLanguageCode();
const initialLanguage = localStorage.getItem('languageCode') || 'en';
//const initialLanguage = @currentUser.getLanguageCode();
updateLanguage(initialLanguage);
document.getElementById('languageSelect').value = initialLanguage;
});
Expand Down
21 changes: 0 additions & 21 deletions app/femr/ui/views/settings/index.scala.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@(currentUser: femr.common.dtos.CurrentUser,
form: play.data.Form[femr.ui.models.settings.EditViewModel],
assets: AssetsFinder)

@import femr.ui.views.html.layouts.settings
Expand Down Expand Up @@ -44,27 +43,7 @@

@settings("Settings Panel", currentUser, assets = assets) {
<h3 id="settings_welcome">Welcome, User. Please select a language.</h3>
@helper.form(action = SettingsController.update(), 'name -> "createForm") {
<input type="hidden" value="@form("userId").getValue.get()" name="userId"/>

<div class="editWrapBoth" id="editWrapLeft">

@helper.inputText(form("firstName"),
'class -> "fInput",
'_label -> "First Name"
)

@helper.inputText(form("lastName"),
'class -> "fInput",
'_label -> "Last Name"
)

@helper.inputText(form("languageCode"),
'class -> "fInput",
'_label -> "Language"
)
}
</div>
<p class="userStatus">
<select id="languageSelect" style="margin-left: 10px">
<option value="en">English</option>
Expand Down

0 comments on commit 5253f6e

Please sign in to comment.