{% from "_formhelper.html" import render_field_in_row %}

{% if full %}
{% extends "repo_master.html" %}

{% block title %}{{ select.capitalize() }} {{ plugin.name }} - {{
    repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
{% set tag = "home" %}
{% endif %}

{% block repo %}
{% if full %}
   <h3>{{ plugin.name }} settings</h3>
{% endif %}

  <form action="{{ url_for('ui_ns.view_plugin',
        repo=repo.name,
        username=username,
        namespace=repo.namespace,
        plugin=plugin.name) }}" method="post">
  {{ plugin.description | markdown | noJS | safe }}

    {% for field in fields %}
      {% if field.id in form_fields_readonly %}
      {{ render_field_in_row(field, readonly=True) }}
      {% else %}
      {{ render_field_in_row(field) }}
      {% endif %}
    {% endfor %}

  {% if plugin.extra_info %}
  {{ plugin.extra_info | render(repo=repo, username=username) | safe }}
  {% endif %}
  <p class="buttons indent">
      <input type="button" value="Cancel" class="btn btn-secondary cancel_btn">
      <input type="submit" class="btn btn-primary" value="Update">
      {{ form.csrf_token }}
    </p>
  </form>

{% endblock %}
