@using System.Linq
@using MrCMS.Web.Areas.Admin.Helpers
@using MrCMS.Web.Areas.Admin.Models.SEOAnalysis
@model MrCMS.Web.Areas.Admin.Models.SEOAnalysis.SEOAnalysisResult
<table class="table table-condensed analysis-table">
    <thead>
        <tr>
            <th></th>
            <th>@Resource("Admin Seo Analysis Check", "Check")
            </th>
            <th>@Resource("Messages")
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var facet in Model.OrderByDescending(facet => facet.Status).ThenBy(facet => facet.Importance).ThenBy(x=>x.Name))
        {
            <tr class="@facet.Status.GetTableClass()">
                <td data-status="true" class="text-center"><i class="glyphicon @facet.Status.GetIconClass()"></i></td>
                <td>
                    @facet.Name
                </td>
                <td>
                    @if (facet.Messages.Any())
                    {
                        <ul>
                            @foreach (var message in facet.Messages)
                            {
                                <li>@Html.Raw(message)</li>
                            }
                        </ul>
                    }
                </td>
            </tr>
        }
    </tbody>
</table>
