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

{% block content %}

<div class="page-header">
  <h1>Project: {{ project.name }}</h1>
</div>

<ol class="breadcrumb">
  <li><a href="{% url 'service-list' %}">Home</a></li>
  <li><a href="{% url 'service-detail' project.service.id %}">{{ project.service.name }}</a></li>
  <li class="active"><a href="{% url 'project-detail' project.id %}">{{ project.name }}</a></li>
</ol>

<div class="row">

<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Configuration</div>
    <a href="{% url 'project-update' project.id %}" class="btn btn-default">{% trans "Update Project" %}</a>
    <a href="{% url 'project-export' project.id %}" class="btn btn-default">{% trans "Export Project" %}</a>
    <form method="post" action="{% url 'project-delete' project.id %}" onsubmit="return confirm('{% trans "Delete this Project?" %}')" style="display: inline">
      {% csrf_token %}
      <button class="btn btn-danger">{% trans "Delete Project" %}</button>
    </form>
  </div>
</div>

<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Notifications</div>
    <table class="table">
      {% for sender in project.sender_set.all %}
      <tr>
        <th>{{ sender.sender }}</th>
        <td>{{ sender.show_value }}</td>
        <td>
          <form method="post" action="{% url 'sender-delete' sender.id %}" onsubmit="return confirm('{% trans "Delete notificiation?" %}')" style="display: inline">
            {% csrf_token %}
            <button class="btn btn-danger">{% trans "Delete" %}</button>
          </form>
        </td>
      </tr>
      {% endfor %}
    </table>
    <div class="panel-footer">
      <a href="{% url 'project-sender' project.id %}" class="btn btn-primary">{% trans "Register Sender" %}</a>
    </div>
  </div>
</div>

<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Exporters</div>
    <table class="table">
      <tr>
        <th>Job</th>
        <th>Port</th>
        <th>Metrics Path</th>
        <th>&nbsp;</th>
      </tr>
    {% for exporter in project.exporter_set.all %}
      <tr>
        <td>{{ exporter.job }}</td>
        <td>{{ exporter.port }}</td>
        <td>{{ exporter.path }}</td>
        <td>
          <form method="post" action="{% url 'exporter-delete' exporter.id %}" onsubmit="return confirm('Delete this exporter?')" style="display: inline">
            {% csrf_token %}
            <button class="btn btn-danger">{% trans "Delete" %}</button>
          </form>
        </td>
      </tr>
    {% endfor %}
    </table>
    <div class="panel-footer">
      <a href="{% url 'project-exporter' project.id %}" class="btn btn-primary">{% trans "Register Exporter" %}</a>
    </div>
  </div>
</div>


<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Hosts from {{ project.farm.name }} ({{ project.farm.source }})</div>
    <table class="table">
      <tr>
        <th>Name</th>
      {% if project.farm.source == FARM_DEFAULT %}
        <th>&nbsp;</th>
      {% endif %}
      </tr>
    {% for host in project.farm.host_set.all %}
      <tr>
        <td><a href="{% url 'host-detail' host.id %}">{{ host.name }}</a></td>
        {% if project.farm.source == FARM_DEFAULT %}
        <td>
          <form method="post" action="{% url 'host-delete' host.id %}" onsubmit="return confirm('{% trans "Delete this host?" %}');">
            {% csrf_token %}
          <button name="delete" type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
          </form>
        </td>
        {% endif %}
      </tr>
    {% endfor %}
    </table>

    <div class="panel-footer">
  {% if project.farm.source == FARM_DEFAULT %}
      <a href="{% url 'hosts-add' project.farm.id %}" class="btn btn-primary">{% trans "Add new host" %}</a>
      <a href="{% url 'project-detail' project.id %}" class="btn btn-default">{% trans "Edit Farm" %}</a>
      <form method="post" action="{% url 'farm-unlink' project.id %}" onsubmit="return confirm('{% trans "Unlink this farm?" %}')" style="display: inline">
        {% csrf_token %}
        <button type="submit" class="btn btn-danger">{% trans "Unlink Farm" %}</button>
      </form>
  {% elif project.farm %}
      <form method="post" action="{% url 'farm-unlink' project.id %}" onsubmit="return confirm('{% trans "Unlink this farm?" %}')" style="display: inline">
        {% csrf_token %}
        <button type="submit" class="btn btn-warning">{% trans "Unlink Farm" %}m</button>
      </form>
      <form method="post" action="{% url 'farm-convert' project.farm.id %}" onsubmit="return confirm('Convert this farm to local?')" style="display: inline">
        {% csrf_token %}
        <button class="btn btn-warning">{% trans "Convert Farm" %}</button>
      </form>
      <form method="post" action="{% url 'farm-refresh' project.farm.id %}" style="display: inline">
        {% csrf_token %}
        <button type="submit" class="btn btn-warning">{% trans "Refresh Farm" %}</button>
      </form>
  {% else %}
      <a href="{% url 'farm-new' project.id %}" class="btn btn-primary">{% trans "New Farm" %}</a>
{% for source in sources %}
      <a href="{% url 'farm-link' project.id source %}" class="btn btn-default">{% trans "Link Farm" %} {{ source }}</a>
{% endfor %}
  {% endif %}
    </div>
  </div>
</div>

</div><commit_msg>Remove stray M<commit_after>{% extends "base.html" %}
{% load i18n %}

{% block content %}

<div class="page-header">
  <h1>Project: {{ project.name }}</h1>
</div>

<ol class="breadcrumb">
  <li><a href="{% url 'service-list' %}">Home</a></li>
  <li><a href="{% url 'service-detail' project.service.id %}">{{ project.service.name }}</a></li>
  <li class="active"><a href="{% url 'project-detail' project.id %}">{{ project.name }}</a></li>
</ol>

<div class="row">

<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Configuration</div>
    <a href="{% url 'project-update' project.id %}" class="btn btn-default">{% trans "Update Project" %}</a>
    <a href="{% url 'project-export' project.id %}" class="btn btn-default">{% trans "Export Project" %}</a>
    <form method="post" action="{% url 'project-delete' project.id %}" onsubmit="return confirm('{% trans "Delete this Project?" %}')" style="display: inline">
      {% csrf_token %}
      <button class="btn btn-danger">{% trans "Delete Project" %}</button>
    </form>
  </div>
</div>

<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Notifications</div>
    <table class="table">
      {% for sender in project.sender_set.all %}
      <tr>
        <th>{{ sender.sender }}</th>
        <td>{{ sender.show_value }}</td>
        <td>
          <form method="post" action="{% url 'sender-delete' sender.id %}" onsubmit="return confirm('{% trans "Delete notificiation?" %}')" style="display: inline">
            {% csrf_token %}
            <button class="btn btn-danger">{% trans "Delete" %}</button>
          </form>
        </td>
      </tr>
      {% endfor %}
    </table>
    <div class="panel-footer">
      <a href="{% url 'project-sender' project.id %}" class="btn btn-primary">{% trans "Register Sender" %}</a>
    </div>
  </div>
</div>

<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Exporters</div>
    <table class="table">
      <tr>
        <th>Job</th>
        <th>Port</th>
        <th>Metrics Path</th>
        <th>&nbsp;</th>
      </tr>
    {% for exporter in project.exporter_set.all %}
      <tr>
        <td>{{ exporter.job }}</td>
        <td>{{ exporter.port }}</td>
        <td>{{ exporter.path }}</td>
        <td>
          <form method="post" action="{% url 'exporter-delete' exporter.id %}" onsubmit="return confirm('Delete this exporter?')" style="display: inline">
            {% csrf_token %}
            <button class="btn btn-danger">{% trans "Delete" %}</button>
          </form>
        </td>
      </tr>
    {% endfor %}
    </table>
    <div class="panel-footer">
      <a href="{% url 'project-exporter' project.id %}" class="btn btn-primary">{% trans "Register Exporter" %}</a>
    </div>
  </div>
</div>


<div class="col-md-6">
  <div class="panel panel-default">
    <div class="panel-heading">Hosts from {{ project.farm.name }} ({{ project.farm.source }})</div>
    <table class="table">
      <tr>
        <th>Name</th>
      {% if project.farm.source == FARM_DEFAULT %}
        <th>&nbsp;</th>
      {% endif %}
      </tr>
    {% for host in project.farm.host_set.all %}
      <tr>
        <td><a href="{% url 'host-detail' host.id %}">{{ host.name }}</a></td>
        {% if project.farm.source == FARM_DEFAULT %}
        <td>
          <form method="post" action="{% url 'host-delete' host.id %}" onsubmit="return confirm('{% trans "Delete this host?" %}');">
            {% csrf_token %}
          <button name="delete" type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
          </form>
        </td>
        {% endif %}
      </tr>
    {% endfor %}
    </table>

    <div class="panel-footer">
  {% if project.farm.source == FARM_DEFAULT %}
      <a href="{% url 'hosts-add' project.farm.id %}" class="btn btn-primary">{% trans "Add new host" %}</a>
      <a href="{% url 'project-detail' project.id %}" class="btn btn-default">{% trans "Edit Farm" %}</a>
      <form method="post" action="{% url 'farm-unlink' project.id %}" onsubmit="return confirm('{% trans "Unlink this farm?" %}')" style="display: inline">
        {% csrf_token %}
        <button type="submit" class="btn btn-danger">{% trans "Unlink Farm" %}</button>
      </form>
  {% elif project.farm %}
      <form method="post" action="{% url 'farm-unlink' project.id %}" onsubmit="return confirm('{% trans "Unlink this farm?" %}')" style="display: inline">
        {% csrf_token %}
        <button type="submit" class="btn btn-warning">{% trans "Unlink Farm" %}</button>
      </form>
      <form method="post" action="{% url 'farm-convert' project.farm.id %}" onsubmit="return confirm('Convert this farm to local?')" style="display: inline">
        {% csrf_token %}
        <button class="btn btn-warning">{% trans "Convert Farm" %}</button>
      </form>
      <form method="post" action="{% url 'farm-refresh' project.farm.id %}" style="display: inline">
        {% csrf_token %}
        <button type="submit" class="btn btn-warning">{% trans "Refresh Farm" %}</button>
      </form>
  {% else %}
      <a href="{% url 'farm-new' project.id %}" class="btn btn-primary">{% trans "New Farm" %}</a>
{% for source in sources %}
      <a href="{% url 'farm-link' project.id source %}" class="btn btn-default">{% trans "Link Farm" %} {{ source }}</a>
{% endfor %}
  {% endif %}
    </div>
  </div>
</div>

</div>
{'fraction_non_alphanumeric': 0.21974169741697416, 'fraction_numerical': 0.0014760147601476014, 'mean_word_length': 2.9179616913624864, 'pattern_counts': {'":': 0, '<': 295, '<?xml version=': 0, '>': 295, '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': '1878512', 'n_tokens_mistral': 3803, 'n_tokens_neox': 3572, 'n_words': 887}