<commit_before>{% load i18n %} 
{% load manager_extras %}

<script>
$(document).ready(function() {

	// Call the setup function to allow the sets to be sortable again after loading this
	// view via AJAX
	// Editing of set
	$(".ajax-form-cancel").click(function(e) {
	    e.preventDefault();
    	$("#div-day-" + {{set.exerciseday.id}}).load("/workout/day/view/" + {{set.exerciseday.id}});
    	alert(1);
    	
    	setup_ajax_set_edit();
 	})
 	
 	// Send the Form
 	$('.ajax-form-set-edit').submit(function(e) {
	  e.preventDefault();
	  
	  url = "/workout/api/edit-set?do=edit_set&set=" + {{set.id}} + "&exercise=" + {{exercise.id}}
	  form_data = $(this).serialize();
	  $.post( url, form_data);
	  
	  $("#div-day-" + {{set.exerciseday.id}}).load("/workout/day/view/" + {{set.exerciseday.id}});
    	//alert(1);
    	
	  setup_ajax_set_edit();
	});
 	
 	// Init the autocompleter
    $(".ajax-form-exercise-list").autocomplete({
            source: "{% url exercises.views.exercise_search %}",
            minLength: 2,
            select: function(event, ui) {

                // After clicking on a result set the value of the hidden field
                $('#set-{{set.id}}-exercercise-id-hidden').val(ui.item.id);
            }
        });
})
</script>

<form action="{% url manager.views.api_edit_set %}?do=edit_set&amp;set={{set.id}}&amp;exercise={{exercise.id}}"
      method="post"
      class="ajax-form-set-edit">
    {% csrf_token %}
    
    <span class="ui-widget">
		<input type="hidden"
			   name="exercises"
			   value="{{exercise.id}}"
			   id="set-{{set.id}}-exercercise-id-hidden">
    	<input type="text"
    		   name="exercise_name"
    		   value="{{exercise.name}}"
    		   class="ajax-form-exercise-list"
    		   id="set-{{set.id}}-exercercise-id">:
    </span>
    
    <input type="text" name="sets" value="{{ set.sets }}" maxlength="2" style="width: 2em;">
    x
    
    
    {% for setting in exercise|get_current_settings:set.id %}
    	<input type="text" name="setting-{{setting.id}}" value="{{ setting.reps }}" maxlength="2" style="width: 2em;">
    	{% if not forloop.last %} – {% endif %}
	{% endfor %}
	
	{% for setting in new_settings %}
    	<input type="text" name="new-setting-{{setting}}" value="" maxlength="2" style="width: 2em;">
    	{% if not forloop.last %} – {% endif %}
	{% endfor %}
	
    
	<input type="submit"
	 	   value="{% trans 'Save' %}"
	 	   class="ajax-form-submit" />
	<input type="submit"
   		  value="{% trans "Cancel" %}"
   		  class="ajax-form-cancel" />
</form><commit_msg>Remove the dash between the inputs<commit_after>{% load i18n %} 
{% load manager_extras %}

<script>
$(document).ready(function() {

	// Call the setup function to allow the sets to be sortable again after loading this
	// view via AJAX
	// Editing of set
	$(".ajax-form-cancel").click(function(e) {
	    e.preventDefault();
    	$("#div-day-" + {{set.exerciseday.id}}).load("/workout/day/view/" + {{set.exerciseday.id}});
    	alert(1);
    	
    	setup_ajax_set_edit();
 	})
 	
 	// Send the Form
 	$('.ajax-form-set-edit').submit(function(e) {
	  e.preventDefault();
	  
	  url = "/workout/api/edit-set?do=edit_set&set=" + {{set.id}} + "&exercise=" + {{exercise.id}}
	  form_data = $(this).serialize();
	  $.post( url, form_data);
	  
	  $("#div-day-" + {{set.exerciseday.id}}).load("/workout/day/view/" + {{set.exerciseday.id}});
    	//alert(1);
    	
	  setup_ajax_set_edit();
	});
 	
 	// Init the autocompleter
    $(".ajax-form-exercise-list").autocomplete({
            source: "{% url exercises.views.exercise_search %}",
            minLength: 2,
            select: function(event, ui) {

                // After clicking on a result set the value of the hidden field
                $('#set-{{set.id}}-exercercise-id-hidden').val(ui.item.id);
            }
        });
})
</script>

<form action="{% url manager.views.api_edit_set %}?do=edit_set&amp;set={{set.id}}&amp;exercise={{exercise.id}}"
      method="post"
      class="ajax-form-set-edit">
    {% csrf_token %}
    
    <span class="ui-widget">
		<input type="hidden"
			   name="exercises"
			   value="{{exercise.id}}"
			   id="set-{{set.id}}-exercercise-id-hidden">
    	<input type="text"
    		   name="exercise_name"
    		   value="{{exercise.name}}"
    		   class="ajax-form-exercise-list"
    		   id="set-{{set.id}}-exercercise-id">:
    </span>
    
    <input type="text" name="sets" value="{{ set.sets }}" maxlength="2" style="width: 2em;">
    x
    
    
    {% for setting in exercise|get_current_settings:set.id %}
    	<input type="text" name="setting-{{setting.id}}" value="{{ setting.reps }}" maxlength="2" style="width: 2em;">
	{% endfor %}
	
	{% for setting in new_settings %}
    	<input type="text" name="new-setting-{{setting}}" value="" maxlength="2" style="width: 2em;">
	{% endfor %}
	
    
	<input type="submit"
	 	   value="{% trans 'Save' %}"
	 	   class="ajax-form-submit" />
	<input type="submit"
   		  value="{% trans "Cancel" %}"
   		  class="ajax-form-cancel" />
</form>
{'fraction_non_alphanumeric': 0.20488385944014295, 'fraction_numerical': 0.004367679174111574, 'mean_word_length': 2.7766116941529235, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '399021', 'n_tokens_mistral': 1929, 'n_tokens_neox': 1764, 'n_words': 314}