/*******************************************************************************
 * Copyright (c) 2015 Development Gateway, Inc and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the MIT License (MIT)
 * which accompanies this distribution, and is available at
 * https://opensource.org/licenses/MIT
 *
 * Contributors:
 * Development Gateway - initial API and implementation
 *******************************************************************************/
package org.devgateway.toolkit.forms.wicket.page;

import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
import java.util.Properties;

import org.apache.wicket.markup.html.TransparentWebMarkupContainer;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.Model;
import org.devgateway.toolkit.forms.security.SecurityUtil;

public class Footer extends Panel {

	private static final long serialVersionUID = 1L;

	/**
	 * Construct.
	 *
	 * @param markupId
	 *            The components markup id.
	 */
	public Footer(final String markupId) {
		super(markupId);

		InputStream inputStream = getClass().getClassLoader().getResourceAsStream("version.properties");
		Properties prop = new Properties();
		try {
			prop.load(inputStream);
			inputStream.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

		add(new Label("toolkit-version", Model.of(prop.getProperty("toolkit.version"))));
		add(new Label("toolkit-year", Calendar.getInstance().get(Calendar.YEAR)));

		WebMarkupContainer login = new TransparentWebMarkupContainer("login");
		// hide the login link if the user is already logged in
		if (!(SecurityUtil.getCurrentAuthenticatedPerson() == null)) {
			login.setVisibilityAllowed(false);
		}
		add(login);
	}

}

@@ -1667,263 +1667,9 @@
 ));%0A
-%0A%09%09WebMarkupContainer login = new TransparentWebMarkupContainer(%22login%22);%0A%09%09// hide the login link if the user is already logged in%0A%09%09if (!(SecurityUtil.getCurrentAuthenticatedPerson() == null)) %7B%0A%09%09%09login.setVisibilityAllowed(false);%0A%09%09%7D%0A%09%09add(login);%0A%09%7D%0A
+%09%7D
 %0A%7D%0A

Remove unused "login" TransparentWebMarkupContainer from Footer.