Blob Blame Raw
{% macro render_field(field, after="") %}
<div class="row">
  {{ field.label }}{{ field(**kwargs)|safe }}
  {% if after %} {{ after }}{% endif %}
  {% if field.errors %}
  <ul class="errors">
    {% for error in field.errors %}
    <li>{{ error }}</li>
    {% endfor %}
  </ul>
  {% endif %}
</div>
{% endmacro %}

{% macro render_field_invert(field, after="") %}
<div class="row">
  {{ field(**kwargs)|safe }}{{ field.label }}
  {% if after %} {{ after }}{% endif %}
  {% if field.errors %}
  <ul class="errors">
    {% for error in field.errors %}
    <li>{{ error }}</li>
    {% endfor %}
  </ul>
  {% endif %}
</div>
{% endmacro %}

{% macro render_field_in_row(field, after="") %}
<tr>
    <td>{{ field.label }}</td>
    <td>{{ field(**kwargs)|safe }}</td>
{% if after %} <td>{{ after }}</td>{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<td class="errors">{{ error }}</td>
{% endfor %}
{% endif %}
</tr>
{% endmacro %}

{% macro render_field_in_cell(field, after="") %}
    <td>{{ field.label }}</td>
    <td>{{ field(**kwargs)|safe }}</td>
{% if after %} <td>{{ after }}</td>{% endif %}
{% if field.errors %}
{% for error in field.errors %}
<td class="errors">{{ error }}</td>
{% endfor %}
{% endif %}
{% endmacro %}


{% macro render_field_in_list(field) %}
    <li>{{ field.label }}</li>
    <li>{{ field(**kwargs)|safe }}</li>
{% if field.errors %}
{% for error in field.errors %}
<li class="errors">{{ error }}</li>
{% endfor %}
{% endif %}
{% endmacro %}


{% macro show_comment(comment, id, repo, username, issueid, form, repo_admin) %}
  <section class="issue_comment">
    <header id="comment-{{ id }}">
      {{ comment.user.user | avatar(16) | safe }}
      <a href="{{ url_for('view_user', username=comment.user.user)}}">
        {{ comment.user.user }}
      </a> - <span title="{{
        comment.date_created.strftime('%Y-%m-%d %H:%M:%S')
        }}">{{ comment.date_created | humanize}}</span>
      <a class="headerlink" title="Permalink to this headline"
        href="#comment-{{ id }}">ΒΆ</a>
      <aside class="issue_action icon">

        {% if comment.edited_on %}
            <span title="{{
            comment.updated_info
            }}">Edited by {{ comment.editor.username }} {{ comment.edited_on | humanize }}</span>
        {% endif %}

        <a class="reply" title="Reply to this comment - loose formating">
          reply
        </a>

        {% if id != 0 and g.fas_user and (
            (comment.parent.status in [True, 'Open'] and g.fas_user.username == comment.user.username)
            or repo_admin) %}
        <a href="{{ '%s/comment/%s/edit' % (request.base_url, comment.id) }}" >
            <span class="icon icon-edit blue"></span>
        </a>
        <button type="submit" name="drop_comment" value="{{ comment.id }}"
            onclick="return confirm('Do you really want to remove this comment?');"
            title="Remove comment">
            <span class="icon icon-remove blue"></span>
        </button>
        {% endif %}
      </aside>
    </header>
    <div class="comment_body">
      {% autoescape false %}
      {% if id == 0 %}
      {{ comment.content | markdown }}
      {% else %}
      {{ comment.comment | markdown }}
      {% endif %}
      {% endautoescape %}
    </div>
  </section>
{% endmacro %}