@using System.Web.Mvc.Html
@using Umbraco.Web
@using Umbraco.Web.Models
@using Umbraco.Web.Controllers
@inherits Umbraco.Web.Macros.PartialViewMacroPage

@{
    var loginStatusModel = Members.GetCurrentLoginStatus();
    var logoutModel = new PostRedirectModel();

    @*
        Here you can specify a redirect URL for after logging out, by default umbraco will simply
        redirect to the current page. Example to redirect to the home page:

        logoutModel.RedirectUrl = "/";
    *@
}

@if (loginStatusModel.IsLoggedIn)
{
    <p>You are currently logged in as @loginStatusModel.Name</p>

    using (Html.BeginUmbracoForm<UmbLoginStatusController>("HandleLogout"))
    {
        <fieldset>
            <legend>Logout</legend>
            <button>Logout</button>
        </fieldset>

        @Html.HiddenFor(m => logoutModel.RedirectUrl)
    }
}
