<commit_before>﻿@model JoinRpg.Web.Models.GameFieldListViewModel

@{
    ViewBag.Title = "Поля персонажа / заявки";
}

<h2>
    @ViewBag.Title
@if (Model.CanEditFields)
{
<a href="@Url.Action("Create", new {Model.ProjectId})" class="btn btn-info"><span class="glyphicon glyphicon-plus"></span>Добавить новое поле</a>
}
</h2>
@{
    var firstItem = Model.Items.FirstOrDefault();
}
@if (firstItem != null)
{
    <table class="table" style="margin-top: 1em">
        <tr>
            <th>
                @Html.DisplayNameFor(model => firstItem.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.FieldViewType)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.FieldBoundTo)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.IsPublic)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.CanPlayerView)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.CanPlayerEdit)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.Description)
            </th>
            <th>

            </th>
            @if (Model.CanEditFields)
            {
                <th></th>
            }
        </tr>

        @foreach (var item in Model.Items)
        {
            <tr>
                <td class="@(item.IsActive ? "" : "deleted")">
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FieldViewType)
                </td>
                <td>
                    @Html.DisplayFor(model => item.FieldBoundTo)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.IsPublic)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CanPlayerView)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CanPlayerEdit)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @if (!item.IsActive)
                    {
                        <span>удалено</span>
                    }
                </td>
                @if (Model.CanEditFields)
                {
                    <td>
                        @{
                            if (item.IsActive)
                            {
                                @Html.ActionLink("Изменить", "Edit", new { item.ProjectFieldId, item.ProjectId})<text> | </text>
                                @Html.ActionLink("Удалить", "Delete", new { item.ProjectFieldId, item.ProjectId})
                            }
                            else
                            {
                                @Html.ActionLink("Восстановить", "Edit", new { item.ProjectFieldId, item.ProjectId})
                            }
                            var moveParameters = new
                            {
                                 item.ProjectFieldId, Model.ProjectId,
                            };
                            if (!item.First)
                            {
                                <a href="@Url.Action("MoveUp", moveParameters)"><span title="переместить выше" class="glyphicon glyphicon-arrow-up"></span></a>
                            }
                            if (!item.Last)
                            {
                                <a href="@Url.Action("MoveDown", moveParameters)"><span title="переместить ниже" class="glyphicon glyphicon-arrow-down"></span></a>
                            }
                        }
                    </td>
                }
            </tr>
        }

    </table>
}<commit_msg>Improve a bit game fields list<commit_after>﻿@model JoinRpg.Web.Models.GameFieldListViewModel

@{
    ViewBag.Title = "Поля персонажа / заявки";
}

<h2>
    @ViewBag.Title
@if (Model.CanEditFields)
{
<a href="@Url.Action("Create", new {Model.ProjectId})" class="btn btn-info"><span class="glyphicon glyphicon-plus"></span>Добавить новое поле</a>
}
</h2>
@{
    var firstItem = Model.Items.FirstOrDefault();
}
@if (firstItem != null)
{
    <table class="table" style="margin-top: 1em">
        <tr>
            <th>
                @Html.DisplayNameFor(model => firstItem.Name)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.FieldViewType)
            </th>
            <th style="white-space: nowrap">
                @Html.DisplayNameFor(model => firstItem.FieldBoundTo)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.IsPublic)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.CanPlayerView)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.CanPlayerEdit)
            </th>
            <th>
                @Html.DisplayNameFor(model => firstItem.Description)
            </th>
            @if (Model.CanEditFields)
            {
                <th></th>
            }
        </tr>

        @foreach (var item in Model.Items)
        {
            <tr class="@(item.IsActive ? "" : "deleted")">
                <td >
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FieldViewType)
                </td>
                <td>
                    @Html.DisplayFor(model => item.FieldBoundTo)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.IsPublic)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CanPlayerView)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CanPlayerEdit)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                @if (Model.CanEditFields)
                {
                    <td>
                        @{
                            if (item.IsActive)
                            {
                                @Html.ActionLink("Изменить", "Edit", new { item.ProjectFieldId, item.ProjectId})<text> | </text>
                                @Html.ActionLink("Удалить", "Delete", new { item.ProjectFieldId, item.ProjectId})
                            }
                            else
                            {
                                @Html.ActionLink("Восстановить", "Edit", new { item.ProjectFieldId, item.ProjectId})
                            }
                            var moveParameters = new
                            {
                                 item.ProjectFieldId, Model.ProjectId,
                            };
                            if (!item.First)
                            {
                                <a href="@Url.Action("MoveUp", moveParameters)"><span title="переместить выше" class="glyphicon glyphicon-arrow-up"></span></a>
                            }
                            if (!item.Last)
                            {
                                <a href="@Url.Action("MoveDown", moveParameters)"><span title="переместить ниже" class="glyphicon glyphicon-arrow-down"></span></a>
                            }
                        }
                    </td>
                }
            </tr>
        }

    </table>
}
{'fraction_non_alphanumeric': 0.12011501764475233, 'fraction_numerical': 0.0007842112142203634, 'mean_word_length': 1.0062926061877293, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 145, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3935157', 'n_tokens_mistral': 2073, 'n_tokens_neox': 1961, 'n_words': 310}