From 85a02edb8fe01b6a4cf1561ae3d6ffbc3602b323 Mon Sep 17 00:00:00 2001 From: Jacob Welsh Date: Wed, 1 Oct 2014 12:52:49 -0500 Subject: [PATCH] New settings for private installations - The site name in the titles and "about" page can be changed from dpaste.de - The Gist feature can be disabled (both the UI and the code that does the POST) - A different URL can be given for jquery(.min).js besides google, such as beside the local static files --- docs/settings.rst | 12 ++++++++++++ dpaste/templates/dpaste/about.html | 9 +++++---- dpaste/templates/dpaste/base.html | 4 ++-- dpaste/templates/dpaste/snippet_details.html | 2 ++ dpaste/views.py | 20 +++++++++++++++----- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index e606646..46658f2 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -34,6 +34,10 @@ behavior without touching the code: String. The full qualified hostname and path to the dpaste instance. This is used to generate a link in the API response. Default: ``https://dpaste.de`` + ``DPASTE_SITE_NAME`` + String. Site name to display in page titles. Default: + ``dpaste.de`` + ``DPASTE_LEXER_LIST`` Choices. A tuple of choices of Pygments lexers used in the lexer dropdown. Here is the full `lexer list`_ which is currently used. @@ -90,6 +94,10 @@ behavior without touching the code: The key of the default value of ``DPASTE_EXPIRE_CHOICES``. Default: ``3600 * 24 * 30 * 12 * 100`` or simpler: ``DPASTE_EXPIRE_CHOICES[2][0]``. + ``DPASTE_ENABLE_GIST`` + Boolean. Whether to display the Gist button for re-pasting to GitHub. + Default: ``True`` + ``DPASTE_DEFAULT_GIST_NAME`` String. The filename used when pasting a snippet on Github Gist. Default: ``dpaste.de_snippet.py`` @@ -98,4 +106,8 @@ behavior without touching the code: String. The filename used when pasting a snippet on Github Gist. Default: ``dpaste.de_snippet.py`` + ``DPASTE_JQUERY_URL`` + String. URL to use for jQuery. + Default: ``//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js`` + .. _lexer list: https://github.com/bartTC/dpaste/blob/master/dpaste/highlight.py#L25 diff --git a/dpaste/templates/dpaste/about.html b/dpaste/templates/dpaste/about.html index dd6551b..afb2b37 100644 --- a/dpaste/templates/dpaste/about.html +++ b/dpaste/templates/dpaste/about.html @@ -3,8 +3,8 @@ {% load i18n %} {% load url from future %} -{% block title %}About dpaste.de{% endblock %} -{% block headline %}About dpaste.de{% endblock %} +{% block title %}About {{ site_name }}{% endblock %} +{% block headline %}About {{ site_name }}{% endblock %} {% block dpaste_nav_about %}active{% endblock %} {% block page %} @@ -12,8 +12,9 @@

- dpaste is open source. You can find the source, contribute to it and - leave ideas on Github: github.com/bartTC/dpaste + {{ site_name }} is powered by dpaste, which is open source. You can + find the source, contribute to it and leave ideas on Github: + github.com/bartTC/dpaste

API

diff --git a/dpaste/templates/dpaste/base.html b/dpaste/templates/dpaste/base.html index 0280bc7..da269da 100644 --- a/dpaste/templates/dpaste/base.html +++ b/dpaste/templates/dpaste/base.html @@ -5,7 +5,7 @@ - dpaste.de: {% block title %}{% trans "New snippet" %}{% endblock %} + {{ site_name }}: {% block title %}{% trans "New snippet" %}{% endblock %} @@ -28,7 +28,7 @@
{% block script_footer %} - +