<commit_before>﻿<%@ Page
    Title="Create"
    Language="C#"
    MasterPageFile="~/Site.Master"
    AutoEventWireup="true"
    CodeBehind="Create.aspx.cs"
    Inherits="BarterSystem.WebForms.Barter.Create" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%: Title %>.</h2>
    <p class="text-danger">
        <asp:Literal runat="server" ID="ErrorMessage" />
    </p>
    <div class="form-horizontal">
        <h4>Create a new barter offer</h4>
        <hr />
        <asp:ValidationSummary runat="server" CssClass="text-danger" />
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="TitleAd" CssClass="col-md-2 control-label">Title</asp:Label>
            <div class="col-md-10">
                <asp:TextBox runat="server" ID="TitleAd" TextMode="SingleLine" CssClass="form-control" />
                <asp:RequiredFieldValidator runat="server" ControlToValidate="TitleAd"
                    CssClass="text-danger" ErrorMessage="The title field is required." />
            </div>
        </div>
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="FileUploadImage" CssClass="col-md-2 control-label">Image:</asp:Label>            
            <div class="col-md-10">
                <asp:FileUpload runat="server" ID="FileUploadImage" CssClass="form-control" />
                <asp:RegularExpressionValidator ID="RevImg" runat="server" ControlToValidate="FileUploadImage"
                    ErrorMessage="Invalid File!(only  .gif, .jpg, .jpeg Files are supported)"
                    ValidationExpression="^.+(.jpg|.JPG|.gif|.GIF|.jpeg|JPEG)$" ForeColor="Red"></asp:RegularExpressionValidator>
            </div>
        </div>
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="Content" CssClass="col-md-2 control-label">Content</asp:Label>
            <div class="col-md-10">
                <asp:TextBox runat="server" ID="Content" TextMode="MultiLine" CssClass="form-control" />
                <asp:RequiredFieldValidator runat="server" ControlToValidate="Content"
                    CssClass="text-danger" ErrorMessage="The content field is required." />
            </div>
        </div>
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="Category" CssClass="col-md-2 control-label">Category</asp:Label>
            <div class="col-md-10">
                <asp:DropDownList runat="server" ID="Category" CssClass="form-control"></asp:DropDownList>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="Category"
                    CssClass="text-danger" Display="Dynamic" ErrorMessage="The category field is required." />
            </div>
        </div>
        <div class="form-group"><commit_msg>added validation in the barter creation<commit_after>﻿<%@ Page
    Title="Create"
    Language="C#"
    MasterPageFile="~/Site.Master"
    AutoEventWireup="true"
    CodeBehind="Create.aspx.cs"
    Inherits="BarterSystem.WebForms.Barter.Create" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%: Title %>.</h2>
    <p class="text-danger">
        <asp:Literal runat="server" ID="ErrorMessage" />
    </p>
    <div class="form-horizontal">
        <h4>Create a new barter offer.</h4>
        <hr />
        <asp:ValidationSummary runat="server" CssClass="text-danger" />
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="TitleAd" CssClass="col-md-2 control-label">Title</asp:Label>
            <div class="col-md-10">
                <asp:TextBox runat="server" ID="TitleAd" TextMode="SingleLine" CssClass="form-control" />
                <asp:RequiredFieldValidator runat="server" ControlToValidate="TitleAd"
                    CssClass="text-danger" ErrorMessage="The title field is required." />
                <asp:RegularExpressionValidator Display="Dynamic" runat="server" ControlToValidate="TitleAd"
                            ValidationExpression="^[\s\S]{5,50}$"
                            CssClass="text-danger" ErrorMessage="The title length must be between 3 and 50 symbols." />
            </div>
        </div>
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="FileUploadImage" CssClass="col-md-2 control-label">Image:</asp:Label>            
            <div class="col-md-10">
                <asp:FileUpload runat="server" ID="FileUploadImage" CssClass="form-control" />
                <asp:RegularExpressionValidator ID="RevImg" runat="server" ControlToValidate="FileUploadImage"
                    ErrorMessage="Invalid File!(only  .gif, .jpg, .jpeg Files are supported)"
                    ValidationExpression="^.+(.jpg|.JPG|.gif|.GIF|.jpeg|JPEG)$" ForeColor="Red"></asp:RegularExpressionValidator>
            </div>
        </div>
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="Content" CssClass="col-md-2 control-label">Content</asp:Label>
            <div class="col-md-10">
                <asp:TextBox runat="server" ID="Content" TextMode="MultiLine" CssClass="form-control" />
                <asp:RequiredFieldValidator runat="server" ControlToValidate="Content"
                    CssClass="text-danger" ErrorMessage="The content field is required." />
                <asp:RegularExpressionValidator Display="Dynamic" runat="server" ControlToValidate="Content"
                            ValidationExpression="^[\s\S]{5,200}$"
                            CssClass="text-danger" ErrorMessage="The title length must be between 5 and 200 symbols." />
                
            </div>
        </div>
        <div class="form-group">
            <asp:Label runat="server" AssociatedControlID="Category" CssClass="col-md-2 control-label">Category</asp:Label>
            <div class="col-md-10">
                <asp:DropDownList runat="server" ID="Category" CssClass="form-control"></asp:DropDownList>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="Category"
                    CssClass="text-danger" Display="Dynamic" ErrorMessage="The category field is required." />
            </div>
        </div>
        <div class="form-group">
{'fraction_non_alphanumeric': 0.14772007599746675, 'fraction_numerical': 0.007599746675110829, 'mean_word_length': 2.6556712962962963, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 101, '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': '5901023', 'n_tokens_mistral': 1859, 'n_tokens_neox': 1774, 'n_words': 312}