From 8a5f3d2f14089cd69f6bcd0f9dbc73900ad55279 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Fri, 21 Apr 2023 10:12:46 +0200 Subject: [PATCH] No upload from website. --- paste/static/css/pasteque.css | 16 ++++++ paste/templates/base.html | 18 +------ paste/templates/paste/index.html | 65 +++++++----------------- paste/templates/paste/show-pygments.html | 9 ++-- 4 files changed, 41 insertions(+), 67 deletions(-) create mode 100644 paste/static/css/pasteque.css diff --git a/paste/static/css/pasteque.css b/paste/static/css/pasteque.css new file mode 100644 index 0000000..9bb3229 --- /dev/null +++ b/paste/static/css/pasteque.css @@ -0,0 +1,16 @@ +html { + height: 100%; +} + +body { + margin: 0; + height: 100%; +} + +div { + height: 100%; +} + +pre { + margin: 0; +} diff --git a/paste/templates/base.html b/paste/templates/base.html index a07028e..a9fbffd 100644 --- a/paste/templates/base.html +++ b/paste/templates/base.html @@ -5,28 +5,14 @@ {% compress css %} - {% endcompress %} - + {% block extrastyle %}{% endblock %} {% block title %}{% endblock %} - {{ DISPLAY_NAME }} - -
+
{% block content %}{% endblock %}
{% block javascript %}{% endblock %} diff --git a/paste/templates/paste/index.html b/paste/templates/paste/index.html index 547e54d..110dace 100644 --- a/paste/templates/paste/index.html +++ b/paste/templates/paste/index.html @@ -3,56 +3,27 @@ {% load compress %} {% block title %}{% trans 'Paste something' %}{% endblock %} {% block content %} - {% if error_message %}

{{ error_message }}

{% endif %} -
- {{ form.non_field_errors }} -
- - {{ form.content|add_class:"form-control"}} - {{ form.content.errors }} -
+

Paf'Py

+Et Paf. -
- {% if PASTE.has_title %} -
- - {{ form.title|add_class:"form-control" }} - {{ form.title.errors }} -
- {% endif %} +Ce « pastebin-like » ne peut être utilisé qu'en ligne de commande, soit avec curl : -
- -
-
-
-
- {{ form.language|add_class:"form-control" }} -
- {{ form.language.errors }} -
+
curl {{ absolute_index_url }} -Fpython=@hello.py
+
-
- -
+

Le nom, entre -F et = sert à choisir la coloration syntaxique.

-
+

Le mieux est de l'utiliser avec une fonction bash :

- {% csrf_token %} - -
-
- -
+
pafpy()
+{
+    curl {{absolute_index_url}} -F"${1##*.}=@$1"
+}
+
+ +Demo : + +
$ pafpy test.py
+{{absolute_index_url}}D91F1CA
+
{% endblock %} diff --git a/paste/templates/paste/show-pygments.html b/paste/templates/paste/show-pygments.html index 0f42647..410484d 100644 --- a/paste/templates/paste/show-pygments.html +++ b/paste/templates/paste/show-pygments.html @@ -1,9 +1,10 @@ {% extends "base.html" %} - -{% block title %} {{ title }}{% endblock %} -{% block nav %} -
  • View raw
  • +{% block extrastyle %} + {% endblock %} + +{% block title %}{{ title }}{% endblock %} +{% block nav %}{% endblock %} {% block content %} {{ highlighted|safe }} {% endblock %}