<commit_before>﻿@using System.Globalization
@using Orchard.ContentManagement
@using Orchard.Core.Title.Models
@model Nwazet.Commerce.ViewModels.ProductAttributesPartEditViewModel
@{
    var currentAttributeIds = Model.Part.AttributeIds;
}
<fieldset>
    <legend>@T("Attributes")</legend>
    @foreach(var attribute in Model.Attributes) {
        var attributeName = attribute.As<TitlePart>().Title;
        var idString = attribute.Id.ToString(CultureInfo.InvariantCulture);
        <input type="checkbox" name="@Html.Name(idString)"@(currentAttributeIds.Contains(attribute.Id) ? " checked=\"checked\"" : "") id="@Html.Id(idString)" value="@attribute.Id"/>
        <label class="forcheckbox" for="@Html.Id(idString)">@attributeName</label>
    }
    <div class="hint">@T("Please select the attributes that apply to this product. Customers will need to choose a value for each active attribute when adding the product to their shopping cart.")</div>
</fieldset><commit_msg>Fixed attribute persistence on product editor.<commit_after>﻿@using System.Globalization
@using Orchard.ContentManagement
@using Orchard.Core.Title.Models
@model Nwazet.Commerce.ViewModels.ProductAttributesPartEditViewModel
@{
    var currentAttributeIds = Model.Part.AttributeIds;
    var index = 0;
}
<fieldset>
    <legend>@T("Attributes")</legend>
    @foreach(var attribute in Model.Attributes) {
        var attributeName = attribute.As<TitlePart>().Title;
        var idString = attribute.Id.ToString(CultureInfo.InvariantCulture);
        <input type="checkbox" name="@(Html.Name("AttributeIds"))"@(currentAttributeIds.Contains(attribute.Id) ? " checked=\"checked\"" : "") id="@Html.Id(idString)" value="@attribute.Id"/>
        <label class="forcheckbox" for="@Html.Id(idString)">@attributeName</label>
    }
    <div class="hint">@T("Please select the attributes that apply to this product. Customers will need to choose a value for each active attribute when adding the product to their shopping cart.")</div>
</fieldset>
{'fraction_non_alphanumeric': 0.13622754491017963, 'fraction_numerical': 0.000499001996007984, 'mean_word_length': 5.1692307692307695, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '6340405', 'n_tokens_mistral': 568, 'n_tokens_neox': 545, 'n_words': 131}