<commit_before><%= render 'shared/errors', obj: @lottery_entrant %>

<div class="row">
  <div class="col-md-12">
    <%= form_with(model: [@lottery_entrant.organization, @lottery_entrant.lottery, @lottery_entrant], html: {class: "form-horizontal"}) do |f| %>
      <div class="form-row">
        <div class="form-group col-md-4">
          <%= f.label :first_name %>
          <%= f.text_field :first_name, class: "form-control", placeholder: "Beni", autofocus: true %>
        </div>

        <div class="form-group col-md-4">
          <%= f.label :last_name %>
          <%= f.text_field :last_name, class: "form-control", placeholder: "Hana" %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label :gender %>
          <%= f.select :gender, LotteryEntrant.genders.keys.map { |gender| [gender.titleize, gender] },
                       {prompt: true}, {class: "form-control"} %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label "Birthdate" %>
          <%= f.text_field :birthdate, class: "form-control", placeholder: "mm/dd/yyyy" %>
        </div>
      </div>

      <div class="form-row" data-controller="carmen" data-carmen-model="lottery_entrant">
        <div class="form-group col-md-3">
          <%= f.label :city %>
          <%= f.text_field :city, class: "form-control", placeholder: "City" %>
        </div>

        <div class="form-group col-md-4">
          <%= f.label :country_code, "Country" %>
          <%= carmen_country_select :lottery_entrant, :country_code,
                                    priority: %w(US CA),
                                    selected: @lottery_entrant.country_code,
                                    prompt: "Please select a country" %>
        </div>

        <div class="form-group col-md-3">
          <%= f.label :state_code, "State" %><br/>
          <%= render partial: "carmen/subregion_select", locals: {model: :lottery_entrant, parent_region: f.object.country_code} %>
        </div>
      </div>

      <div class="form-row">
        <div class="form-group col-md-2">
          <%= f.label :division %>
          <%= f.select :lottery_division_id, @lottery_entrant.lottery.divisions.map { |division| [division.name, division.id] },
                       {}, {class: "form-control"} %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label "Number of tickets" %>
          <%= f.text_field :number_of_tickets, class: "form-control", placeholder: "# of tickets" %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label :pre_selected %>
          <%= f.select :pre_selected, [["No", false], ["Yes", true]], {}, {class: "form-control"} %>
        </div>
      </div>

      <div class="form-row">
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <%= f.submit(@lottery_entrant.new_record? ? "Create Entrant" : "Update Entrant", class: "btn btn-primary") %>
          </div>
        </div>
      </div>

      <div class="form-row">
        <div class="form-group">
          <div class="col">
            <span class="brackets">
              <% if @lottery_entrant.new_record? %>
                <%= link_to "Cancel", setup_organization_lottery_path(@lottery_entrant.organization, @lottery_entrant.lottery) %>
              <% else %>
                <%= link_to "Cancel", organization_lottery_lottery_entrant_path(@lottery_entrant.organization, @lottery_entrant.lottery, @lottery_entrant) %>
              <% end %>
            </span>
          </div>
        </div>
      </div>
    <% end %>
  </div>
</div>
<commit_msg>Get Cancel button working for entrant inline edit<commit_after><%= render 'shared/errors', obj: @lottery_entrant %>

<div class="row">
  <div class="col-md-12">
    <%= form_with(model: [@lottery_entrant.organization, @lottery_entrant.lottery, @lottery_entrant], html: {class: "form-horizontal"}) do |f| %>
      <div class="form-row">
        <div class="form-group col-md-4">
          <%= f.label :first_name %>
          <%= f.text_field :first_name, class: "form-control", placeholder: "Beni", autofocus: true %>
        </div>

        <div class="form-group col-md-4">
          <%= f.label :last_name %>
          <%= f.text_field :last_name, class: "form-control", placeholder: "Hana" %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label :gender %>
          <%= f.select :gender, LotteryEntrant.genders.keys.map { |gender| [gender.titleize, gender] },
                       {prompt: true}, {class: "form-control"} %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label "Birthdate" %>
          <%= f.text_field :birthdate, class: "form-control", placeholder: "mm/dd/yyyy" %>
        </div>
      </div>

      <div class="form-row" data-controller="carmen" data-carmen-model="lottery_entrant">
        <div class="form-group col-md-3">
          <%= f.label :city %>
          <%= f.text_field :city, class: "form-control", placeholder: "City" %>
        </div>

        <div class="form-group col-md-4">
          <%= f.label :country_code, "Country" %>
          <%= carmen_country_select :lottery_entrant, :country_code,
                                    priority: %w(US CA),
                                    selected: @lottery_entrant.country_code,
                                    prompt: "Please select a country" %>
        </div>

        <div class="form-group col-md-3">
          <%= f.label :state_code, "State" %><br/>
          <%= render partial: "carmen/subregion_select", locals: {model: :lottery_entrant, parent_region: f.object.country_code} %>
        </div>
      </div>

      <div class="form-row">
        <div class="form-group col-md-2">
          <%= f.label :division %>
          <%= f.select :lottery_division_id, @lottery_entrant.lottery.divisions.map { |division| [division.name, division.id] },
                       {}, {class: "form-control"} %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label "Number of tickets" %>
          <%= f.text_field :number_of_tickets, class: "form-control", placeholder: "# of tickets" %>
        </div>

        <div class="form-group col-md-2">
          <%= f.label :pre_selected %>
          <%= f.select :pre_selected, [["No", false], ["Yes", true]], {}, {class: "form-control"} %>
        </div>
      </div>

      <div class="form-row">
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <%= f.submit(@lottery_entrant.new_record? ? "Create Entrant" : "Update Entrant", class: "btn btn-primary") %>
          </div>
        </div>
      </div>

      <div class="form-row">
        <div class="form-group">
          <div class="col">
            <span class="brackets">
              <% if @lottery_entrant.new_record? %>
                <%= link_to "Cancel", setup_organization_lottery_path(@lottery_entrant.organization, @lottery_entrant.lottery) %>
              <% else %>
                <%= link_to "Cancel", setup_organization_lottery_path(@lottery_entrant.organization, @lottery_entrant.lottery, entrant_id: @lottery_entrant.id) %>
              <% end %>
            </span>
          </div>
        </div>
      </div>
    <% end %>
  </div>
</div>

{'fraction_non_alphanumeric': 0.17519443307408925, 'fraction_numerical': 0.004093327875562832, 'mean_word_length': 2.0720871751886003, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 151, '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': '6426681', 'n_tokens_mistral': 2512, 'n_tokens_neox': 2328, 'n_words': 448}