If no current Sone exists, return an error.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / CreateSonePage.java
index aea76c4..2c183df 100644 (file)
@@ -91,12 +91,12 @@ public class CreateSonePage extends SoneTemplatePage {
        // TEMPLATEPAGE METHODS
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                super.processTemplate(request, templateContext);
+               List<Sone> localSones = new ArrayList<Sone>(webInterface.getCore().getLocalSones());
+               Collections.sort(localSones, Sone.NICE_NAME_COMPARATOR);
+               templateContext.set("sones", localSones);
                List<OwnIdentity> ownIdentitiesWithoutSone = getOwnIdentitiesWithoutSone(webInterface.getCore());
                templateContext.set("identitiesWithoutSone", ownIdentitiesWithoutSone);
                if (request.getMethod() == Method.POST) {
@@ -125,9 +125,6 @@ public class CreateSonePage extends SoneTemplatePage {
                }
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public boolean isEnabled(ToadletContext toadletContext) {
                if (webInterface.getCore().getPreferences().isRequireFullAccess() && !toadletContext.isAllowedFullAccess()) {