<commit_before><%= render "shared/globalize_locales", resource: @budget %>

<%= translatable_form_for [:admin, @budget] do |f| %>

  <div class="js-budget-id" id="<%= @budget.id %>"></div>

  <%= render "shared/errors", resource: @budget %>

  <div class="small-12 medium-9 column">
    <%= f.translatable_fields do |translations_form| %>
    <%= translations_form.text_field :name,
        label: t("activerecord.attributes.budget.name"),
        maxlength: Budget.title_max_length,
        placeholder: t("activerecord.attributes.budget.name") %>
    <% end %>
  </div>

  <div class="margin-top">
    <div class="small-12 medium-6 column">
      <%= f.select :phase, budget_phases_select_options %>
    </div>
    <div class="small-12 medium-3 column end">
      <%= f.select :currency_symbol, budget_currency_symbol_select_options %>
    </div>
  </div>

  <div class="margin-top">
    <div class="small-12 medium-4 column end">
      <a id="administrators_button" class="button expanded hollow js-budget-show-users-list js-budget-show-administrators-list" data-toggle="administrators_list"><%= t("admin.budgets.edit.administrators", count: @budget.administrators.count) %>
      </a>
    </div>
    <div class="small-12 medium-4 column end">
      <a id="valuators_button" class="button expanded hollow js-budget-show-users-list js-budget-show-valuators-list" data-toggle="valuators_list"><%= t("admin.budgets.edit.valuators", count: @budget.valuators.count) %>
      </a>
    </div>
    <div class="small-12 medium-4 column end">
      <a id="trackers_button" class="button expanded hollow js-budget-show-users-list js-budget-show-trackers-list" data-toggle="trackers_list"><%= t("admin.budgets.edit.trackers", count: @budget.trackers.count) %>
      </a>
    </div>
  </div>

  <div class="margin-top">
      <%= render "/admin/budgets/association", assignable_type: "administrators", assignables: @admins, budget: @budget %>
      <%= render "/admin/budgets/association", assignable_type: "valuators", assignables: @valuators, budget: @budget %>
      <%= render "/admin/budgets/association", assignable_type: "trackers", assignables: @trackers, budget: @budget %>
  </div>

  <div class="margin-top">
    <div class="small-12 medium-9 column end">
      <%= f.text_field :budget_milestone_tags, placeholder: t("admin.budget_investments.edit.tags_placeholder") %>
    </div>
    <div class="small-12 medium-9 column end">
      <%= f.text_field :budget_valuation_tags, placeholder: t("admin.budget_investments.edit.tags_placeholder") %>
    </div>
    <div class="small-12 medium-9 column end">
      <%= f.text_field :help_link %>
    </div>
  </div>

  <% if @budget.phases.present? %>
    <div class="small-12 column">
      <table id="budget-phases-table" class="table-for-mobile">
        <thead>
          <tr>
            <th><%= t("admin.budgets.edit.phase") %></th>
            <th><%= t("admin.budgets.edit.dates") %></th>
            <th class="text-center"><%= t("admin.budgets.edit.enabled") %></th>
            <th><%= t("admin.budgets.edit.actions") %></th>
          </tr>
        </thead>

        <% @budget.phases.order(:id).each do |phase| %>
          <tr id="<%= dom_id(phase) %>" class="phase">
            <td>
              <%= t("budgets.phase.#{phase.kind}") %>
              <% if @budget.current_phase == phase %>
                <span class="label success"><strong><%= t("admin.budgets.edit.active") %></strong></span>
              <% end %>
            </td>
            <td>
              <% if phase.starts_at.present? || phase.ends_at.present? %>
                <%= l(phase.starts_at.to_date) if phase.starts_at.present? %>
                -
                <%= l(phase.ends_at.to_date) if phase.ends_at.present? %>
              <% else %>
                <em><%= t("admin.budgets.edit.blank_dates") %></em>
              <% end %>
            </td>
            <td class="text-center">
              <span class="budget-phase-enabled <%= phase.enabled? ? "enabled" : "disabled" %>"></span>
            </td>
            <td>
              <%= link_to t("admin.budgets.edit.edit_phase"),
                          edit_admin_budget_budget_phase_path(@budget, phase),
                          method: :get, class: "button hollow expanded" %>
            </td>
          </tr>
        <% end %>
      </table>
    </div>
  <% end %>

  <div class="small-12 column">
    <%= render "admin/shared/show_results_fields", form: f %>
  </div>

  <div class="small-12 column">
    <div class="clear small-12 medium-4 large-3 inline-block">
      <%= f.submit nil, class: "button success" %>
    </div>

    <div class="float-right">
      <% if display_calculate_winners_button?(@budget) %>
        <%= link_to calculate_winner_button_text(@budget),
                    calculate_winners_admin_budget_path(@budget),
                    method: :put,
                    class: "button hollow" %>
      <% end %>

      <% if @budget.has_winning_investments? %>
        <%= link_to t("budgets.show.see_results"),
                    budget_results_path(@budget),
                    class: "button hollow margin-left" %>
      <% end %>
      <% if @budget.persisted? %>
        <%= link_to t("admin.budgets.edit.delete"),
            admin_budget_path(@budget),
            method: :delete,
            class: "delete float-right margin-left" %>
      <% end %>
    </div>
  </div>
<% end %><commit_msg>Align admin budget form fields with new translations interface<commit_after><%= render "shared/globalize_locales", resource: @budget %>

<%= translatable_form_for [:admin, @budget] do |f| %>

  <div class="js-budget-id" id="<%= @budget.id %>"></div>

  <%= render "shared/errors", resource: @budget %>

  <div class="row">
    <%= f.translatable_fields do |translations_form| %>
      <div class="small-12 medium-9 column end">
        <%= translations_form.text_field :name,
            label: t("activerecord.attributes.budget.name"),
            maxlength: Budget.title_max_length,
            placeholder: t("activerecord.attributes.budget.name") %>
      </div>
    <% end %>
  </div>

  <div class="row margin-top">
    <div class="small-12 medium-6 column">
      <%= f.select :phase, budget_phases_select_options %>
    </div>
    <div class="small-12 medium-3 column end">
      <%= f.select :currency_symbol, budget_currency_symbol_select_options %>
    </div>
  </div>

  <div class="margin-top">
    <div class="small-12 medium-4 column end">
      <a id="administrators_button" class="button expanded hollow js-budget-show-users-list js-budget-show-administrators-list" data-toggle="administrators_list"><%= t("admin.budgets.edit.administrators", count: @budget.administrators.count) %>
      </a>
    </div>
    <div class="small-12 medium-4 column end">
      <a id="valuators_button" class="button expanded hollow js-budget-show-users-list js-budget-show-valuators-list" data-toggle="valuators_list"><%= t("admin.budgets.edit.valuators", count: @budget.valuators.count) %>
      </a>
    </div>
    <div class="small-12 medium-4 column end">
      <a id="trackers_button" class="button expanded hollow js-budget-show-users-list js-budget-show-trackers-list" data-toggle="trackers_list"><%= t("admin.budgets.edit.trackers", count: @budget.trackers.count) %>
      </a>
    </div>
  </div>

  <div class="margin-top">
      <%= render "/admin/budgets/association", assignable_type: "administrators", assignables: @admins, budget: @budget %>
      <%= render "/admin/budgets/association", assignable_type: "valuators", assignables: @valuators, budget: @budget %>
      <%= render "/admin/budgets/association", assignable_type: "trackers", assignables: @trackers, budget: @budget %>
  </div>

  <div class="margin-top">
    <div class="small-12 medium-9 column end">
      <%= f.text_field :budget_milestone_tags, placeholder: t("admin.budget_investments.edit.tags_placeholder") %>
    </div>
    <div class="small-12 medium-9 column end">
      <%= f.text_field :budget_valuation_tags, placeholder: t("admin.budget_investments.edit.tags_placeholder") %>
    </div>
    <div class="small-12 medium-9 column end">
      <%= f.text_field :help_link %>
    </div>
  </div>

  <% if @budget.phases.present? %>
    <div class="row">
      <div class="small-12 column">
        <table id="budget-phases-table" class="table-for-mobile">
          <thead>
            <tr>
              <th><%= t("admin.budgets.edit.phase") %></th>
              <th><%= t("admin.budgets.edit.dates") %></th>
              <th class="text-center"><%= t("admin.budgets.edit.enabled") %></th>
              <th><%= t("admin.budgets.edit.actions") %></th>
            </tr>
          </thead>

          <% @budget.phases.order(:id).each do |phase| %>
            <tr id="<%= dom_id(phase) %>" class="phase">
              <td>
                <%= t("budgets.phase.#{phase.kind}") %>
                <% if @budget.current_phase == phase %>
                  <span class="label success"><strong><%= t("admin.budgets.edit.active") %></strong></span>
                <% end %>
              </td>
              <td>
                <% if phase.starts_at.present? || phase.ends_at.present? %>
                  <%= l(phase.starts_at.to_date) if phase.starts_at.present? %>
                  -
                  <%= l(phase.ends_at.to_date) if phase.ends_at.present? %>
                <% else %>
                  <em><%= t("admin.budgets.edit.blank_dates") %></em>
                <% end %>
              </td>
              <td class="text-center">
                <span class="budget-phase-enabled <%= phase.enabled? ? "enabled" : "disabled" %>"></span>
              </td>
              <td>
                <%= link_to t("admin.budgets.edit.edit_phase"),
                            edit_admin_budget_budget_phase_path(@budget, phase),
                            method: :get, class: "button hollow expanded" %>
              </td>
            </tr>
          <% end %>
        </table>
      </div>
    </div>
  <% end %>

  <div class="row">
    <div class="small-12 column">
      <%= render "admin/shared/show_results_fields", form: f %>
    </div>

    <div class="small-12 column">
      <div class="clear small-12 medium-4 large-3 inline-block">
        <%= f.submit nil, class: "button success" %>
      </div>

      <div class="float-right">
        <% if display_calculate_winners_button?(@budget) %>
          <%= link_to calculate_winner_button_text(@budget),
                      calculate_winners_admin_budget_path(@budget),
                      method: :put,
                      class: "button hollow" %>
        <% end %>

        <% if @budget.has_winning_investments? %>
          <%= link_to t("budgets.show.see_results"),
                      budget_results_path(@budget),
                      class: "button hollow margin-left" %>
        <% end %>
        <% if @budget.persisted? %>
          <%= link_to t("admin.budgets.edit.delete"),
              admin_budget_path(@budget),
              method: :delete,
              class: "delete float-right margin-left" %>
        <% end %>
      </div>
    </div>
  </div>
<% end %>
{'fraction_non_alphanumeric': 0.1734620886981402, 'fraction_numerical': 0.006616595135908441, 'mean_word_length': 2.3965988460370484, 'pattern_counts': {'":': 0, '<': 263, '<?xml version=': 0, '>': 263, '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': '4653946', 'n_tokens_mistral': 3818, 'n_tokens_neox': 3529, 'n_words': 655}