<commit_before>﻿@using Orchard.Lists.ViewModels;
@using Orchard.ContentManagement;
@{
	Script.Include("orchard-lists-admin.js");

	int? containerId = (int?)Model.ContainerId;
	
    string createLinkText = string.IsNullOrEmpty(Model.ContainerItemContentType) ? T("Create New Content").ToString() : T("Create New {0}", Model.ContainerItemContentType).ToString();
    
    Layout.Title = containerId.HasValue ? T("Manage Content for {0}", Model.ContainerDisplayName) : T("Orphaned Content Items");

    var lists = ((IEnumerable<ContentItem>)Model.OtherLists).Select(
        contentItem => new SelectListItem {
            Text = contentItem.ContentType + ": " + contentItem.ContentManager.GetItemMetadata(contentItem).DisplayText,
            Value = contentItem.Id.ToString(System.Globalization.CultureInfo.InvariantCulture)
        }).ToList();
	lists.Insert(0, new SelectListItem { Text = T("Move to...").ToString(), Value = "" });
}
<style type="text/css">
.dyn #TargetContainerId {
	display: none /* todo: move to css file */
}
</style>

<div>&nbsp;</div>
@Display.Parts_Container_Manage(ContainerDisplayName: Model.ContainerDisplayName, ContainerContentType: Model.ContainerContentType, ContainerId: containerId)
@if (containerId.HasValue) {
<div class="manage">
    @Html.ActionLink(createLinkText, "Create", new { Area = "Contents", Id = (string)Model.Options.SelectedFilter, ContainerId = (int)containerId, ReturnUrl = Html.ViewContext.HttpContext.Request.RawUrl }, new { @class = "button primaryAction" })
</div>
}
@using (Html.BeginFormAntiForgeryPost()) {
    <fieldset class="bulk-actions">
        <label for="publishActions">@T("Actions:")</label>
        <select id="publishActions" name="Options.BulkAction">
			@if (containerId.HasValue) {
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Remove, T("Delete").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.RemoveFromList, T("Remove from List").ToString())
			}
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.MoveToList, T("Move to List...").ToString())
        </select>
		@Html.DropDownList("TargetContainerId", lists, new { id = "TargetContainerId" })
        <button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
    </fieldset>
    <fieldset class="bulk-actions">
		@if(!Model.HasRestriction) {
        <label for="filterResults" class="bulk-filter">@T("Show")</label>
        <select id="filterResults" name="Options.SelectedFilter">
            @Html.SelectOption((string)Model.Options.SelectedFilter, "", T("any (show all)").ToString())
            @foreach(var filterOption in Model.Options.FilterOptions) {
                @Html.SelectOption((string)Model.Options.SelectedFilter, (string)filterOption.Key, (string)filterOption.Value)
            }
        </select>
		}
        <label for="orderResults" class="bulk-order">@T("Ordered by")</label>
        <select id="orderResults" name="Options.OrderBy">
            @Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Created, T("recently created").ToString())
            @Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Modified, T("recently modified").ToString())
            @Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Published, T("recently published").ToString())
        </select>
        <button type="submit" name="submit.Filter" value="yes please">@T("Apply")</button>
    </fieldset>
    <fieldset class="contentItems bulk-items">
@Display(Model.ContentItems)
    </fieldset>
@Display(Model.Pager)
}<commit_msg>Add message when a list contains no content items.<commit_after>﻿@using Orchard.Lists.ViewModels;
@using Orchard.ContentManagement;
@{
	Script.Include("orchard-lists-admin.js");

	int? containerId = (int?)Model.ContainerId;
	
    string createLinkText = string.IsNullOrEmpty(Model.ContainerItemContentType) ? T("Create New Content").ToString() : T("Create New {0}", Model.ContainerItemContentType).ToString();
    
    Layout.Title = containerId.HasValue ? T("Manage Content for {0}", Model.ContainerDisplayName) : T("Orphaned Content Items");

    var lists = ((IEnumerable<ContentItem>)Model.OtherLists).Select(
        contentItem => new SelectListItem {
            Text = contentItem.ContentType + ": " + contentItem.ContentManager.GetItemMetadata(contentItem).DisplayText,
            Value = contentItem.Id.ToString(System.Globalization.CultureInfo.InvariantCulture)
        }).ToList();
	lists.Insert(0, new SelectListItem { Text = T("Move to...").ToString(), Value = "" });
}
<style type="text/css">
.dyn #TargetContainerId {
	display: none /* todo: move to css file */
}
</style>

<div>&nbsp;</div>
@Display.Parts_Container_Manage(ContainerDisplayName: Model.ContainerDisplayName, ContainerContentType: Model.ContainerContentType, ContainerId: containerId)
@if (containerId.HasValue) {
<div class="manage">
    @Html.ActionLink(createLinkText, "Create", new { Area = "Contents", Id = (string)Model.Options.SelectedFilter, ContainerId = (int)containerId, ReturnUrl = Html.ViewContext.HttpContext.Request.RawUrl }, new { @class = "button primaryAction" })
</div>
}
@using (Html.BeginFormAntiForgeryPost()) {
    <fieldset class="bulk-actions">
        <label for="publishActions">@T("Actions:")</label>
        <select id="publishActions" name="Options.BulkAction">
			@if (containerId.HasValue) {
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.None, T("Choose action...").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.PublishNow, T("Publish Now").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Unpublish, T("Unpublish").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.Remove, T("Delete").ToString())
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.RemoveFromList, T("Remove from List").ToString())
			}
            @Html.SelectOption((ContentsBulkAction)Model.Options.BulkAction, ContentsBulkAction.MoveToList, T("Move to List...").ToString())
        </select>
		@Html.DropDownList("TargetContainerId", lists, new { id = "TargetContainerId" })
        <button type="submit" name="submit.BulkEdit" value="yes">@T("Apply")</button>
    </fieldset>
    <fieldset class="bulk-actions">
		@if(!Model.HasRestriction) {
        <label for="filterResults" class="bulk-filter">@T("Show")</label>
        <select id="filterResults" name="Options.SelectedFilter">
            @Html.SelectOption((string)Model.Options.SelectedFilter, "", T("any (show all)").ToString())
            @foreach(var filterOption in Model.Options.FilterOptions) {
                @Html.SelectOption((string)Model.Options.SelectedFilter, (string)filterOption.Key, (string)filterOption.Value)
            }
        </select>
		}
        <label for="orderResults" class="bulk-order">@T("Ordered by")</label>
        <select id="orderResults" name="Options.OrderBy">
            @Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Created, T("recently created").ToString())
            @Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Modified, T("recently modified").ToString())
            @Html.SelectOption((ContentsOrder)Model.Options.OrderBy, ContentsOrder.Published, T("recently published").ToString())
        </select>
        <button type="submit" name="submit.Filter" value="yes please">@T("Apply")</button>
    </fieldset>
    <fieldset class="contentItems bulk-items">
	@if ((int)Model.ContentItems.Items.Count == 0) {
		@T("The '{0}' {1} has no content items.", Model.ContainerDisplayName, Model.ContainerContentType)
	}
	else {
		@Display(Model.ContentItems)
	}
    </fieldset>
@Display(Model.Pager)
}
{'fraction_non_alphanumeric': 0.15294117647058825, 'fraction_numerical': 0.0010695187165775401, 'mean_word_length': 4.618157543391188, 'pattern_counts': {'":': 2, '<': 61, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7486166', 'n_tokens_mistral': 2467, 'n_tokens_neox': 2392, 'n_words': 391}