59 lines
2.0 KiB
HTML
59 lines
2.0 KiB
HTML
{% extends "base.html" %}{% load filters %}
|
|
{% load i18n %}
|
|
{% load compress %}
|
|
{% block title %}{% trans 'Paste something' %}{% endblock %}
|
|
{% block content %}
|
|
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
|
<form method="post" action="{% url 'index' %}">
|
|
{{ form.non_field_errors }}
|
|
<div class="form-group">
|
|
<label for="id_content">{% trans 'Content' %}</label>
|
|
{{ form.content|add_class:"form-control"}}
|
|
{{ form.content.errors }}
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
{% if PASTE.has_title %}
|
|
<div class="col-auto">
|
|
<label class="sr-only" for="id_title"><span class="add-on"><i class="icon-tag"></i></span> {% trans 'Title' %}</label>
|
|
{{ form.title|add_class:"form-control" }}
|
|
{{ form.title.errors }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="col-auto">
|
|
<label class="sr-only" for="id_language">{% trans 'Language' %}</label>
|
|
<div class="input-group">
|
|
<div class="input-group-prepend">
|
|
<div class="input-group-text"><span class="add-on"><i class="icon-file-alt"></i></span></div>
|
|
</div>
|
|
{{ form.language|add_class:"form-control" }}
|
|
</div>
|
|
{{ form.language.errors }}
|
|
</div>
|
|
|
|
<div class="col-auto">
|
|
<button class="btn btn-primary btn-lg" type="submit">{% trans 'Paste' %}</button>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% csrf_token %}
|
|
<input type="hidden" id="max_characters" value="{{ max_characters }}">
|
|
</form>
|
|
<div class="d-flex p-2 bd-highlight">
|
|
<div class="alert alert-info" role="alert">You can also use:
|
|
<pre>curl {{ absolute_index_url }} -Fpython=@hello.py</pre>
|
|
(attribute name is used for syntax highlighting, and shortcuts like "py" are allowed, see Language dropdown for language list.)
|
|
<br /><br />
|
|
You may even use a bash function:
|
|
<pre>wyz()
|
|
{
|
|
curl https://wyz.fr/ -F"${1##*.}=@$1"
|
|
}</pre>
|
|
Like this:
|
|
<pre>wyz FILE_TO_UPLOAD</pre>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|