Show name fields on page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 05:06:05 +0000 (07:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 05:06:05 +0000 (07:06 +0200)
src/main/java/net/pterodactylus/sone/web/EditProfilePage.java
src/main/resources/i18n/sone.en.properties
src/main/resources/templates/editProfile.html

index fda7fb4..ed3fb23 100644 (file)
@@ -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);
        }
 
        //
index 2496408..7d8067d 100644 (file)
@@ -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
index 4c3c5b8..d39d859 100644 (file)
@@ -5,4 +5,24 @@
        <div><%= Page.EditProfile.Page.Description|l10n|html></div>
        <div><%= Page.EditProfile.Page.Hint.Optionality|l10n|html></div>
 
+       <form method="post">
+               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+               
+               <div>
+                       <label for="first-name"><%= Page.EditProfile.Label.FirstName|l10n|html></label>
+                       <input type="text" name="first-name" value="<% firstName|html>" />
+               </div>
+               
+               <div>
+                       <label for="middle-name"><%= Page.EditProfile.Label.MiddleName|l10n|html></label>
+                       <input type="text" name="middle-name" value="<% middleName|html>" />
+               </div>
+               
+               <div>
+                       <label for="last-name"><%= Page.EditProfile.Label.LastName|l10n|html></label>
+                       <input type="text" name="last-name" value="<% lastName|html>" />
+               </div>
+               
+       </form>
+
 </div>