<commit_before>﻿@model Piranha.Models.Manager.PageModels.ListModel
@section Head {
    <script type="text/javascript">
        //
        // Sets all hidden fields before submit
        function preSubmit(parentid, seqno) {
            $("#ParentId").val(parentid);
            $("#Seqno").val(seqno);

            floatBox.show('boxTemplates');

            return false;
        }

        var deletemsg = "@Piranha.Resources.Page.MessageDeleteConfirm";

        function formatSitemap() {
            $.each($(".sitemap li:visible"), function (i, e) {
                if (i % 2 == 1)
                    $(this).addClass("odd");
                else $(this).removeClass("odd");
            });
        }

        var currmove;

        $(document).ready(function () {
            formatSitemap();

            // Handle the site tree
            $(".sitemap .action").click(function () {
                var li = $(this).parent().parent();
                li.toggleClass("collapsed");
                li.toggleClass("expanded");
                formatSitemap();
            });

            // Set the selected template id
            $(".templates").click(function () {
                $("#TemplateId").val($(this).attr("data-templateid"));
                $("form").submit();
            });

            $(".delete").click(function () {
                return confirm(deletemsg);
            });

            // Setup page list
            var options = {
                listClass: 'list-js',
                searchId: 'search',
                valueNames: ['title', 'template', 'updated', 'created']
            };
            var pageList = new List('list', options);

            // Switch between list/tree
            $("#search").keyup(function () {
                if ($(this).val() != "") {
                    $(".sitemap").hide();
                    $(".list").show();
                } else {
                    $(".list").hide();
                    $(".sitemap").show();
                }
            });
        });

        function bindMove() {
            $(".move .title a").click(function () {
                if ($(this).parent().parent().hasClass("expanded"))
                    alert("move: " + currmove + " below: " + $(this).parent().parent().attr("id"));
                else alert("move: " + currmove + " after: " + $(this).parent().parent().attr("id"));

                return false;
            });
        }
    </script>
    <!-- Restyle the list a bit to match tree -->
    <style type="text/css">
        table.list th:first-child,
        table.list tbody td:first-child > * {
            padding-left: 30px;
            }
    </style>
}
@section Toolbar { 
@Html.Partial("Partial/Tabs")
<div class="toolbar">
    <div class="inner">
        <ul>
            <li><a onclick="floatBox.show('boxTemplates')" class="add">@Piranha.Resources.Global.ToolbarAdd</a></li>
            <li><a href="@Url.Action("index")" class="refresh">@Piranha.Resources.Global.ToolbarReload</a></li>
        </ul>
        <button class="search" title="@Piranha.Resources.Global.ToolbarSearch"></button>@Html.TextBox("search")
        <div class="clear"></div>
    </div>
</div>
}
<div class="grid_12">
@using (Html.BeginForm("insert", "page")) {
    @Html.Hidden("TemplateId", "906761ea-6c04-4f4b-9365-f2c350ff4372")
    @Html.Hidden("ParentId")
    @Html.Hidden("Seqno")

    <ul class="sitemap">
        <li class="header">
            <span class="buttons"></span>
            <span class="date">@Piranha.Resources.Global.Created</span>
            <span class="date">@Piranha.Resources.Global.Updated</span>
            <span class="type">@Piranha.Resources.Global.Type</span>
            <span class="title">@Piranha.Resources.Global.Title</span>
        </li>
        @Html.Partial("Partial/SiteTree", Model.SiteMap)
    </ul>
    
    <table id="list" class="list" style="display:none">
        <thead>
            <tr>
                <th><span class="sort asc" data-sort="title">@Piranha.Resources.Global.Title</span></th>
                <th style="width:200px"><span class="sort" data-sort="template">@Piranha.Resources.Global.Type</span></th>
                <th class="date"><span class="sort" data-sort="updated">@Piranha.Resources.Global.Updated</span></th><commit_msg>Fix so that the view finds the partial sitetree even if it's inherited.<commit_after>﻿@model Piranha.Models.Manager.PageModels.ListModel
@section Head {
    <script type="text/javascript">
        //
        // Sets all hidden fields before submit
        function preSubmit(parentid, seqno) {
            $("#ParentId").val(parentid);
            $("#Seqno").val(seqno);

            floatBox.show('boxTemplates');

            return false;
        }

        var deletemsg = "@Piranha.Resources.Page.MessageDeleteConfirm";

        function formatSitemap() {
            $.each($(".sitemap li:visible"), function (i, e) {
                if (i % 2 == 1)
                    $(this).addClass("odd");
                else $(this).removeClass("odd");
            });
        }

        var currmove;

        $(document).ready(function () {
            formatSitemap();

            // Handle the site tree
            $(".sitemap .action").click(function () {
                var li = $(this).parent().parent();
                li.toggleClass("collapsed");
                li.toggleClass("expanded");
                formatSitemap();
            });

            // Set the selected template id
            $(".templates").click(function () {
                $("#TemplateId").val($(this).attr("data-templateid"));
                $("form").submit();
            });

            $(".delete").click(function () {
                return confirm(deletemsg);
            });

            // Setup page list
            var options = {
                listClass: 'list-js',
                searchId: 'search',
                valueNames: ['title', 'template', 'updated', 'created']
            };
            var pageList = new List('list', options);

            // Switch between list/tree
            $("#search").keyup(function () {
                if ($(this).val() != "") {
                    $(".sitemap").hide();
                    $(".list").show();
                } else {
                    $(".list").hide();
                    $(".sitemap").show();
                }
            });
        });

        function bindMove() {
            $(".move .title a").click(function () {
                if ($(this).parent().parent().hasClass("expanded"))
                    alert("move: " + currmove + " below: " + $(this).parent().parent().attr("id"));
                else alert("move: " + currmove + " after: " + $(this).parent().parent().attr("id"));

                return false;
            });
        }
    </script>
    <!-- Restyle the list a bit to match tree -->
    <style type="text/css">
        table.list th:first-child,
        table.list tbody td:first-child > * {
            padding-left: 30px;
            }
    </style>
}
@section Toolbar { 
@Html.Partial("Partial/Tabs")
<div class="toolbar">
    <div class="inner">
        <ul>
            <li><a onclick="floatBox.show('boxTemplates')" class="add">@Piranha.Resources.Global.ToolbarAdd</a></li>
            <li><a href="@Url.Action("index")" class="refresh">@Piranha.Resources.Global.ToolbarReload</a></li>
        </ul>
        <button class="search" title="@Piranha.Resources.Global.ToolbarSearch"></button>@Html.TextBox("search")
        <div class="clear"></div>
    </div>
</div>
}
<div class="grid_12">
@using (Html.BeginForm("insert", "page")) {
    @Html.Hidden("TemplateId", "906761ea-6c04-4f4b-9365-f2c350ff4372")
    @Html.Hidden("ParentId")
    @Html.Hidden("Seqno")

    <ul class="sitemap">
        <li class="header">
            <span class="buttons"></span>
            <span class="date">@Piranha.Resources.Global.Created</span>
            <span class="date">@Piranha.Resources.Global.Updated</span>
            <span class="type">@Piranha.Resources.Global.Type</span>
            <span class="title">@Piranha.Resources.Global.Title</span>
        </li>
        @Html.Partial(@"~/Areas/Manager/Views/Page/Partial/SiteTree.cshtml", Model.SiteMap)
    </ul>
    
    <table id="list" class="list" style="display:none">
        <thead>
            <tr>
                <th><span class="sort asc" data-sort="title">@Piranha.Resources.Global.Title</span></th>
                <th style="width:200px"><span class="sort" data-sort="template">@Piranha.Resources.Global.Type</span></th>
                <th class="date"><span class="sort" data-sort="updated">@Piranha.Resources.Global.Updated</span></th>
{'fraction_non_alphanumeric': 0.179519595448799, 'fraction_numerical': 0.0073554763820250545, 'mean_word_length': 1.828998699609883, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 111, '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': '6798752', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2445, 'n_words': 407}