<commit_before>{% extends "base.html" %}
{% block content %}

{% if form.errors %}
<div class="alert alert-danger internel-error">
    <strong>Грешка! </strong>
    {{ form.errors }}
</div>
{% endif %}

<div class="row">
    <div class="col-lg-10">
		<form role="form" method="post" class="project-form" action="">
			{% csrf_token %}
			<fieldset>
			    <legend>Редактиране на проект - {{ form.name.value|default:"" }}</legend>
			</fieldset>

			<div class="control-group">
			    <label class="control-label" for="project-name">Име на проекта</label>
			    <div class="controls">
			        <input id="project-name" name="name" type="text" placeholder="пример - Diaphanum" class="form-control" minlength="{{ form.name.field.min_length }}" maxlength="{{ form.name.field.max_length }}" value="{{ form.name.value|default:"" }}" {% if form.name.field.required %}required{% endif %}>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-team">Екип на проекта</label>
			    <div class="controls">
			    	{% for teamMember in form.instance.team.all %}
			    	<div class="team-member-field">
			    		<input value="{{ teamMember.first_name }} {{ teamMember.last_name }}" class="autocomplete project-team form-control" type="text" placeholder="<NAME>"
			    		 minlength="{{ form.team.field.min_length }}" maxlength="{{ form.team.field.max_length }}" {% if form.team.field.required %}required{% endif %} disabled />
			    		<button type="button" class="btn btn-warning remove-team-member">Премахни от екипа</button>
			    		<input class="team-member-id-container" type="hidden" value="{{ teamMember.id }}" name="team" />
			    	</div>
			    	{% endfor %}
			        <div id="members-error"></div>
			        <div id="add-member-control">
			            <button type="button" class="btn btn-primary" id="add-member-button">Добави човек</button>
			        </div>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-description">Описание на проекта</label>
			    <div class="controls">
			        <textarea id="description" name="description" class="form-control"  minlength="{{ form.description.field.min_length }}" maxlength="{{ form.description.field.max_length }}" value="{{ form.description.value|default:"" }}" {% if form.description.field.required %}required{% endif %}>{{ form.description.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-mission">Цели на проекта</label>
			    <div class="controls">
			        <textarea id="project-mission" name="targets" class="form-control" placeholder="Цели на проекта и предварителна оценка на ефекта"  minlength="{{ form.targets.field.min_length }}" maxlength="{{ form.targets.field.max_length }}" value="{{ form.targets.value|default:"" }}" {% if form.target.field.required %}required{% endif %}>{{ form.targets.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-tasks">Задачи на проекта</label>
			    <div class="controls">
			        <textarea id="project-tasks" name="tasks" class="form-control" placeholder="Задачи на проекта - конкретни дейности, които ще доведат до постигане на целите и търсеният ефект." minlength="{{ form.tasks.field.min_length }}" maxlength="{{ form.tasks.field.max_length }}" value="{{ form.targets.value|default:"" }}" {% if form.tasks.field.required %}required{% endif %}>{{ form.tasks.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-target-audience">Целева група на проекта</label>
			    <div class="controls">
			        <textarea id="project-target-audience" name="target_group" class="form-control" placeholder="Целева група на проекта и за пряко и косвено засегнатите от дейността му лица" minlength="{{ form.target_group.field.min_length }}" maxlength="{{ form.target_group.field.max_length }}" value="{{ form.targets.value|default:"" }}" {% if form.target_group.field.required %}required{% endif %}>{{ form.target_group.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-schedule">График на проекта</label>
			    <div class="controls">
			        <textarea id="project-schedule" name="schedule" class="form-control" placeholder="График на проекта, обвързан с конкретните дейности" minlength="{{ form.schedule.field.min_length }}" maxlength="{{ form.schedule.field.max_length }}" value="{{ form.schedule.value|default:"" }}" {% if form.schedule.field.required %}required{% endif %}>{{ form.schedule.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-resources">Необходими ресурси</label>
			    <div class="controls">
			        <textarea id="project-resources" name="resources" class="form-control" placeholder="Необходими ресурси за - човешки, финансови, информационни и времеви" minlength="{{ form.resources.field.min_length }}" maxlength="{{ form.resources.field.max_length }}" value="{{ form.resources.value|default:"" }}" {% if form.resources.field.required %}required{% endif %}>{{ form.resources.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-finance">Финансово описание на проекта</label>
			    <div class="controls">
			        <textarea id="project-finance" name="finance_description" class="form-control" placeholder="Говори ми за пар" minlength="{{ form.finance_description.field.min_length }}" maxlength="{{ form.finance_description.field.max_length }}" value="{{ form.finance_description.value|default:"" }}" {% if form.finance_description.field.required %}required{% endif %}>{{ form.finance_description.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-partners">Партньори и Съфинансиране (ако има)</label>
			    <div class="controls">
			        <textarea id="project-partners" name="partners" class="form-control" placeholder="Партньори на проекта и съфинансиране" minlength="{{ form.partners.field.min_length }}" maxlength="{{ form.partners.field.max_length }}" value="{{ form.partners.value|default:"" }}" {% if form.partners.field.required %}required{% endif %}>{{ form.partners.value|default:"" }}</textarea>
			    </div>
			</div>

			<!-- File Button -->
			{# <div class="control-group"> #}
			{#     <label class="control-label" for="filebutton">File Button</label> #}
			{#     <div class="controls"> #}
			{#         <div> #}
			{#             <input name="files" class="input-file" type="file"> #}
			{#             <div id="add-one-more-button-container"> #}
			{#                 <button id="add-one-more-file" name="add-one-more-file" class="btn btn-info" type="button">Добави още 1 файл</button> #}
			{#             </div> #}
			{#         </div> #}
			{#     </div> #}

			    <div class="control-group">
			        <label class="control-label" for="project-form-submit"></label>
			        <div class="controls">
			            <button id="project-form-submit" name="project-form-submit" class="btn btn-primary">Подай Формуляр</button>
			        </div>
			    </div>


		</form>
	</div>
</div>

{% endblock %}

{% block footer_scripts %}
  <script src="http://underscorejs.org/underscore.js"></script>
  <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc2/js/bootstrap.min.js"></script>
  <script src="{{ STATIC_URL }}js/jquery.validate.js"> </script>
  <script src="{{ STATIC_URL }}js/appConfig.js"></script>
  <script src="{{ STATIC_URL }}js/projectForm.js"></script>
  <script src="{{ STATIC_URL }}js/textAreaCounter.js"></script>
  <script src="{{ STATIC_URL }}js/typeahead.js"></script>
  <script src="{{ STATIC_URL }}js/typeAheadFactory.js"></script>
  <script>
  	// styles, specific for the edit page
  	$(function() {
  		$("button.remove-team-member")
  			.css("margin-bottom", "15px");
  	});
  </script>

  <script type="text/template" id="new-team-member-template">
    <div class="team-member-field">
      <input class="project-team autocomplete" type="text" placeholder="<NAME>" minlength="{{ form.team.field.min_length }}" maxlength="{{ form.team.field.max_length }}" />
      <button type="button" class="btn remove-team-member">Премахни от екипа</button>
      <input class="team-member-id-container" type="hidden" value="-1" name="team" />
    </div>
  </script>
{% endblock %}<commit_msg>Adding text counter to the project edit form<commit_after>{% extends "base.html" %}
{% block content %}

{% if form.errors %}
<div class="alert alert-danger internel-error">
    <strong>Грешка! </strong>
    {{ form.errors }}
</div>
{% endif %}

<div class="row">
    <div class="col-lg-10">
		<form role="form" method="post" class="project-form" action="">
			{% csrf_token %}
			<fieldset>
			    <legend>Редактиране на проект - {{ form.name.value|default:"" }}</legend>
			</fieldset>

			<div class="control-group">
			    <label class="control-label" for="project-name">Име на проекта</label>
			    <div class="controls">
			        <input id="project-name" name="name" type="text" placeholder="пример - Diaphanum" class="form-control" minlength="{{ form.name.field.min_length }}" maxlength="{{ form.name.field.max_length }}" value="{{ form.name.value|default:"" }}" {% if form.name.field.required %}required{% endif %}>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-team">Екип на проекта</label>
			    <div class="controls">
			    	{% for teamMember in form.instance.team.all %}
			    	<div class="team-member-field">
			    		<input value="{{ teamMember.first_name }} {{ teamMember.last_name }}" class="autocomplete project-team form-control" type="text" placeholder="<NAME>"
			    		 minlength="{{ form.team.field.min_length }}" maxlength="{{ form.team.field.max_length }}" {% if form.team.field.required %}required{% endif %} disabled />
			    		<button type="button" class="btn btn-warning remove-team-member">Премахни от екипа</button>
			    		<input class="team-member-id-container" type="hidden" value="{{ teamMember.id }}" name="team" />
			    	</div>
			    	{% endfor %}
			        <div id="members-error"></div>
			        <div id="add-member-control">
			            <button type="button" class="btn btn-primary" id="add-member-button">Добави човек</button>
			        </div>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-description">Описание на проекта</label>
			    <div class="controls">
			        <textarea id="description" name="description" class="form-control"  minlength="{{ form.description.field.min_length }}" maxlength="{{ form.description.field.max_length }}" value="{{ form.description.value|default:"" }}" {% if form.description.field.required %}required{% endif %}>{{ form.description.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-mission">Цели на проекта</label>
			    <div class="controls">
			        <textarea id="project-mission" name="targets" class="form-control" placeholder="Цели на проекта и предварителна оценка на ефекта"  minlength="{{ form.targets.field.min_length }}" maxlength="{{ form.targets.field.max_length }}" value="{{ form.targets.value|default:"" }}" {% if form.target.field.required %}required{% endif %}>{{ form.targets.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-tasks">Задачи на проекта</label>
			    <div class="controls">
			        <textarea id="project-tasks" name="tasks" class="form-control" placeholder="Задачи на проекта - конкретни дейности, които ще доведат до постигане на целите и търсеният ефект." minlength="{{ form.tasks.field.min_length }}" maxlength="{{ form.tasks.field.max_length }}" value="{{ form.targets.value|default:"" }}" {% if form.tasks.field.required %}required{% endif %}>{{ form.tasks.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-target-audience">Целева група на проекта</label>
			    <div class="controls">
			        <textarea id="project-target-audience" name="target_group" class="form-control" placeholder="Целева група на проекта и за пряко и косвено засегнатите от дейността му лица" minlength="{{ form.target_group.field.min_length }}" maxlength="{{ form.target_group.field.max_length }}" value="{{ form.targets.value|default:"" }}" {% if form.target_group.field.required %}required{% endif %}>{{ form.target_group.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-schedule">График на проекта</label>
			    <div class="controls">
			        <textarea id="project-schedule" name="schedule" class="form-control" placeholder="График на проекта, обвързан с конкретните дейности" minlength="{{ form.schedule.field.min_length }}" maxlength="{{ form.schedule.field.max_length }}" value="{{ form.schedule.value|default:"" }}" {% if form.schedule.field.required %}required{% endif %}>{{ form.schedule.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-resources">Необходими ресурси</label>
			    <div class="controls">
			        <textarea id="project-resources" name="resources" class="form-control" placeholder="Необходими ресурси за - човешки, финансови, информационни и времеви" minlength="{{ form.resources.field.min_length }}" maxlength="{{ form.resources.field.max_length }}" value="{{ form.resources.value|default:"" }}" {% if form.resources.field.required %}required{% endif %}>{{ form.resources.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-finance">Финансово описание на проекта</label>
			    <div class="controls">
			        <textarea id="project-finance" name="finance_description" class="form-control" placeholder="Говори ми за пар" minlength="{{ form.finance_description.field.min_length }}" maxlength="{{ form.finance_description.field.max_length }}" value="{{ form.finance_description.value|default:"" }}" {% if form.finance_description.field.required %}required{% endif %}>{{ form.finance_description.value|default:"" }}</textarea>
			    </div>
			</div>

			<div class="control-group">
			    <label class="control-label" for="project-partners">Партньори и Съфинансиране (ако има)</label>
			    <div class="controls">
			        <textarea id="project-partners" name="partners" class="form-control" placeholder="Партньори на проекта и съфинансиране" minlength="{{ form.partners.field.min_length }}" maxlength="{{ form.partners.field.max_length }}" value="{{ form.partners.value|default:"" }}" {% if form.partners.field.required %}required{% endif %}>{{ form.partners.value|default:"" }}</textarea>
			    </div>
			</div>

			<!-- File Button -->
			{# <div class="control-group"> #}
			{#     <label class="control-label" for="filebutton">File Button</label> #}
			{#     <div class="controls"> #}
			{#         <div> #}
			{#             <input name="files" class="input-file" type="file"> #}
			{#             <div id="add-one-more-button-container"> #}
			{#                 <button id="add-one-more-file" name="add-one-more-file" class="btn btn-info" type="button">Добави още 1 файл</button> #}
			{#             </div> #}
			{#         </div> #}
			{#     </div> #}

			    <div class="control-group">
			        <label class="control-label" for="project-form-submit"></label>
			        <div class="controls">
			            <button id="project-form-submit" name="project-form-submit" class="btn btn-primary">Подай Формуляр</button>
			        </div>
			    </div>


		</form>
	</div>
</div>

{% endblock %}

{% block footer_scripts %}
  <script src="http://underscorejs.org/underscore.js"></script>
  <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0-rc2/js/bootstrap.min.js"></script>
  <script src="{{ STATIC_URL }}js/jquery.validate.js"> </script>
  <script src="{{ STATIC_URL }}js/appConfig.js"></script>
  <script src="{{ STATIC_URL }}js/projectForm.js"></script>
  <script src="{{ STATIC_URL }}js/textAreaCounter.js"></script>
  <script src="{{ STATIC_URL }}js/typeahead.js"></script>
  <script src="{{ STATIC_URL }}js/typeAheadFactory.js"></script>
  <script>
  	// styles, specific for the edit page
  	$(function() {
  		$("button.remove-team-member")
  			.css("margin-bottom", "15px");
  	});
  </script>

  <script type="text/template" id="new-team-member-template">
    <div class="team-member-field">
      <input class="project-team autocomplete" type="text" placeholder="<NAME>" minlength="{{ form.team.field.min_length }}" maxlength="{{ form.team.field.max_length }}" />
      <button type="button" class="btn remove-team-member">Премахни от екипа</button>
      <input class="team-member-id-container" type="hidden" value="-1" name="team" />
    </div>
  </script>

  <script type="text/template" id="text-counter-template">
    <p class="textCounter">
      <span class="currentChars"></span> от <span class="minChars"></span> минимални.
    </p>
  </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.19007746639325587, 'fraction_numerical': 0.001139211665527455, 'mean_word_length': 3.8607419712070876, 'pattern_counts': {'":': 0, '<': 315, '<?xml version=': 0, '>': 315, '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': '509246', 'n_tokens_mistral': 6219, 'n_tokens_neox': 5643, 'n_words': 1062}