<commit_before>﻿@model IEnumerable<MegatubeV2.ViewChannel>

@{
    ViewBag.Title = "Index";
    string[] ViewTypeArr = { "Associated", "Not associated", "Not active" };
    int selectedViewType = 0;
}

@*https://stackoverflow.com/questions/19819597/datatables-setting-column-width*@

<script src="~/assets/vendor/js/jquery.dataTables.min.js"></script>
<script src="~/assets/vendor/js/dataTables.bootstrap.min.js"></script>

<script language="javascript">
    $(document).ready(function () {
        $('#userTable').DataTable();
    });
</script>

<div class="row">
    <form class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-3 control-label">Show me:</label>
            <div class="col-sm-5">
                <select class="form-control" name="m">
                    @{
                        string selected = "";
                        for (int i = 0; i < ViewTypeArr.Length; i++)
                        {

                            if (i == selectedViewType)
                            {
                                selected = "selected";
                            }
                            else
                            {
                                selected = "";
                            }
                            @Html.Raw("<option value=\"" + (i) + "\"" + selected + ">" + ViewTypeArr[i] + "</option>");
                        }
                    }
                </select>
            </div>
            <div class="col-sm-4">
                <button type="submit" class="btn btn-default">Submit</button>
            </div>

        </div>
    </form>
</div>

<table class="table table-condensed table-hover table-striped" id="userTable">
    <thead>
        <tr>
            <th class="small text-muted text-uppercase">
                <strong>
                    @Html.DisplayNameFor(model => model.Id)
                </strong>
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.OwnerName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RecruiterName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RegistrationDate)
            </th>
            <th>
                %Owner
            </th>
            <th>
                %Recruiter
            </th>
            <th>
                %Megatube
            </th>
            <th>

            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @{
                        string sUrl = "https://www.youtube.com/channel/UC" + item.Id;

                        if (item.IsActive)
                        {
                            <a href="@sUrl" target="_blank">@item.Id</a>
                        }
                        else
                        {
                            <a href="@sUrl" target="_blank" class="text-gray-dark">@item.Id</a>
                        }
                    }
                </td>
                <td class="text-mint-green">
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.OwnerName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RecruiterName)
                </td>
                <td>
                    @item.RegistrationDate.ToShortDateString()
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PercentOwner)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PercentRecruiter)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PercentMegatube)
                </td>
                <td nowrap="nowrap">
                    <a title="Edit" class="btn btn-default text-primary btn-sm action-button" href="@Url.Action("Edit","Channels",new { Id = item.Id })"><i class="glyphicon glyphicon-pencil"></i></a>
                    @*<a title="Details" class="btn btn-default text-danger btn-sm action-button" href=""><i class="glyphicon glyphicon-arrow-right"></i></a>*@
                </td>
            </tr>
        }
    </tbody>
</table>
<commit_msg>ViewChannels: filters for channels type (call to controller works)<commit_after>﻿@model IEnumerable<MegatubeV2.ViewChannel>

@{
    ViewBag.Title = "Index";
    string[] ViewTypeArr = { "Associated", "Not associated", "Not active" };
    int selectedViewType = 0;
}

@*https://stackoverflow.com/questions/19819597/datatables-setting-column-width*@

<script src="~/assets/vendor/js/jquery.dataTables.min.js"></script>
<script src="~/assets/vendor/js/dataTables.bootstrap.min.js"></script>

<script language="javascript">
    $(document).ready(function () {
        $('#userTable').DataTable();
    });

    function UpdateFilter(){

        var referenced = "true";
        var active = "true";

        if ($("#channelsType").val() == "2")
            active = "false";
        else if ($("#channelsType").val() == "1")
            referenced = "false";

        $('#referenced').val(referenced);
        $('#active').val(active);
        $('#viewChannelsForm').submit();

    }
</script>

<div class="row">
        <div class="form-group">
            <label class="col-sm-3 control-label">Show me:</label>
            <div class="col-sm-5">
                <select class="form-control" id="channelsType" action="@Url.Action("Index", "ViewChannels")">
                    @{
                        string selected = "";
                        for (int i = 0; i < ViewTypeArr.Length; i++)
                        {

                            if (i == selectedViewType)
                            {
                                selected = "selected";
                            }
                            else
                            {
                                selected = "";
                            }
                            @Html.Raw("<option value=\"" + (i) + "\"" + selected + ">" + ViewTypeArr[i] + "</option>");
                        }
                    }
                </select>
            </div>
    @using (Html.BeginForm("Index", "ViewChannels", FormMethod.Post, new { @class = "form-horizontal", id = "viewChannelsForm", enctype = "multipart/form-data" }))
    {
            <div class="col-sm-4">
                <input type="hidden" name="referenced" id="referenced" value="true" />
                <input type="hidden" name="active" id="active" value="true" />
                <a href="javasctipt:{}" onclick="UpdateFilter(); return false;" role="button" class="btn btn-default">Show</a>
            </div>
    }
        </div>
</div>

<table class="table table-condensed table-hover table-striped" id="userTable">
    <thead>
        <tr>
            <th class="small text-muted text-uppercase">
                <strong>
                    @Html.DisplayNameFor(model => model.Id)
                </strong>
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.OwnerName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RecruiterName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.RegistrationDate)
            </th>
            <th>
                %Owner
            </th>
            <th>
                %Recruiter
            </th>
            <th>
                %Megatube
            </th>
            <th>

            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
            {
            <tr>
                <td>
                    @{
                        string sUrl = "https://www.youtube.com/channel/UC" + item.Id;

                        if (item.IsActive)
                        {
                            <a href="@sUrl" target="_blank">@item.Id</a>
                        }
                        else
                        {
                            <a href="@sUrl" target="_blank" class="text-gray-dark">@item.Id</a>
                        }
                    }
                </td>
                <td class="text-mint-green">
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.OwnerName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.RecruiterName)
                </td>
                <td>
                    @item.RegistrationDate.ToShortDateString()
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PercentOwner)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PercentRecruiter)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PercentMegatube)
                </td>
                <td nowrap="nowrap">
                    <a title="Edit" class="btn btn-default text-primary btn-sm action-button" href="@Url.Action("Edit","Channels",new { Id = item.Id })"><i class="glyphicon glyphicon-pencil"></i></a>
                    @*<a title="Details" class="btn btn-default text-danger btn-sm action-button" href=""><i class="glyphicon glyphicon-arrow-right"></i></a>*@
                </td>
            </tr>
                        }
    </tbody>
</table>
{'fraction_non_alphanumeric': 0.14309143091430915, 'fraction_numerical': 0.003075030750307503, 'mean_word_length': 1.1505400044081993, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 0, '>': 195, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '7647837', 'n_tokens_mistral': 2712, 'n_tokens_neox': 2538, 'n_words': 452}