{% extends "app_home/base.html" %}
{% load static %}
{% load i18n %}

{% block navbar_app %}
{% include 'app_home/_sidebar.html' %}
{% endblock %}

{% block title %}
<H2>{% translate 'Code Editor' %}</H2>
<hr>{% endblock %}

{% block content %}

<div class="import-section-card">
<div class="import-section-header">{% translate 'RAW YAML / JSON' %}</div>

<form action="" method="post"> {% csrf_token %}

<div class="form-group">
<button type="submit" name="submit" value="verify" class="btn btn-secondary">{% translate 'Check' %}</button>
<button type="submit" name="submit" value="import" class="btn btn-danger">{% translate 'Import' %}</button>
</div>

<div class="mb-3">
<label class="form-label">{% translate 'Pipeline (optional)' %}</label>
<select class="form-select" name="pipeline">
  <option value="">-----------</option>
  {% for pipeline in pipelines %}<option value="{{ pipeline.keyname }}">{{ pipeline.displayname }}</option>
  {% endfor %}
</select>
</div>

<div class="mb-3">
<label class="form-label">{% translate 'Cut/paste YAML or JSON content below' %}</label>
<pre>
  <textarea class="form-control" name="rawdata" rows="64">{{ rawdata }}</textarea>
</pre>
</div>

</form>
</div>

{% endblock %}
