<commit_before>﻿@using System.Threading.Tasks
@using StockportWebapp.Utils
@model StockportWebapp.Models.Newsroom

<div class="grid-container news-grid-container-margins">
    <div class="grid-30 tablet-grid-100 mobile-grid-100 l-news-filter">
        <p class="filters-heading">Refine by</p>     
        <ul class="filters-list" id="category-list">           
        <li class="collapsable">
            <ul class="filters-list">
                <li class="filter collapsable">
                    <p class="filter-title">Category</p>
                    <ul class="filters-list">
                        <li class=@(!UrlQueryHelper.QueryNameIsInQueryString(Url.ActionContext.RouteData.Values, Context.Request.Query, "category") ? "active" : "")>
                            <a href="@Url.RouteUrl(UrlQueryHelper.RemoveQueryToUrl(Url.ActionContext.RouteData.Values, Context.Request.Query, "category"))">All categories</a>
                        </li>
                        @foreach (var category in Model.Categories.OrderBy(c => c))
                        {
                            <li class=@(UrlQueryHelper.QueryNameAndValueIsInQueryString(Url.ActionContext.RouteData.Values, Context.Request.Query, "category", category) ? "active" : "")>
                                <a href="@Url.RouteUrl(UrlQueryHelper.AddQueryToUrl(Url.ActionContext.RouteData.Values, Context.Request.Query, "category", @category))">@category</a>
                            </li>
                        }
                    </ul>
                </li>
            </ul>
            <ul class="filters-list" id="dates-list">
                <li class="collapsable">
                <p class="filter-title">News Archive</p>
                    <ul class="filters-list">
                        @foreach (var year in Model.Dates.Select(s => s.Year).Distinct())
                        {
                                <li class="filter collapsable">
                                    @year.ToString()
                                    <ul class="filters-list" id="news-archive">
                                        @foreach (var date in Model.Dates.Where(d=>d.Year == year).OrderBy(a => a).Reverse())
                                        {
                                            <li class=@(UrlQueryHelper.QueryNameAndValueIsInQueryString(Url.ActionContext.RouteData.Values, Context.Request.Query, "date", @date.ToString("yyyy-MM-dd")) ? "active" : "")>

                                            <a href="/news?datefrom=@date.ToString("yyyy-MM-dd")&dateto=@date.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd")">@date.ToString("MMM yyyy")</a>                                            
                                            </li>
                                        }
                                    </ul>
                                </li>

                        }
                    </ul>
                   <p class="mobile-filter-heading filter-title">Filter news</p>
                </li>
            </ul>
        </li>
    </ul>
</div>
    <div class="grid-70 tablet-grid-100 mobile-grid-100 grid-parent">
        @{
            if (Model.Alerts != null)
            {
                foreach (var alert in Model.Alerts)
                {
                    @Html.Partial("DisplayTemplates/Alert", alert)
                }
            }
        }
        <ul class="nav-card-news-list">
            @foreach (var subItem in Model.News)
            {
                //desktop tablet
                <li class="nav-card-news grid-100 tablet-grid-100 hide-on-mobile nav-card-news-item">
                    <div class="news-bottom-border">
                        <div class="grid-70 tablet-grid-70 nav-no-left-padding">
                            <div class="news-date"><commit_msg>Tony/<NAME> - #585 - Changes layout if filters on NewsCatergories partial<commit_after>﻿@using System.Threading.Tasks
@using StockportWebapp.Utils
@model StockportWebapp.Models.Newsroom

<div class="grid-container news-grid-container-margins">
    <div class="grid-30 tablet-grid-100 mobile-grid-100 l-news-filter">
        <p class="filters-heading">Refine by</p>     
        <ul class="filters-list" id="category-list">           
        <li class="collapsable">
            <ul class="filters-list">
                <li class="filter collapsable">
                    <p class="filter-title">Category</p>
                    <ul class="filters-list">
                        <li class=@(!UrlQueryHelper.QueryNameIsInQueryString(Url.ActionContext.RouteData.Values, Context.Request.Query, "category") ? "active" : "")>
                            <a href="@Url.RouteUrl(UrlQueryHelper.RemoveQueryToUrl(Url.ActionContext.RouteData.Values, Context.Request.Query, "category"))">All categories</a>
                        </li>
                        @foreach (var category in Model.Categories.OrderBy(c => c))
                        {
                            <li class=@(UrlQueryHelper.QueryNameAndValueIsInQueryString(Url.ActionContext.RouteData.Values, Context.Request.Query, "category", category) ? "active" : "")>
                                <a href="@Url.RouteUrl(UrlQueryHelper.AddQueryToUrl(Url.ActionContext.RouteData.Values, Context.Request.Query, "category", @category))">@category</a>
                            </li>
                        }
                    </ul>
                </li>
            </ul>
            <ul class="filters-list" id="dates-list">
                <li class="collapsable">
                <p class="filter-title">News Archive</p>
                    <ul class="filters-list">
                        @foreach (var year in Model.Dates.Select(s => s.Year).Distinct().OrderByDescending(y => y))
                            {
                                <li class="collapsable filter is-collapsed">
                                     <p class="filter-title">@year.ToString()</p>
                                     <ul class="filters-list" id="news-archive">
                                        @foreach (var date in Model.Dates.Where(d=>d.Year == year).OrderBy(a => a).Reverse())
                                        {
                                            <li class=@(UrlQueryHelper.QueryNameAndValueIsInQueryString(Url.ActionContext.RouteData.Values, Context.Request.Query, "date", @date.ToString("yyyy-MM-dd")) ? "active" : "")>
                                                <a href="/news?datefrom=@date.ToString("yyyy-MM-dd")&dateto=@date.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd")">@date.ToString("MMM yyyy")</a>                                            
                                            </li>
                                        }
                                    </ul>
                                </li>
                            }
                    </ul>
                   <p class="mobile-filter-heading filter-title">Filter news</p>
                </li>
            </ul>
        </li>
    </ul>
</div>
    <div class="grid-70 tablet-grid-100 mobile-grid-100 grid-parent">
        @{
            if (Model.Alerts != null)
            {
                foreach (var alert in Model.Alerts)
                {
                    @Html.Partial("DisplayTemplates/Alert", alert)
                }
            }
        }
        <ul class="nav-card-news-list">
            @foreach (var subItem in Model.News)
            {
                //desktop tablet
                <li class="nav-card-news grid-100 tablet-grid-100 hide-on-mobile nav-card-news-item">
                    <div class="news-bottom-border">
                        <div class="grid-70 tablet-grid-70 nav-no-left-padding">
                            <div class="news-date">
{'fraction_non_alphanumeric': 0.13058021355975813, 'fraction_numerical': 0.007590376945838158, 'mean_word_length': 1.3095662507427213, 'pattern_counts': {'":': 0, '<': 104, '<?xml version=': 0, '>': 113, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 31, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7392199', 'n_tokens_mistral': 2050, 'n_tokens_neox': 1925, 'n_words': 316}