Add stub of “edit profile” page.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 05:00:06 +0000 (07:00 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 14 Oct 2010 05:00:06 +0000 (07:00 +0200)
src/main/java/net/pterodactylus/sone/web/EditProfilePage.java [new file with mode: 0644]
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/resources/i18n/sone.en.properties
src/main/resources/templates/editProfile.html [new file with mode: 0644]

diff --git a/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java b/src/main/java/net/pterodactylus/sone/web/EditProfilePage.java
new file mode 100644 (file)
index 0000000..fda7fb4
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Sone - EditProfilePage.java - Copyright © 2010 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.sone.web;
+
+import net.pterodactylus.util.template.Template;
+
+/**
+ * This page lets the user edit her profile.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class EditProfilePage extends SoneTemplatePage {
+
+       /**
+        * Creates a new “edit profile” page.
+        *
+        * @param template
+        *            The template to render
+        * @param webInterface
+        *            The Sone web interface
+        */
+       public EditProfilePage(Template template, WebInterface webInterface) {
+               super("editProfile.html", template, "Page.EditProfile.Title", webInterface);
+       }
+
+       //
+       // TEMPLATEPAGE METHODS
+       //
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       protected void processTemplate(Request request, Template template) throws RedirectException {
+               super.processTemplate(request, template);
+       }
+
+       //
+       // SONETEMPLATEPAGE METHODS
+       //
+
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       protected boolean requiresLogin() {
+               return true;
+       }
+
+}
index 67c54c0..d22d94e 100644 (file)
@@ -147,6 +147,9 @@ public class WebInterface extends AbstractService {
                Template createSoneTemplate = templateFactory.createTemplate(createReader("/templates/createSone.html"));
                createSoneTemplate.set("formPassword", formPassword);
 
+               Template editProfileTemplate = templateFactory.createTemplate(createReader("/templates/editProfile.html"));
+               editProfileTemplate.set("formPassword", formPassword);
+
                Template deleteSoneTemplate = templateFactory.createTemplate(createReader("/templates/deleteSone.html"));
                deleteSoneTemplate.set("formPassword", formPassword);
 
@@ -155,6 +158,7 @@ public class WebInterface extends AbstractService {
                PageToadletFactory pageToadletFactory = new PageToadletFactory(sonePlugin.pluginRespirator().getHLSimpleClient(), "/Sone/");
                pageToadlets.add(pageToadletFactory.createPageToadlet(new IndexPage(indexTemplate, this), "Index"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new CreateSonePage(createSoneTemplate, this), "CreateSone"));
+               pageToadlets.add(pageToadletFactory.createPageToadlet(new EditProfilePage(editProfileTemplate, this), "EditProfile"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteSonePage(deleteSoneTemplate, this), "DeleteSone"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new LoginPage(loginTemplate, this), "Login"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new LogoutPage(logoutTemplate, this), "Logout"));
index d578084..2496408 100644 (file)
@@ -6,6 +6,8 @@ Navigation.Menu.Item.Index.Name=Your Sone
 Navigation.Menu.Item.Index.Tooltip=Show your Sone
 Navigation.Menu.Item.CreateSone.Name=Create Sone
 Navigation.Menu.Item.CreateSone.Tooltip=Create a new Sone
+Navigation.Menu.Item.EditProfile.Name=Edit Profile
+Navigation.Menu.Item.EditProfile.Tooltip=Edit the Profile of your Sone
 Navigation.Menu.Item.DeleteSone.Name=Delete Sone
 Navigation.Menu.Item.DeleteSone.Tooltip=Deletes the current Sone
 Navigation.Menu.Item.Logout.Name=Logout
@@ -42,4 +44,9 @@ Page.DeleteSone.Button.No=No, do not delete.
 
 Page.Index.Title=Your Sone - Sone
 
+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.Logout.Title=Logout - Sone
diff --git a/src/main/resources/templates/editProfile.html b/src/main/resources/templates/editProfile.html
new file mode 100644 (file)
index 0000000..4c3c5b8
--- /dev/null
@@ -0,0 +1,8 @@
+<div id="sone">
+
+       <h1><%= Page.EditProfile.Page.Title|l10n|html></h1>
+
+       <div><%= Page.EditProfile.Page.Description|l10n|html></div>
+       <div><%= Page.EditProfile.Page.Hint.Optionality|l10n|html></div>
+
+</div>