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

{% block title %}{{ _('Pontoon &middot; %(subtitle)s')|format(subtitle=subtitle) }}{% endblock %}

{% block class %}admin-form{% endblock %}

{% block content %}
<!-- Server data -->
<div id="server"
     class="hidden"
     {% if csrf_token %}data-csrf="{{ csrf_token }}"{% endif %}>
</div>

<section id="intro" class="visible">

  <nav>
    <ul class="links">
      <li><a href="{{ url('pontoon.home') }}" title="{{ _('Pontoon Home') }}">Home</a></li>
      <li><a href="{{ url('pontoon.admin') }}" title="{{ _('Pontoon Admin') }}">Admin</a></li>
    </ul>
  </nav>
  <form method="POST" action="{{ request.path }}" class="{% if pk %}edit{% else %}add{% endif %}">

    <h1 id="title">{{ _('%(subtitle)s')|format(subtitle=subtitle) }}</h1>
    <ul class="notification{% if not messages %} hidden{% endif %}">
        {% for message in messages %}
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
        {% endfor %}
    </ul>
    <input type="hidden" value="{{ csrf_token }}" name="csrfmiddlewaretoken">
    {% if pk %}
      <input type="hidden" value="{{ pk }}" name="pk">
      {{ form.format.as_hidden() }}
    {% endif %}

    <div>
        {{ form.name.label_tag() }}
        {{ form.name }}
        {{ form.name.errors }}
    </div>
    <div class="locales clearfix">
        <div class="locale select">
          <label for="available">Available locales<a class="choose-all" href="#choose-all">Choose all &rarr;</a></label>
          <div class="menu">
            <input id="available" type="text" class="search" autocomplete="off">
            <div class="horizontal-separator"></div>
            <ul>
              {% for locale in locales_available %}
              <li data-id="{{ locale.id }}"><span class="language {{ locale.code }}">{{ locale.name }}<span class="code">{{ locale.code }}</span></span></li>
              {% endfor %}
              <li class="no-match">{{ _('No results match') }} "<span></span>"</li>
            </ul>
          </div>
        </div>
        <div class="locale select selected">
          <label for="selected">Chosen locales<a class="remove-all" href="#remove-all">&larr; Remove all</a></label>
          <div class="menu">
            <input id="selected" type="text" class="search" autocomplete="off">
            <div class="horizontal-separator"></div>
            <ul>
              {% for locale in locales_selected %}
              <li data-id="{{ locale.id }}"><span class="language {{ locale.code }}">{{ locale.name }}<span class="code">{{ locale.code }}</span></span></li>
              {% endfor %}
              <li class="no-match">{{ _('No results match') }} "<span></span>"</li>
            </ul>
          </div>
        </div>
        {{ form.locales }}
        {{ form.locales.errors }}
    </div>

    <h2>Repository</h2>

    <div class="repository clearfix">
        <section class="type-wrapper">
            {{ form.repository_type.label_tag() }}
            <div class="type select">
              <div class="hidden">
                {{ form.repository_type }}
              </div>
              <div class="button selector">
                <span class="title"></span>
                <span> &#9662;</span>
              </div>
              <ul class="menu">
                {% for choice in REPOSITORY_TYPE_CHOICES %}
                    <li data-type="{{ choice[0] }}">{{ choice[1] }}</li>
                {% endfor %}
              </ul>
            </div>
            <p class="authentication-title">Please sign in</p>
        </section>
        <section class="details-wrapper" data-repository-type="{{ form.repository_type.value()|lower }}">
            <div class="repo">
                {{ form.repository.label_tag() }}
                {{ form.repository }}
                {% if pk %}
                <button title="{{ _('Update all locales from repository') }}" data-source="repository" class="button update">
                    <img class="update" src="{{ static('img/update.png') }}" alt="{{ _('Update all locales from repository') }}" />
                </button>
                {% endif %}
            </div>
            <div class="transifex clearfix">
                {{ form.transifex_project.label_tag() }}
                {{ form.transifex_resource.label_tag() }}
                {{ form.transifex_project }}
                {{ form.transifex_resource }}
                {% if pk %}
                <button title="{{ _('Update all locales from Transifex') }}" data-source="transifex" class="button update">
                    <img class="update" src="{{ static('img/update.png') }}" alt="{{ _('Update all locales from Transifex') }}" />
                </button>
                <section class="authentication-form">
                    <label for="id_transifex_username">Username or email</label>
                    <label for="id_transifex_password">Password</label>
                    <input id="id_transifex_username" name="transifex_username" type="text" />
                    <input id="id_transifex_password" name="transifex_password" type="password" />
                </section>
                <div class="bottom">
                    <label class="remember">
                        <input name="remember" type="checkbox" />{{ _('Remember me') }}
                    </label>
                    <a class="new" target="_blank" href="http://www.transifex.com/signup/">{{ _('New to Transifex?') }}</a>
                </div>
                {% endif %}
            </div>
        </section>
        {{ form.repository.errors }}
        {{ form.transifex_project.errors }}
        {{ form.transifex_resource.errors }}
    </div>

    <h2>Website</h2>

    <div>
        {{ form.url.label_tag() }}
        {{ form.url }}
        {{ form.url.errors }}
    </div>
    <div class="checkbox clearfix">
        <label for="id_external">
            {{ form.external }}{{ form.external.label }}
        </label>
    </div>
    <div class="checkbox clearfix">
        <label for="id_links">
            {{ form.links }}{{ form.links.label }}
        </label>
    </div>

    <h2>Subpages
        <span class="small">(optional)</span>
        <a href="#add-subpage" class="add-subpage">Add more</a>
    </h2>

    {{ formset.management_form }}
    {% for form in formset %}
        {{ form.id }}
    <div class="subpages clearfix">
        {{ form.name.label_tag() }}
        {{ form.url.label_tag() }}
        {{ form.name }}
        {{ form.url }}
        <button title="{{ _('Delete subpage') }}" class="button delete-subpage" tabindex="-1">
            <img src="{{ static('img/cancel.png') }}" alt="{{ _('Delete subpage') }}" />
        </button>
        {{ form.DELETE }}
        {{ form.name.errors }}
        {{ form.url.errors }}
    </div>
    {% endfor %}
    <div class="subpages clearfix" data-count="{{ formset.total_form_count() }}">
        {{ formset.empty_form.name.label_tag() }}
        {{ formset.empty_form.url.label_tag() }}
        {{ formset.empty_form.name }}
        {{ formset.empty_form.url }}
        <button title="{{ _('Delete subpage') }}" class="button delete-subpage" tabindex="-1">
            <img src="{{ static('img/cancel.png') }}" alt="{{ _('Delete subpage') }}" />
        </button>
        {{ formset.empty_form.DELETE }}
        {{ formset.empty_form.name.errors }}
        {{ formset.empty_form.url.errors }}
    </div>

    <h2>General info <span class="small">(optional)</span></h2>

    <div>
        {{ form.info_brief.label_tag() }}
        {{ form.info_brief }}
        {{ form.info_brief.errors }}
    </div>
    <div>
        {{ form.info_locales.label_tag() }}
        {{ form.info_locales }}
        {{ form.info_locales.errors }}
    </div>
    <div>
        {{ form.info_audience.label_tag() }}
        {{ form.info_audience }}
        {{ form.info_audience.errors }}
    </div>
    <div>
        {{ form.info_metrics.label_tag() }}
        {{ form.info_metrics }}
        {{ form.info_metrics.errors }}
    </div>

    <div class="controls clearfix">
        {% if pk %}<button class="button delete-project">Delete project</button>{% endif %}
        <button class="button">Save project</button>
        <a href="{{ url('pontoon.admin') }}" class="cancel">Cancel</a>
    </div>

  </form>
</section>

{% endblock %}
<commit_msg>Do not remove repository path when updating projects<commit_after>{% extends "base.html" %}

{% block title %}{{ _('Pontoon &middot; %(subtitle)s')|format(subtitle=subtitle) }}{% endblock %}

{% block class %}admin-form{% endblock %}

{% block content %}
<!-- Server data -->
<div id="server"
     class="hidden"
     {% if csrf_token %}data-csrf="{{ csrf_token }}"{% endif %}>
</div>

<section id="intro" class="visible">

  <nav>
    <ul class="links">
      <li><a href="{{ url('pontoon.home') }}" title="{{ _('Pontoon Home') }}">Home</a></li>
      <li><a href="{{ url('pontoon.admin') }}" title="{{ _('Pontoon Admin') }}">Admin</a></li>
    </ul>
  </nav>
  <form method="POST" action="{{ request.path }}" class="{% if pk %}edit{% else %}add{% endif %}">

    <h1 id="title">{{ _('%(subtitle)s')|format(subtitle=subtitle) }}</h1>
    <ul class="notification{% if not messages %} hidden{% endif %}">
        {% for message in messages %}
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
        {% endfor %}
    </ul>
    <input type="hidden" value="{{ csrf_token }}" name="csrfmiddlewaretoken">
    {% if pk %}
      <input type="hidden" value="{{ pk }}" name="pk">
      {{ form.format.as_hidden() }}
      {{ form.repository_path.as_hidden() }}
    {% endif %}

    <div>
        {{ form.name.label_tag() }}
        {{ form.name }}
        {{ form.name.errors }}
    </div>
    <div class="locales clearfix">
        <div class="locale select">
          <label for="available">Available locales<a class="choose-all" href="#choose-all">Choose all &rarr;</a></label>
          <div class="menu">
            <input id="available" type="text" class="search" autocomplete="off">
            <div class="horizontal-separator"></div>
            <ul>
              {% for locale in locales_available %}
              <li data-id="{{ locale.id }}"><span class="language {{ locale.code }}">{{ locale.name }}<span class="code">{{ locale.code }}</span></span></li>
              {% endfor %}
              <li class="no-match">{{ _('No results match') }} "<span></span>"</li>
            </ul>
          </div>
        </div>
        <div class="locale select selected">
          <label for="selected">Chosen locales<a class="remove-all" href="#remove-all">&larr; Remove all</a></label>
          <div class="menu">
            <input id="selected" type="text" class="search" autocomplete="off">
            <div class="horizontal-separator"></div>
            <ul>
              {% for locale in locales_selected %}
              <li data-id="{{ locale.id }}"><span class="language {{ locale.code }}">{{ locale.name }}<span class="code">{{ locale.code }}</span></span></li>
              {% endfor %}
              <li class="no-match">{{ _('No results match') }} "<span></span>"</li>
            </ul>
          </div>
        </div>
        {{ form.locales }}
        {{ form.locales.errors }}
    </div>

    <h2>Repository</h2>

    <div class="repository clearfix">
        <section class="type-wrapper">
            {{ form.repository_type.label_tag() }}
            <div class="type select">
              <div class="hidden">
                {{ form.repository_type }}
              </div>
              <div class="button selector">
                <span class="title"></span>
                <span> &#9662;</span>
              </div>
              <ul class="menu">
                {% for choice in REPOSITORY_TYPE_CHOICES %}
                    <li data-type="{{ choice[0] }}">{{ choice[1] }}</li>
                {% endfor %}
              </ul>
            </div>
            <p class="authentication-title">Please sign in</p>
        </section>
        <section class="details-wrapper" data-repository-type="{{ form.repository_type.value()|lower }}">
            <div class="repo">
                {{ form.repository.label_tag() }}
                {{ form.repository }}
                {% if pk %}
                <button title="{{ _('Update all locales from repository') }}" data-source="repository" class="button update">
                    <img class="update" src="{{ static('img/update.png') }}" alt="{{ _('Update all locales from repository') }}" />
                </button>
                {% endif %}
            </div>
            <div class="transifex clearfix">
                {{ form.transifex_project.label_tag() }}
                {{ form.transifex_resource.label_tag() }}
                {{ form.transifex_project }}
                {{ form.transifex_resource }}
                {% if pk %}
                <button title="{{ _('Update all locales from Transifex') }}" data-source="transifex" class="button update">
                    <img class="update" src="{{ static('img/update.png') }}" alt="{{ _('Update all locales from Transifex') }}" />
                </button>
                <section class="authentication-form">
                    <label for="id_transifex_username">Username or email</label>
                    <label for="id_transifex_password">Password</label>
                    <input id="id_transifex_username" name="transifex_username" type="text" />
                    <input id="id_transifex_password" name="transifex_password" type="password" />
                </section>
                <div class="bottom">
                    <label class="remember">
                        <input name="remember" type="checkbox" />{{ _('Remember me') }}
                    </label>
                    <a class="new" target="_blank" href="http://www.transifex.com/signup/">{{ _('New to Transifex?') }}</a>
                </div>
                {% endif %}
            </div>
        </section>
        {{ form.repository.errors }}
        {{ form.transifex_project.errors }}
        {{ form.transifex_resource.errors }}
    </div>

    <h2>Website</h2>

    <div>
        {{ form.url.label_tag() }}
        {{ form.url }}
        {{ form.url.errors }}
    </div>
    <div class="checkbox clearfix">
        <label for="id_external">
            {{ form.external }}{{ form.external.label }}
        </label>
    </div>
    <div class="checkbox clearfix">
        <label for="id_links">
            {{ form.links }}{{ form.links.label }}
        </label>
    </div>

    <h2>Subpages
        <span class="small">(optional)</span>
        <a href="#add-subpage" class="add-subpage">Add more</a>
    </h2>

    {{ formset.management_form }}
    {% for form in formset %}
        {{ form.id }}
    <div class="subpages clearfix">
        {{ form.name.label_tag() }}
        {{ form.url.label_tag() }}
        {{ form.name }}
        {{ form.url }}
        <button title="{{ _('Delete subpage') }}" class="button delete-subpage" tabindex="-1">
            <img src="{{ static('img/cancel.png') }}" alt="{{ _('Delete subpage') }}" />
        </button>
        {{ form.DELETE }}
        {{ form.name.errors }}
        {{ form.url.errors }}
    </div>
    {% endfor %}
    <div class="subpages clearfix" data-count="{{ formset.total_form_count() }}">
        {{ formset.empty_form.name.label_tag() }}
        {{ formset.empty_form.url.label_tag() }}
        {{ formset.empty_form.name }}
        {{ formset.empty_form.url }}
        <button title="{{ _('Delete subpage') }}" class="button delete-subpage" tabindex="-1">
            <img src="{{ static('img/cancel.png') }}" alt="{{ _('Delete subpage') }}" />
        </button>
        {{ formset.empty_form.DELETE }}
        {{ formset.empty_form.name.errors }}
        {{ formset.empty_form.url.errors }}
    </div>

    <h2>General info <span class="small">(optional)</span></h2>

    <div>
        {{ form.info_brief.label_tag() }}
        {{ form.info_brief }}
        {{ form.info_brief.errors }}
    </div>
    <div>
        {{ form.info_locales.label_tag() }}
        {{ form.info_locales }}
        {{ form.info_locales.errors }}
    </div>
    <div>
        {{ form.info_audience.label_tag() }}
        {{ form.info_audience }}
        {{ form.info_audience.errors }}
    </div>
    <div>
        {{ form.info_metrics.label_tag() }}
        {{ form.info_metrics }}
        {{ form.info_metrics.errors }}
    </div>

    <div class="controls clearfix">
        {% if pk %}<button class="button delete-project">Delete project</button>{% endif %}
        <button class="button">Save project</button>
        <a href="{{ url('pontoon.admin') }}" class="cancel">Cancel</a>
    </div>

  </form>
</section>

{% endblock %}

{'fraction_non_alphanumeric': 0.1936787072243346, 'fraction_numerical': 0.0021387832699619773, 'mean_word_length': 2.0711548987411055, 'pattern_counts': {'":': 0, '<': 351, '<?xml version=': 0, '>': 351, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1780347', 'n_tokens_mistral': 5198, 'n_tokens_neox': 4935, 'n_words': 974}