<commit_before>@using System.Threading.Tasks
@using CompetitionPlatform.Models.ProjectViewModels
@model ProjectViewModel

@{
    ViewData["Title"] = "Edit Project";
}

<section class="section section--lead section--padding">
    <div class="container">
        <div class="page__actions">
            <div class="back_link"><a href=""><i class="icon icon--back"></i> Back to Projects</a></div>
        </div>
        <div class="content__left">
            <div class="pull-right latest_updated">
                <span class="text-muted">Latest updated</span> @Model.LastModified.ToString("MMMM dd, yyyy")
            </div>
            <h2>Edit project</h2>
        </div>
    </div>
</section>

<section class="section section--steps">
    @{
        var initiativeCircle = "";
        var competitionRegistrationCircle = "";
        var implementationCircle = "";
        var votingCircle = "";
        var archiveCircle = "";

        if (Model.Status == Status.Initiative)
        {
            initiativeCircle = "active";
        }
        if (Model.Status == Status.CompetitionRegistration)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "active";
        }
        if (Model.Status == Status.Implementation)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "success";
            implementationCircle = "active";
        }
        if (Model.Status == Status.Voting)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "success";
            implementationCircle = "success";
            votingCircle = "active";
        }
        if (Model.Status == Status.Archive)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "success";
            implementationCircle = "success";
            votingCircle = "success";
            archiveCircle = "success";
        }

    }
    <div class="container">
        <div class="steps">
            <div class="steps__item steps__item--1 @initiativeCircle">
                <a href="">
                    <div class="steps__index">1</div>
                    <div class="steps__text">Initiative</div>
                </a>
            </div>
            <div class="steps__item steps__item--2 @competitionRegistrationCircle">
                <a href="">
                    <div class="steps__index">2</div>
                    <div class="steps__text">Competition registration</div>
                </a>
            </div>
            <div class="steps__item steps__item--3 @implementationCircle">
                <a href="">
                    <div class="steps__index">3</div>
                    <div class="steps__text">Implementation</div>
                </a>
            </div>
            <div class="steps__item steps__item--3 @votingCircle">
                <a href="">
                    <div class="steps__index">4</div>
                    <div class="steps__text">Voting</div>
                </a>
            </div>
            <div class="steps__item steps__item--4 @archiveCircle">
                <a href="">
                    <div class="steps__index">5</div>
                    <div class="steps__text">Archive</div>
                </a>
            </div>
        </div>
    </div>
</section>

<section class="section section--competition_edit">
    <div class="container">
        <div class="content__left">
            <form asp-action="SaveProject" enctype="multipart/form-data" class="form form--default form--competition_edit">
                <h4 class="form_title">basic info</h4>

                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <input asp-for="@Model.Id" type="hidden" />
                <input asp-for="@Model.VotesFor" type="hidden" />
                <input asp-for="@Model.VotesAgainst" type="hidden" />

                @if (Model.IsAdmin)
                {
                    <div class="row">
                        <div class="col-sm-6">
                            <label class="control-label">Status</label>
                            <div class="form-group" data-control="select">
                                <select asp-for="@Model.Status" class="form-control">
                                    @foreach (var status in Enum.GetValues(typeof(Status)))
                                    {
                                        <option value=@status>Status: @status</option>
                                    }
                                </select>
                            </div><commit_msg>Add a message and a voting bar to the Edit view when project status is Initiative.<commit_after>@using System.Threading.Tasks
@using CompetitionPlatform.Models.ProjectViewModels
@model ProjectViewModel

@{
    ViewData["Title"] = "Edit Project";
}

<section class="section section--lead section--padding">
    <div class="container">
        <div class="page__actions">
            <div class="back_link"><a href=""><i class="icon icon--back"></i> Back to Projects</a></div>
        </div>
        <div class="content__left">
            <div class="pull-right latest_updated">
                <span class="text-muted">Latest updated</span> @Model.LastModified.ToString("MMMM dd, yyyy")
            </div>
            <h2>Edit project</h2>
        </div>
    </div>
</section>

<section class="section section--steps">
    @{
        var initiativeCircle = "";
        var competitionRegistrationCircle = "";
        var implementationCircle = "";
        var votingCircle = "";
        var archiveCircle = "";
        var votesCount = Model.VotesFor + Model.VotesAgainst;
        var numberOfVotes = votesCount == 1 ? votesCount + " VOTE" : votesCount + " VOTES";

        if (Model.Status == Status.Initiative)
        {
            initiativeCircle = "active";
        }
        if (Model.Status == Status.CompetitionRegistration)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "active";
        }
        if (Model.Status == Status.Implementation)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "success";
            implementationCircle = "active";
        }
        if (Model.Status == Status.Voting)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "success";
            implementationCircle = "success";
            votingCircle = "active";
        }
        if (Model.Status == Status.Archive)
        {
            initiativeCircle = "success";
            competitionRegistrationCircle = "success";
            implementationCircle = "success";
            votingCircle = "success";
            archiveCircle = "success";
        }

    }
    <div class="container">
        <div class="steps">
            <div class="steps__item steps__item--1 @initiativeCircle">
                <a href="">
                    <div class="steps__index">1</div>
                    <div class="steps__text">Initiative</div>
                </a>
            </div>
            <div class="steps__item steps__item--2 @competitionRegistrationCircle">
                <a href="">
                    <div class="steps__index">2</div>
                    <div class="steps__text">Competition registration</div>
                </a>
            </div>
            <div class="steps__item steps__item--3 @implementationCircle">
                <a href="">
                    <div class="steps__index">3</div>
                    <div class="steps__text">Implementation</div>
                </a>
            </div>
            <div class="steps__item steps__item--3 @votingCircle">
                <a href="">
                    <div class="steps__index">4</div>
                    <div class="steps__text">Voting</div>
                </a>
            </div>
            <div class="steps__item steps__item--4 @archiveCircle">
                <a href="">
                    <div class="steps__index">5</div>
                    <div class="steps__text">Archive</div>
                </a>
            </div>
        </div>

        @if (Model.Status == Status.Initiative)
        {
            <div class="row">
                <div class="col-sm-9">
                    <p>The project must go through several stages before the competition starts. At Initiative must collect a minimum of 40 votes, for a competition. Once this amount will be collected, the project can be transferred to the status of competition registration.</p>
                </div>
                <div class="col-sm-3">
                    <div class="voting_group__value">@numberOfVotes</div>

                    @await Html.PartialAsync("VotingBarsPartial", new ProjectVoteViewModel
               {
                   VotesFor = Model.VotesFor,
                   VotesAgainst = Model.VotesAgainst
               })
                </div>
            </div>
        }
    </div>
</section>

<section class="section section--competition_edit">
    <div class="container">
        <div class="content__left">
            <form asp-action="SaveProject" enctype="multipart/form-data" class="form form--default form--competition_edit">
                <h4 class="form_title">basic info</h4>

                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <input asp-for="@Model.Id" type="hidden" />
                <input asp-for="@Model.VotesFor" type="hidden" />
                <input asp-for="@Model.VotesAgainst" type="hidden" />

                @if (Model.IsAdmin)
                {
                    <div class="row">
                        <div class="col-sm-6">
                            <label class="control-label">Status</label>
                            <div class="form-group" data-control="select">
                                <select asp-for="@Model.Status" class="form-control">
                                    @foreach (var status in Enum.GetValues(typeof(Status)))
                                    {
                                        <option value=@status>Status: @status</option>
                                    }
                                </select>
                            </div>
{'fraction_non_alphanumeric': 0.12544768173458523, 'fraction_numerical': 0.0033878617752395703, 'mean_word_length': 1.5656816488701266, 'pattern_counts': {'":': 0, '<': 187, '<?xml version=': 0, '>': 187, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '933348', 'n_tokens_mistral': 2688, 'n_tokens_neox': 2573, 'n_words': 530}