<commit_before>﻿@model FeaturesViewModel
@using Orchard.Localization;
@using Orchard.Modules.Extensions;
@using Orchard.Modules.ViewModels;
@using Orchard.Utility.Extensions;
@using Orchard.Modules.Models;

@{
    Style.Require("ModulesAdmin");
    Style.Require("Switchable");
    Script.Require("Switchable");
    Script.Include("features.admin.js", "features.admin.min.js").AtFoot();

    Layout.Title = T("Modules").ToString();
}

@if (Model.Features.Any()) {
    using (Html.BeginFormAntiForgeryPost()) {
    @Html.Hidden("submit.BulkExecute")
    @Html.Hidden("force", true)
    @Html.Hidden("featureIds")
    <div class="bulk-actions-wrapper">
        <fieldset class="bulk-actions">
            <label for="search-box">@T("Filter:")</label>
            <input id="search-box" class="text-box" type="text" />
        </fieldset>
        <fieldset class="bulk-actions">
            <label for="publishActions">@T("Actions:")</label>
            <select id="publishActions" name="bulkAction">
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.None, T("Choose action...").ToString())
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Enable, T("Enable").ToString())
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Disable, T("Disable").ToString())
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Toggle, T("Toggle").ToString())
            </select>
            <button type="submit" name="submit.BulkExecute" value="yes">@T("Execute")</button>
        </fieldset>
    </div>
        
    <ul class="features summary-view switchable">@{
        var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category).ToList();
        foreach (var featureGroup in featureGroups) {
            var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized"));
            var categoryClassName = string.Format("category {0}", Html.Encode(categoryName.ToString().HtmlClassify()));
            if (featureGroup == featureGroups.First()) {
                categoryClassName += " first";
            }
            if (featureGroup == featureGroups.Last()) {
                categoryClassName += " last";
            }

        <li class="@categoryClassName">
        <h2>@categoryName</h2>
        <ul>@{
            var features = featureGroup.OrderBy(f => f.Descriptor.Name);
            foreach (var feature in features) {
                //hmmm...I feel like I've done this before...
                var featureId = feature.Descriptor.Id.AsFeatureId(n => T(n));
                var featureName = string.IsNullOrEmpty(feature.Descriptor.Name) ? feature.Descriptor.Id : feature.Descriptor.Name;
                var featureState = feature.IsEnabled ? "enabled" : "disabled";
                var featureClassName = string.Format("feature {0}", featureState + (feature.NeedsUpdate ? " update" : String.Empty));
                if (feature == features.First()) {
                    featureClassName += " first";
                }
                if (feature == features.Last()) {
                    featureClassName += " last";
                }

                if (feature.IsRecentlyInstalled) {
                    featureClassName += " recentlyInstalledFeature";
                }

                var dependencies = (from d in feature.Descriptor.Dependencies
                                    select (from f in Model.Features where f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase) select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name);
                var missingDependencies = feature.Descriptor.Dependencies
                    .Where(d => !Model.Features.Any(f => f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase)));
                var showDisable = categoryName.ToString() != "Core";
                var showEnable = !missingDependencies.Any() && feature.Descriptor.Id != "Orchard.Setup";
                <li class="@featureClassName" id="@featureId" title="@T("{0} is {1}", Html.AttributeEncode(featureName), featureState)">
                <div class="summary">
                    <div class="properties">
                        <h3>
                            <label>
                                <input type="checkbox" name="featureIds" value="@feature.Descriptor.Id"/>
                                @featureName
                            </label>
                        </h3>
                        <p class="description" title="@feature.Descriptor.Description">@feature.Descriptor.Description</p>
                        @if (feature.Descriptor.Dependencies != null && feature.Descriptor.Dependencies.Any()) {
                        <div class="dependencies">
                            <h4>@T("Depends on:")</h4><commit_msg>#18951: Removing checkboxes from features that should not be disabled or enabled.<commit_after>﻿@model FeaturesViewModel
@using Orchard.Localization;
@using Orchard.Modules.Extensions;
@using Orchard.Modules.ViewModels;
@using Orchard.Utility.Extensions;
@using Orchard.Modules.Models;

@{
    Style.Require("ModulesAdmin");
    Style.Require("Switchable");
    Script.Require("Switchable");
    Script.Include("features.admin.js", "features.admin.min.js").AtFoot();

    Layout.Title = T("Modules").ToString();
}

@if (Model.Features.Any()) {
    using (Html.BeginFormAntiForgeryPost()) {
    @Html.Hidden("submit.BulkExecute")
    @Html.Hidden("force", true)
    @Html.Hidden("featureIds")
    <div class="bulk-actions-wrapper">
        <fieldset class="bulk-actions">
            <label for="search-box">@T("Filter:")</label>
            <input id="search-box" class="text-box" type="text" />
        </fieldset>
        <fieldset class="bulk-actions">
            <label for="publishActions">@T("Actions:")</label>
            <select id="publishActions" name="bulkAction">
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.None, T("Choose action...").ToString())
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Enable, T("Enable").ToString())
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Disable, T("Disable").ToString())
                @Html.SelectOption(Model.BulkAction, FeaturesBulkAction.Toggle, T("Toggle").ToString())
            </select>
            <button type="submit" name="submit.BulkExecute" value="yes">@T("Execute")</button>
        </fieldset>
    </div>
        
    <ul class="features summary-view switchable">@{
        var featureGroups = Model.Features.OrderBy(f => f.Descriptor.Category, new DoghouseComparer("Core")).GroupBy(f => f.Descriptor.Category).ToList();
        foreach (var featureGroup in featureGroups) {
            var categoryName = LocalizedString.TextOrDefault(featureGroup.First().Descriptor.Category, T("Uncategorized"));
            var categoryClassName = string.Format("category {0}", Html.Encode(categoryName.ToString().HtmlClassify()));
            if (featureGroup == featureGroups.First()) {
                categoryClassName += " first";
            }
            if (featureGroup == featureGroups.Last()) {
                categoryClassName += " last";
            }

        <li class="@categoryClassName">
        <h2>@categoryName</h2>
        <ul>@{
            var features = featureGroup.OrderBy(f => f.Descriptor.Name);
            foreach (var feature in features) {
                //hmmm...I feel like I've done this before...
                var featureId = feature.Descriptor.Id.AsFeatureId(n => T(n));
                var featureName = string.IsNullOrEmpty(feature.Descriptor.Name) ? feature.Descriptor.Id : feature.Descriptor.Name;
                var featureState = feature.IsEnabled ? "enabled" : "disabled";
                var featureClassName = string.Format("feature {0}", featureState + (feature.NeedsUpdate ? " update" : String.Empty));
                if (feature == features.First()) {
                    featureClassName += " first";
                }
                if (feature == features.Last()) {
                    featureClassName += " last";
                }

                if (feature.IsRecentlyInstalled) {
                    featureClassName += " recentlyInstalledFeature";
                }

                var dependencies = (from d in feature.Descriptor.Dependencies
                                    select (from f in Model.Features where f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase) select f).SingleOrDefault()).Where(f => f != null).OrderBy(f => f.Descriptor.Name);
                var missingDependencies = feature.Descriptor.Dependencies
                    .Where(d => !Model.Features.Any(f => f.Descriptor.Id.Equals(d, StringComparison.OrdinalIgnoreCase)));
                var showDisable = categoryName.ToString() != "Core";
                var showEnable = !missingDependencies.Any() && feature.Descriptor.Id != "Orchard.Setup";
                <li class="@featureClassName" id="@featureId" title="@T("{0} is {1}", Html.AttributeEncode(featureName), featureState)">
                <div class="summary">
                    <div class="properties">
                        <h3>
                            @if ((showEnable && !feature.IsEnabled) || (showDisable && feature.IsEnabled)) {
                                <label>
                                    <input type="checkbox" name="featureIds" value="@feature.Descriptor.Id"/>
                                    @featureName
                                </label>
                            }
                            else {
                                @featureName
                            }
                        </h3>
                        <p class="description" title="@feature.Descriptor.Description">@feature.Descriptor.Description</p>
                        @if (feature.Descriptor.Dependencies != null && feature.Descriptor.Dependencies.Any()) {
                        <div class="dependencies">
                            <h4>@T("Depends on:")</h4>
{'fraction_non_alphanumeric': 0.13761196968205533, 'fraction_numerical': 0.002460872133083965, 'mean_word_length': 2.150387596899225, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '938368', 'n_tokens_mistral': 2631, 'n_tokens_neox': 2506, 'n_words': 463}