<commit_before>﻿@using NinjaHive.WebApp.Controllers
@using NinjaHive.WebApp.Extensions
@using NinjaHive.WebApp.Helpers
@model NinjaHive.WebApp.Models.GameItemViewModel

@Scripts.Render("~/bundles/ninjahive");

<div class="row">
    <div class="page-header">
        <h2>
            Game Item <small>Create</small>
        </h2>
    </div>

    @{ Html.BeginForm<ItemsController>(c => c.Create(null), new { @class = "form-horizontal", role = "form", name = "createItemForm" }); }
    @Html.AntiForgeryToken()

    @Html.Partial(Partials.EditGameItem, Model)

    <div class="form-group">
        <div class="col-md-12">
            <input type="submit" class="btn btn-primary" value="Create item"/>
        </div>
    </div>

    @{ Html.EndForm(); }

    <script>
        ninjaHive.enforceUniqueValue(document.forms["createItemForm"],"GameItem.Name","/Items/IsNameAvailable");
    </script>
</div><commit_msg>Fixed unmaintainable hard coded url into a razor/c# url<commit_after>﻿@using NinjaHive.WebApp.Controllers
@using NinjaHive.WebApp.Extensions
@using NinjaHive.WebApp.Helpers
@model NinjaHive.WebApp.Models.GameItemViewModel

@Scripts.Render("~/bundles/ninjahive");

<div class="row">
    <div class="page-header">
        <h2>
            Game Item <small>Create</small>
        </h2>
    </div>

    @{ Html.BeginForm<ItemsController>(c => c.Create(null), new { @class = "form-horizontal", role = "form", name = "createItemForm" }); }
    @Html.AntiForgeryToken()

    @Html.Partial(Partials.EditGameItem, Model)

    <div class="form-group">
        <div class="col-md-12">
            <input type="submit" class="btn btn-primary" value="Create item"/>
        </div>
    </div>

    @{ Html.EndForm(); }

    <script>
        @{var validateUrl = UrlProvider<ItemsController>.GetUrl(c => c.IsNameAvailable(""));}
        ninjaHive.enforceUniqueValue(document.forms["createItemForm"], "GameItem.Name", "@validateUrl");
    </script>
</div>
{'fraction_non_alphanumeric': 0.16940451745379878, 'fraction_numerical': 0.004106776180698152, 'mean_word_length': 3.470183486238532, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 39, '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': '812206', 'n_tokens_mistral': 671, 'n_tokens_neox': 647, 'n_words': 109}