{% extends "two_column_body.html" %}
<!-- create_ask_widget.html -->
{% block title %}{{widget_name|capitalize}} widget list{% endblock %}
{% block content %}
  <h1>{{widget_name|capitalize}} widget list</h1>

<table border="0">
  <tr>
    <th>Widget Title </th>
    <th>Code</th>
    <th>Actions</th>
  </tr>
  {% if request.is_secure() %}
    {% set protocol='https' %}
  {% else %}
    {% set protocol='http' %}
  {% endif %}
  {% if widget_name == 'ask' %}
      {%for widget in widgets%}
        <tr>
          <td>{{widget.title}}</td>
          <td> &lt;script type="text/javascript" src="{{ protocol }}://{{request.get_host()}}{% url render_ask_widget widget.id%}" &gt;&lt;/script&gt;</td> 
          <td><a href="{% url edit_widget widget_name, widget.id %}">Edit</a> | <a href="{% url delete_widget widget_name, widget.id %}">Delete</a></td>
        </tr>
      {%endfor%}
  {%else%}
  {%for widget in widgets%}
    <tr>
      <td>{{widget.title}}</td>
      <td> &lt;iframe src="{{ protocol }}://{{request.get_host()}}{% url question_widget widget.id%}" &gt; &lt;/iframe&gt;</td> 
      <td><a href="{% url edit_widget widget_name, widget.id %}">Edit</a> | <a href="{% url delete_widget widget_name, widget.id %}">Delete</a></td>
    </tr>
  {%endfor%}

  {%endif%}
</table>

{% endblock %}
{% block endjs %}
{% endblock %}

{% block sidebar %}
<div class="box">
    <h2>{% trans %}How to use?{% endtrans %}</h2>
    <p>{% trans %}
    Just copy the &lt;script&gt; tag provided and paste it in the site where you wan to put it.
    {%endtrans%} 
    </p>
  </div>
{% endblock %}
