@using System.Drawing
@using OurUmbraco.Our
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
    var home = Umbraco.TypedContentAtRoot().First();
    var notificationText = home.GetPropertyValue<string>("mainNotification");
    var showNotification = string.IsNullOrWhiteSpace(notificationText) == false;
    Image avatarImage = null;
    if (Members.IsLoggedIn())
    {
        avatarImage = Utils.GetMemberAvatarImage(Members.GetCurrentMember());
    }
}

@Html.Action("RenderTerms", "TermsAndConditions")

@* We'll show it differently on the homepage *@ 
@if (showNotification && Model.Content.Id != home.Id)
{
    <div class="alertbar__yellow">
        @Html.Raw(notificationText)
    </div>
}
    
@if (Request.Cookies["dismissAvatar"] == null && CurrentPage.Id != home.Id && avatarImage != null && (avatarImage.Width < 400 || avatarImage.Height < 400))
{
    <div class="notification__blue avatarTooSmall">
        <div class="message text-center">
            <p>
                Your profile picture is a little on the small side, it would look <strong>much nicer</strong> if you <a href="/member/profile">could update it to be larger image.</a>
            </p>
        </div>
        <div class="close-notification">
            <i class="icon-Delete dismisAvatar"></i><span style="font-size: 0.7em;" class="dismisAvatar">Neh, I like my blurry avatar!</span>
        </div>

    </div>
}