{% extends "base.html" %}
{% block content_header %}
<h1>Deploy</h1>
{% endblock %}
{% block content_body %}

{% with messages = get_flashed_messages() %}
{% if messages %}
<div class="callout callout-success">
    <ul>
        {% for message in messages %}
        <li><h4>{{ message }}</h4></li>
        {% endfor %}
    </ul>
</div>
{% endif %}
{% endwith %}

<div class="box">
    <form action="/project/{{ project.id }}/spider/upload" method="post" enctype=multipart/form-data>
        <div class="box-body">
            <div class="form-group">
                <label for="egg-file"><h4>Upload EGG file</h4></label>
                <input type="file" name="file" id="egg-file">

                <p class="help-block">Use <a href="https://github.com/scrapy/scrapyd-client" target="_blank">scrapyd-client</a>
                    to generate egg file <code>scrapyd-deploy --build-egg output.egg</code></p>
            </div>
        </div>
        <div class="box-footer">
            <button type="submit" class="btn btn-primary">Submit</button>
        </div>
    </form>
</div>
{% endblock %}