Porting to bootstrap 4.
This commit is contained in:
parent
709fb4be3d
commit
a53cc0abb3
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,102 +0,0 @@
|
|||
pre {
|
||||
font-family: "Bitstream Vera Sans Mono", "monospace";
|
||||
zcolor: #000;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
table {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
ul.errorlist {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
td.title {
|
||||
width: 390px;
|
||||
}
|
||||
|
||||
form ul {
|
||||
color: #B94A48;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
textarea#id_content {
|
||||
width: 100%;
|
||||
height: 320px;
|
||||
}
|
||||
|
||||
input:hover, input:active, input[type="text"]:focus, input[type="password"]:focus,
|
||||
textarea:hover, textarea:active, textarea:focus {
|
||||
border-color: #ccc;
|
||||
box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
}
|
||||
|
||||
input#id_title {
|
||||
width: 505px;
|
||||
}
|
||||
|
||||
.container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-prepend .add-on {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.row {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.btn {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
[class^="icon-"], [class*=" icon-"] {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
[class*="span"] {
|
||||
float: left;
|
||||
min-height: 1px;
|
||||
padding-left: 25px;
|
||||
margin-left: 0px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.span3 {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.span6 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.span12 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.navbar a {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
margin-bottom: 0px
|
||||
}
|
||||
|
||||
#unlock, #expired {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
#unlock form {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#charsleft {
|
||||
float: right;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,48 +1,38 @@
|
|||
{% load i18n %}
|
||||
{% load compress %}
|
||||
<!DOCTYPE html>
|
||||
{% load i18n %}{% load compress %}<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{% block title %}{% endblock %} - {{ DISPLAY_NAME }}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
{% compress css %}
|
||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/static/css/pygments-highlight.css" rel="stylesheet">
|
||||
<link href="/static/css/main.css" rel="stylesheet">
|
||||
{% endcompress %}
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-default">
|
||||
<div class="navbar-inner">
|
||||
<div class="container-fluid">
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="brand" href="{% url 'index' %}">{{ DISPLAY_NAME }}</a>
|
||||
<div class="nav-collapse collapse">
|
||||
<p class="navbar-text pull-right">
|
||||
{% trans 'powered by' %} <a href="https://github.com/setsuna-/pasteque"><b>{{ APP_NAME }}</b></a>
|
||||
</p>
|
||||
<ul class="nav">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link href="/static/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/static/css/pygments-highlight.css" rel="stylesheet">
|
||||
<link href="/static/css/main.css" rel="stylesheet">
|
||||
{% endcompress %}
|
||||
|
||||
<title>{% block title %}{% endblock %} - {{ DISPLAY_NAME }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<a class="navbar-brand" href="{% url 'index' %}">{{ DISPLAY_NAME }}</a>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
{% block nav %}
|
||||
<li class="{% if menu == 'index'%}active{% endif %}"><a href="{% url 'index' %}">{% trans 'Paste something' %}</a></li>
|
||||
<li class="{% if menu == 'index'%}active{% endif %}"><a class="nav-link" href="{% url 'index' %}">{% trans 'Paste something' %}</a></li>
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
<span class="navbar-text">
|
||||
{% trans 'powered by' %} <a class="navbar-link" href="https://github.com/setsuna-/pasteque"><b>{{ APP_NAME }}</b></a>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
{% compress js %}
|
||||
<script src="/static/js/jquery-1.9.1.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<script src="/static/js/jquery.autogrowtextarea.min.js"></script>
|
||||
{% endcompress %}
|
||||
{% block javascript %}{% endblock %}
|
||||
</body>
|
||||
{% block javascript %}{% endblock %}
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "base.html" %}{% load filters %}
|
||||
{% load i18n %}
|
||||
{% load compress %}
|
||||
{% block title %}{% trans 'Paste something' %}{% endblock %}
|
||||
|
@ -6,71 +6,60 @@
|
|||
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
|
||||
<form method="post" action="{% url 'index' %}">
|
||||
{{ form.non_field_errors }}
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
{% if PASTE.show_char_left %}
|
||||
<span id="charsleft"><b id="charsleft_counter">...</b> {% trans 'characters left' %}</span>
|
||||
{% endif %}
|
||||
<label for="id_content">{% trans 'Content' %}</label>
|
||||
{{ form.content }}
|
||||
{{ form.content.errors }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{% if PASTE.has_title %}
|
||||
<div class="span3">
|
||||
<label for="id_title">{% trans 'Title' %}</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-tag"></i></span>
|
||||
{{ form.title }}
|
||||
</div>
|
||||
{{ form.title.errors }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{% if PASTE.show_char_left %}
|
||||
<span id="charsleft"><b id="charsleft_counter">...</b> {% trans 'characters left' %}</span>
|
||||
{% endif %}
|
||||
<div class="span3">
|
||||
<label for="id_language">{% trans 'Language' %}</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-file-alt"></i></span>
|
||||
{{ form.language }}
|
||||
</div>
|
||||
{{ form.language.errors }}
|
||||
</div>
|
||||
<div class="span3">
|
||||
<label for="id_lifetime">{% trans 'Expire time' %}</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-time"></i></span>
|
||||
{{ form.lifetime }}
|
||||
</div>
|
||||
{{ form.lifetime.errors }}
|
||||
</div>
|
||||
{% if PASTE.has_expire_by_views %}
|
||||
<div class="span3">
|
||||
<label for="id_lifecount">{% trans 'Expire allowed views' %}</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-refresh"></i></span>
|
||||
{{ form.lifecount }}
|
||||
</div>
|
||||
{{ form.lifecount.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="span3">
|
||||
<label for="id_password">{% trans 'Password protected' %}</label>
|
||||
<div class="input-prepend">
|
||||
<span class="add-on"><i class="icon-lock"></i></span>
|
||||
{{ form.password }}
|
||||
</div>
|
||||
{{ form.password.errors }}
|
||||
</div>
|
||||
<div class="span3">
|
||||
<label for="id_private">{% trans 'Private' %}</label>
|
||||
{{ form.private }}
|
||||
{{ form.private.errors }}
|
||||
</div>
|
||||
<label for="id_content">{% trans 'Content' %}</label>
|
||||
{{ form.content|add_class:"form-control"}}
|
||||
{{ form.content.errors }}
|
||||
</div>
|
||||
|
||||
{% if PASTE.has_title %}
|
||||
<div class="form-group">
|
||||
<label 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="form-group">
|
||||
<label for="id_language"><span class="add-on"><i class="icon-file-alt"></i></span> {% trans 'Language' %}</label>
|
||||
{{ form.language|add_class:"form-control" }}
|
||||
{{ form.language.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_lifetime"><span class="add-on"><i class="icon-time"></i></span> {% trans 'Expire time' %}</label>
|
||||
{{ form.lifetime|add_class:"form-control" }}
|
||||
{{ form.lifetime.errors }}
|
||||
</div>
|
||||
|
||||
{% if PASTE.has_expire_by_views %}
|
||||
<div class="form-group">
|
||||
<label for="id_lifecount"><span class="add-on"><i class="icon-refresh"></i></span> {% trans 'Expire allowed views' %}</label>
|
||||
{{ form.lifecount|add_class:"form-control" }}
|
||||
{{ form.lifecount.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_password"><span class="add-on"><i class="icon-lock"></i></span> {% trans 'Password protected' %}</label>
|
||||
{{ form.password|add_class:"form-control" }}
|
||||
{{ form.password.errors }}
|
||||
</div>
|
||||
|
||||
<div class="form-check">
|
||||
{{ form.private|add_class:"form-check-input" }}
|
||||
<label class="form-check-label" for="id_private">{% trans 'Private' %}</label>
|
||||
{{ form.private.errors }}
|
||||
</div>
|
||||
|
||||
{% csrf_token %}
|
||||
<button class="btn" type="submit">{% trans 'Paste' %}</button>
|
||||
<button class="btn btn-primary" type="submit">{% trans 'Paste' %}</button>
|
||||
<input type="hidden" id="max_characters" value="{{ max_characters }}">
|
||||
</form>
|
||||
</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.)
|
||||
|
@ -78,6 +67,7 @@
|
|||
You may even use a bash function:
|
||||
<pre>wyz() { curl {{ absolute_index_url }} -Fpython=@$1 }</pre>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block javascript %}
|
||||
{% if PASTE.show_char_left %}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{% block title %} {{ title }}{% endblock %}
|
||||
{% block nav %}
|
||||
<li><a href="{% url 'paste' slug=slug renderer='raw' %}">View raw</a></li>
|
||||
<li><a class="nav-link" href="{% url 'paste' slug=slug renderer='raw' %}">View raw</a></li>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{{ highlighted|safe }}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
from django import template
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.filter(name='add_class')
|
||||
def add_class(value, arg):
|
||||
return value.as_widget(attrs={'class': arg})
|
Loading…
Reference in New Issue