<commit_before>{% extends "base.html" %}
{% load i18n %}
{% load devicetags %}
{% block title %}{{actionstring}} {% if object != None %}{{object}}{% else %}Object{% endif %}{% endblock %}

{% block header %}{{actionstring}} {% if object != None %}{{object}}{% else %}Object{% endif %}{% endblock %}
{% block content %}
<div class="row">
  <div class="col-xs-12 col-md-6 col-md-offset-3 well well-lg">
<form action="" method="post" class="form-horizontal">{% csrf_token %}
{% for field in form %}
{% if field.html_name == "creator" %}
{{ field }}
{% elif field|is_checkbox %}
<div class="form-group">
    <div class="col-lg-offset-4 col-lg-8">
      <div class="checkbox">
        <label>
          {{field}} {{field.label}}
        </label>
      </div>
    </div>
  </div>
{% else %}
{% if field.html_name == "room" %}</div>{% endif %}
<div class="form-group {{field.css_classes}}">
    <label for="{{field.html_name}}" class="col-lg-4 control-label">{{ field.label }}{% if field.field.required %}*{% endif %}</label>
    <div class="col-lg-{% if field|is_select %}7{% else %}8{% endif %}">
      {% if field|is_select %}{{field}}{% else %}{{ field|add_class:'form-control'}}{% endif %}
      <p class="help-block">{% if field.errors %}{% for error in field.errors %}{{error}}, {% endfor %}{% endif %}</p>
    </div>
    {% if field|is_select %}<div class="col-lg-1"><a href="#" class="modalbutton" data-classname="{{field.html_name}}" data-name="{{field.label}}"><i class="icon-plus"></i></a></div>{% endif %}
  </div>
{% endif %}



{% if field.html_name == "devicetype" %}<div id="extra_attributes">{% endif %}

{% endfor %}
<input type="submit" value="{% trans "Submit" %}" class="btn btn-success btn-sm pull-right" />
</form>

</div>
</div>

  <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">{% trans "Create new <span id='modal_header'></span>" %}</h4>
        </div>
            <form action="" method="post" id="addform" accept-charset="utf-8" class="form-horizontal">
        <div class="modal-body">
          <div id="modal-form"></div>
    <input type="hidden" name="classname" id="modal_classname">
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Cancel" %}</button>
          <input type="submit" value="{% trans "Submit" %}" class="btn btn-success btn-sm">
        </div>
        </form>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
{% endblock %}

{% block scriptend %}
$( "input:text[name=name]" ).autocomplete({
      minLength: 2,
      source: function( request, response ) {
        var term = request.term;
        Dajaxice.devices.complete_devicenames(response, {'name':term});
      }
    });
$("#id_devicetype").change(function() {
        Dajaxice.devicetypes.get_attributes(Dajax.process, {'pk':$(this).val()});
});

$(".modalbutton").click(function() {
    $("#modal_name").val("");
    $("#modal_header").text($(this).data("name"))
    $("#modal_classname").val($(this).data("classname"));
    Dajaxice.devices.load_extraform(Dajax.process, {'classname':$(this).data("classname")})
});

$("select").select2();

$("#addform").submit(function() {
    Dajaxice.devices.add_device_field(Dajax.process,{'form':$(this).serialize(true)});
    return false;
});

changelist = []

initialdata = {
{% for field in form %}
  "{{ field.html_name }}": $("#{{ field.auto_id }}").val(),
{% endfor %}
}

commentstring = ""

    $('body').on('change', 'input, select', function() {
        if (!($(this).attr("id") == "id_emailbosses" ||
          $(this).attr("id") == "id_emailtemplatebosses" ||
          $(this).attr("id") == "id_emailmanagment" ||
          $(this).attr("id") == "id_emailtemplatemanagment" ||
          $(this).attr("id") == "id_comment")) {
          if ($(this).val() != initialdata[$(this).attr("name")]) {
            if (changelist.indexOf($(this).attr("name")) == -1) {
              changelist.push($(this).attr("name"))
            }
          } else {
              changelist.splice(changelist.indexOf($(this).attr("name")), 1)
        }
        if($("#id_comment").val() == commentstring) {
          commentstring = "Updated: " + changelist.join(", ")
          $("#id_comment").val(commentstring)
        }
      }
        console.log($("#id_comment").val())
    });

{% endblock %}<commit_msg>changing description wasn't added to revision comment<commit_after>{% extends "base.html" %}
{% load i18n %}
{% load devicetags %}
{% block title %}{{actionstring}} {% if object != None %}{{object}}{% else %}Object{% endif %}{% endblock %}

{% block header %}{{actionstring}} {% if object != None %}{{object}}{% else %}Object{% endif %}{% endblock %}
{% block content %}
<div class="row">
  <div class="col-xs-12 col-md-6 col-md-offset-3 well well-lg">
<form action="" method="post" class="form-horizontal">{% csrf_token %}
{% for field in form %}
{% if field.html_name == "creator" %}
{{ field }}
{% elif field|is_checkbox %}
<div class="form-group">
    <div class="col-lg-offset-4 col-lg-8">
      <div class="checkbox">
        <label>
          {{field}} {{field.label}}
        </label>
      </div>
    </div>
  </div>
{% else %}
{% if field.html_name == "room" %}</div>{% endif %}
<div class="form-group {{field.css_classes}}">
    <label for="{{field.html_name}}" class="col-lg-4 control-label">{{ field.label }}{% if field.field.required %}*{% endif %}</label>
    <div class="col-lg-{% if field|is_select %}7{% else %}8{% endif %}">
      {% if field|is_select %}{{field}}{% else %}{{ field|add_class:'form-control'}}{% endif %}
      <p class="help-block">{% if field.errors %}{% for error in field.errors %}{{error}}, {% endfor %}{% endif %}</p>
    </div>
    {% if field|is_select %}<div class="col-lg-1"><a href="#" class="modalbutton" data-classname="{{field.html_name}}" data-name="{{field.label}}"><i class="icon-plus"></i></a></div>{% endif %}
  </div>
{% endif %}



{% if field.html_name == "devicetype" %}<div id="extra_attributes">{% endif %}

{% endfor %}
<input type="submit" value="{% trans "Submit" %}" class="btn btn-success btn-sm pull-right" />
</form>

</div>
</div>

  <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="addModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">{% trans "Create new <span id='modal_header'></span>" %}</h4>
        </div>
            <form action="" method="post" id="addform" accept-charset="utf-8" class="form-horizontal">
        <div class="modal-body">
          <div id="modal-form"></div>
    <input type="hidden" name="classname" id="modal_classname">
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Cancel" %}</button>
          <input type="submit" value="{% trans "Submit" %}" class="btn btn-success btn-sm">
        </div>
        </form>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->
{% endblock %}

{% block scriptend %}
$( "input:text[name=name]" ).autocomplete({
      minLength: 2,
      source: function( request, response ) {
        var term = request.term;
        Dajaxice.devices.complete_devicenames(response, {'name':term});
      }
    });
$("#id_devicetype").change(function() {
        Dajaxice.devicetypes.get_attributes(Dajax.process, {'pk':$(this).val()});
});

$(".modalbutton").click(function() {
    $("#modal_name").val("");
    $("#modal_header").text($(this).data("name"))
    $("#modal_classname").val($(this).data("classname"));
    Dajaxice.devices.load_extraform(Dajax.process, {'classname':$(this).data("classname")})
});

$("select").select2();

$("#addform").submit(function() {
    Dajaxice.devices.add_device_field(Dajax.process,{'form':$(this).serialize(true)});
    return false;
});

changelist = []

initialdata = {
{% for field in form %}
  "{{ field.html_name }}": $("#{{ field.auto_id }}").val(),
{% endfor %}
}

commentstring = ""

    $('body').on('change', 'input, select, textarea', function() {
        if (!($(this).attr("id") == "id_emailbosses" ||
          $(this).attr("id") == "id_emailtemplatebosses" ||
          $(this).attr("id") == "id_emailmanagment" ||
          $(this).attr("id") == "id_emailtemplatemanagment" ||
          $(this).attr("id") == "id_comment")) {
          if ($(this).val() != initialdata[$(this).attr("name")]) {
            if (changelist.indexOf($(this).attr("name")) == -1) {
              changelist.push($(this).attr("name"))
            }
          } else {
              changelist.splice(changelist.indexOf($(this).attr("name")), 1)
        }
        if($("#id_comment").val() == commentstring) {
          commentstring = "Updated: " + changelist.join(", ")
          $("#id_comment").val(commentstring)
        }
      }
        console.log($("#id_comment").val())
    });

{% endblock %}
{'fraction_non_alphanumeric': 0.23923647932131495, 'fraction_numerical': 0.0042417815482502655, 'mean_word_length': 3.415262172284644, 'pattern_counts': {'":': 2, '<': 123, '<?xml version=': 0, '>': 123, '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': '4804613', 'n_tokens_mistral': 3256, 'n_tokens_neox': 3086, 'n_words': 581}