@using TightWiki.Models
@model TightWiki.Models.ViewModels.Profile.PublicViewModel
@{
    Layout = "/Views/Shared/_Layout.cshtml";
}

<table class="fixedTable100" border="0" cellpadding="5">
    <tbody>
        <tr>
            <td height="52" valign="middle" align="left">
                @if (!string.IsNullOrEmpty(Model.ErrorMessage))
                {
                    <div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
                }
                @if (!string.IsNullOrEmpty(Model.SuccessMessage))
                {
                    <div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
                }

                @if (string.IsNullOrWhiteSpace(Model.Navigation) == false)
                {
                    <table border="0">
                        <tr class="padded">
                            <td><img src="/Profile/@Model.Navigation/Avatar?max=150" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.AccountName)</div></td></tr>
                        <tr class="padded">
                            <td><strong>@Html.LabelFor(m => m.AccountName)</strong></td>
                            <td>@Html.DisplayFor(m => m.AccountName)</td>
                        </tr>
                        <tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.Country)</div></td></tr>
                        <tr class="padded">
                            <td><strong>@Html.LabelFor(m => m.Country)</strong></td>
                            <td>@Html.DisplayFor(m => m.Country)</td>
                        </tr>
                        <tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.Language)</div></td></tr>
                        <tr class="padded">
                            <td><strong>@Html.LabelFor(m => m.Language)</strong></td>
                            <td>@Html.DisplayFor(m => m.Language)</td>
                        </tr>
                        <tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.TimeZone)</div></td></tr>
                        <tr class="padded">
                            <td><strong>@Html.LabelFor(m => m.TimeZone)</strong></td>
                            <td>@Html.DisplayFor(m => m.TimeZone)</td>
                        </tr>
                        <tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.Biography)</div></td></tr>
                        <tr class="padded">
                            <td><strong>@Html.LabelFor(m => m.Biography)</strong></td>
                            <td><div style="word-wrap: break-word;">@Html.Raw(Model.Biography)</div></td>
                        </tr>
                    </table>
                }

                @if (Model.RecentlyModified.Count > 0)
                {
                    <hr class="mt-5 mb-5">
                    <h2>Recently Modified</h2>
                    <table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
                        <thead>
                            <tr>
                                <td><strong>Page</strong></td>
                                <td><strong>Modified</strong></td>
                                <td><strong>Summary</strong></td>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var h in Model.RecentlyModified)
                            {
                                <tr>
                                    <td><a href="@GlobalConfiguration.BasePath/@h.Navigation">@Html.DisplayTextFor(x => h.Name)</a></td>
                                    <td>@Html.DisplayTextFor(x => h.ModifiedDate)</td>
                                    <td>@Html.DisplayTextFor(x => h.ChangeSummary)</td>
                                </tr>
                            }
                        </tbody>
                    </table>
                }
            </td>
        </tr>
    </tbody>
</table>
