<commit_before><h2> Edit <%= @resource.label %> Resource </h2>


<%= form_for @resource ,
        url: update_customization_resource_path(customization_id: @customization_id, 
                  id: @resource.id, 
                  template_id: @template_id, 
                  resource_level: @resource_level,
                  tab_number: @tab_number,
                  requirement_id: @requirement_id,
                  custom_origin: @custom_origin),  
        html: { :class => 'form-horizontal' } do |f| %>

  <%= render partial: "shared/errors", locals: {model: @resource } %>

  <fieldset>
    <div class="control-group">
      <%= f.label :resource_type, "Resource Type", :class => "control-label" %>
      <div class="controls">
        
        <% if  @resource_level=="requirement" %>
          <%= f.select :resource_type,
              options_for_select([:actionable_url, :help_text, :example_response, :suggested_response], 
                selected: @resource.resource_type) %>
        <% else %>
          <%= f.select :resource_type,
              options_for_select([:actionable_url, :help_text], 
                selected: @resource.resource_type) %>
        <% end %>    
        
      </div>
    </div>

    <div class="control-group">
      <%= f.label :label_label, "Label", :class => "control-label", id: "label_label" %>
      <div class="controls">
        <%= f.text_field :label, placeholder: "Enter a name for this Resource", :class => "input-xlarge" %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :text, "Text", :class => "control-label", id: "text" %>
      <div class="controls">
        <%= f.text_area :text, size: "20x10",placeholder: "Enter the text", :class => "input-xlarge" %>
      </div>
    </div>
    

    <div class="control-group">
       <%= f.label :value_label, "Value", :class => "control-label", id: "value_label" %>
      <div class="controls">
        <%= f.text_field :value, placeholder: "URL", :class => "input-xlarge" %>
      </div>
    </div>

    <div class="actions pull-left">
        <%= link_to '<< Back', :back,
                #template_id: @template_id,
                #customization_overview_id: @customization_id,
                :class => "btn" %>
    </div>

    <div class="actions pull-right">

      <%= button_tag 'Undo Changes', type: :reset, :class => "btn" %>

      <%= f.submit 'Save Changes', :class => "btn" %>
      

      <%= link_to 'Delete Resource', delete_resource_path(resource_id: @resource.id, 
                                      customization_overview_id: @customization_id,
                                      custom_origin: @custom_origin,
                                      requirement_id: @requirement_id,
                                      tab_number: @tab_number,
                                      tab: @tab), 
                                      :method => :delete,
                                    data: { confirm: 'Are you sure? This resource will be deleted from all templates!' }, 
                                    :class => "btn" %>
    </div>
  </fieldset>
<% end %>
<commit_msg>fix another tab related bug<commit_after><h2> Edit <%= @resource.label %> Resource </h2>


<%= form_for @resource ,
        url: update_customization_resource_path(customization_id: @customization_id, 
                  id: @resource.id, 
                  template_id: @template_id, 
                  resource_level: @resource_level,
                  tab_number: @tab_number,
                  requirement_id: @requirement_id,
                  custom_origin: @custom_origin),  
        html: { :class => 'form-horizontal' } do |f| %>

  <%= render partial: "shared/errors", locals: {model: @resource } %>

  <fieldset>
    <div class="control-group">
      <%= f.label :resource_type, "Resource Type", :class => "control-label" %>
      <div class="controls">
        
        <% if  @resource_level=="requirement" %>
          <%= f.select :resource_type,
              options_for_select([:actionable_url, :help_text, :example_response, :suggested_response], 
                selected: @resource.resource_type) %>
        <% else %>
          <%= f.select :resource_type,
              options_for_select([:actionable_url, :help_text], 
                selected: @resource.resource_type) %>
        <% end %>    
        
      </div>
    </div>

    <div class="control-group">
      <%= f.label :label_label, "Label", :class => "control-label", id: "label_label" %>
      <div class="controls">
        <%= f.text_field :label, placeholder: "Enter a name for this Resource", :class => "input-xlarge" %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :text, "Text", :class => "control-label", id: "text" %>
      <div class="controls">
        <%= f.text_area :text, size: "20x10",placeholder: "Enter the text", :class => "input-xlarge" %>
      </div>
    </div>
    

    <div class="control-group">
       <%= f.label :value_label, "Value", :class => "control-label", id: "value_label" %>
      <div class="controls">
        <%= f.text_field :value, placeholder: "URL", :class => "input-xlarge" %>
      </div>
    </div>

    <div class="actions pull-left">
        <%= link_to '<< Back', request.env["HTTP_REFERER"] + '#' + @tab_number, :class => "btn" %>
    </div>

    <div class="actions pull-right">

      <%= button_tag 'Undo Changes', type: :reset, :class => "btn" %>

      <%= f.submit 'Save Changes', :class => "btn" %>
      

      <%= link_to 'Delete Resource', delete_resource_path(resource_id: @resource.id, 
                                      customization_overview_id: @customization_id,
                                      custom_origin: @custom_origin,
                                      requirement_id: @requirement_id,
                                      tab_number: @tab_number,
                                      tab: @tab), 
                                      :method => :delete,
                                    data: { confirm: 'Are you sure? This resource will be deleted from all templates!' }, 
                                    :class => "btn" %>
    </div>
  </fieldset>
<% end %>

{'fraction_non_alphanumeric': 0.15087662859900272, 'fraction_numerical': 0.0019301914106482226, 'mean_word_length': 1.8707294552169897, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2765063', 'n_tokens_mistral': 1927, 'n_tokens_neox': 1766, 'n_words': 385}