{% extends "advbase.html" %}

{% block bodytag -%}
<body class="advurlfilter">
{% endblock -%}

{% block advcontent -%}
<form class="pure-form" action="" method="POST">
    <fieldset>
        <legend><h3>{{_("Url Filter")}}</h3></legend>
        <p><small>{{_("Urls in list would not be downloaded.")}}</small></p>
        <div class="box-list">
            {% if user.urlfilter.count() -%}
                {% for urlflt in user.urlfilter -%}
                    <div class="box">
                        {%if urlflt.url|length>70 %}
                            {{ urlflt.url[:70] }}...<span>{{ urlflt.url }}</span>
                        {%else%}
                            {{ urlflt.url }}
                        {% endif %}
                        <div class="cornerControls">
                            <a href="/advdel?delurlid={{urlflt.key().id()}}" class="actionButton">{{_("Delete")}}</a>
                        </div>
                    </div>
                {% endfor -%}
            {% endif -%}
            <div class="box newitem">
                <input type="text" name="url" style="width:100%;" placeholder="{{ _('Please input regular expression') }}" />
                <div class="cornerControls">
                    <input type="submit" value="{{ _('Add') }}" class="actionButton add" />
                </div>
            </div>
        </div>
    </fieldset>
</form>
{% endblock -%}