From: David ‘Bombe’ Roden Date: Thu, 14 Oct 2010 05:06:05 +0000 (+0200) Subject: Show name fields on page. X-Git-Tag: 0.1-RC1~439 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b9f8c58fa8c241ad15afc5c519bda3cefdd58240;p=Sone.git Show name fields on page. --- diff --git a/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java b/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java index fda7fb4..ed3fb23 100644 --- a/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java +++ b/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java @@ -17,7 +17,9 @@ package net.pterodactylus.sone.web; +import net.pterodactylus.sone.data.Profile; import net.pterodactylus.util.template.Template; +import freenet.clients.http.ToadletContext; /** * This page lets the user edit her profile. @@ -48,6 +50,14 @@ public class EditProfilePage extends SoneTemplatePage { @Override protected void processTemplate(Request request, Template template) throws RedirectException { super.processTemplate(request, template); + ToadletContext toadletContenxt = request.getToadletContext(); + Profile profile = getCurrentSone(toadletContenxt).getProfile(); + String firstName = profile.getFirstName(); + String middleName = profile.getMiddleName(); + String lastName = profile.getLastName(); + template.set("firstName", firstName); + template.set("middleName", middleName); + template.set("lastName", lastName); } // diff --git a/src/main/resources/i18n/sone.en.properties b/src/main/resources/i18n/sone.en.properties index 2496408..7d8067d 100644 --- a/src/main/resources/i18n/sone.en.properties +++ b/src/main/resources/i18n/sone.en.properties @@ -48,5 +48,8 @@ Page.EditProfile.Title=Edit Profile - Sone Page.EditProfile.Page.Title=Edit Profile Page.EditProfile.Page.Description=On this page you can enter your profile data. Page.EditProfile.Page.Hint.Optionality=And remember, every single field of this profile is optional! You are not required to enter a single thing here! Also, everything you enter here will probably be stored in Freenet for a very long time! +Page.EditProfile.Label.FirstName=First name: +Page.EditProfile.Label.MiddleName=Middle name(s): +Page.EditProfile.Label.LastName=Last name: Page.Logout.Title=Logout - Sone diff --git a/src/main/resources/templates/editProfile.html b/src/main/resources/templates/editProfile.html index 4c3c5b8..d39d859 100644 --- a/src/main/resources/templates/editProfile.html +++ b/src/main/resources/templates/editProfile.html @@ -5,4 +5,24 @@
<%= Page.EditProfile.Page.Description|l10n|html>
<%= Page.EditProfile.Page.Hint.Optionality|l10n|html>
+
+ + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+