From 67aaae949670ac2b941df21de4c0ca7909c942a6 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Sat, 2 Dec 2017 15:18:09 -0800 Subject: [PATCH 1/6] Suggest wiping your environment to folks with bad build outcomes. This is a basic start to trying to be more helpful to users. --- readthedocs/builds/static/builds/css/detail.css | 4 ++++ readthedocs/core/views/__init__.py | 2 +- readthedocs/templates/builds/build_detail.html | 9 +++++++++ readthedocs/templates/wipe_version.html | 11 ++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/readthedocs/builds/static/builds/css/detail.css b/readthedocs/builds/static/builds/css/detail.css index 53442c7f767..9c62b21e294 100644 --- a/readthedocs/builds/static/builds/css/detail.css +++ b/readthedocs/builds/static/builds/css/detail.css @@ -35,6 +35,10 @@ div.build-detail div.build-state > span.build-state-successful { background: #5a5; } +div.build-detail div.build-ideas { + padding: .5em; +} + ul.build-meta { display: block; width: 40%; diff --git a/readthedocs/core/views/__init__.py b/readthedocs/core/views/__init__.py index a8125eff0ee..0a54aa733ee 100644 --- a/readthedocs/core/views/__init__.py +++ b/readthedocs/core/views/__init__.py @@ -98,7 +98,7 @@ def wipe_version(request, project_slug, version_slug): for del_dir in del_dirs: broadcast(type='build', task=remove_dir, args=[del_dir]) return redirect('project_version_list', project_slug) - return render_to_response('wipe_version.html', + return render_to_response('wipe_version.html', {'version': version, 'project': version.project}, context_instance=RequestContext(request)) diff --git a/readthedocs/templates/builds/build_detail.html b/readthedocs/templates/builds/build_detail.html index 18023416b0a..7b08795213e 100644 --- a/readthedocs/templates/builds/build_detail.html +++ b/readthedocs/templates/builds/build_detail.html @@ -92,6 +92,15 @@ + {% if not build.success and build.commands.count < 4 %} +
+

+ Having trouble with your build environment? + Try reseting it. +

+
+ {% endif %} + {% if build.output %} {# If we have build output, this is an old build #}

diff --git a/readthedocs/templates/wipe_version.html b/readthedocs/templates/wipe_version.html index 1483125f39c..eb1d84a654b 100644 --- a/readthedocs/templates/wipe_version.html +++ b/readthedocs/templates/wipe_version.html @@ -1,16 +1,25 @@ {% extends "base.html" %} +{% block project_editing %} + {% with versions_active="active" %} + {% include "core/project_bar.html" %} + {% endwith %} +{% endblock %} + + {% block title %}Wipe the build directories for a version {% endblock %} {% block content %} +

Remove build environment for {{ version.slug }} version.

+ {% if deleted %} Your project environment has been wiped.

{% else %} Having trouble getting your documentation build to complete? By clicking on the button below you'll clean out your build checkouts and environment, but not your generated documentation.
- +
{% endif %} From cb46220b022cb2b329ff3004b32f36c02fb754a3 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Sat, 2 Dec 2017 15:24:49 -0800 Subject: [PATCH 2/6] Add idea for setup.py install --- readthedocs/templates/builds/build_detail.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/readthedocs/templates/builds/build_detail.html b/readthedocs/templates/builds/build_detail.html index 7b08795213e..a08c0abe995 100644 --- a/readthedocs/templates/builds/build_detail.html +++ b/readthedocs/templates/builds/build_detail.html @@ -92,15 +92,22 @@ - {% if not build.success and build.commands.count < 4 %}
+ {% if not build.success and build.commands.count < 4 %}

Having trouble with your build environment? Try reseting it.

-
{% endif %} + {% if not build.success and "setup.py install" in build.commands.last.output %} +

+ Don't want

setup.py install
called? + Change the Install Project setting in your advanced settings. +

+ {% endif %} + + {% if build.output %} {# If we have build output, this is an old build #}

From 116dd1a234b44d2c0cd9a331f052a33223f4a90a Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 5 Dec 2017 08:38:03 -0800 Subject: [PATCH 3/6] Fix translation --- readthedocs/templates/builds/build_detail.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/readthedocs/templates/builds/build_detail.html b/readthedocs/templates/builds/build_detail.html index a08c0abe995..856d6e70533 100644 --- a/readthedocs/templates/builds/build_detail.html +++ b/readthedocs/templates/builds/build_detail.html @@ -95,15 +95,22 @@

{% if not build.success and build.commands.count < 4 %}

+ + {% url 'wipe_version' build.version.project.slug build.version.slug as wipe_url %} + {% blocktrans %} Having trouble with your build environment? - Try reseting it. + Try reseting it. + {% endblocktrans %}

{% endif %} {% if not build.success and "setup.py install" in build.commands.last.output %}

+ {% url 'projects_advanced' build.version.project.slug as advanced_url %} + {% blocktrans %} Don't want

setup.py install
called? - Change the Install Project setting in your advanced settings. + Change the Install Project setting in your advanced settings. + {% endblocktrans %}

{% endif %}
From 2d5cfc548969f341780cba171bebf57da0148bf3 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 5 Dec 2017 08:39:09 -0800 Subject: [PATCH 4/6] More i18n --- readthedocs/templates/wipe_version.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/readthedocs/templates/wipe_version.html b/readthedocs/templates/wipe_version.html index eb1d84a654b..88bd5724640 100644 --- a/readthedocs/templates/wipe_version.html +++ b/readthedocs/templates/wipe_version.html @@ -11,12 +11,18 @@ {% block content %} -

Remove build environment for {{ version.slug }} version.

+{% blocktrans with slug=version.slug %} +

Remove build environment for {{ slug }} version.

+{% endblocktrans %} {% if deleted %} +{% blocktrans %} Your project environment has been wiped.

+{% endblocktrans %} {% else %} +{% blocktrans %} Having trouble getting your documentation build to complete? By clicking on the button below you'll clean out your build checkouts and environment, but not your generated documentation. +{% endblocktrans %}
From a37a3dadace39e7d5106a601108de04da6a67585 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 5 Dec 2017 08:39:32 -0800 Subject: [PATCH 5/6] Indention --- readthedocs/templates/wipe_version.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readthedocs/templates/wipe_version.html b/readthedocs/templates/wipe_version.html index 88bd5724640..046511646e2 100644 --- a/readthedocs/templates/wipe_version.html +++ b/readthedocs/templates/wipe_version.html @@ -12,17 +12,17 @@ {% block content %} {% blocktrans with slug=version.slug %} -

Remove build environment for {{ slug }} version.

+

Remove build environment for {{ slug }} version.

{% endblocktrans %} {% if deleted %} -{% blocktrans %} -Your project environment has been wiped.

-{% endblocktrans %} + {% blocktrans %} + Your project environment has been wiped.

+ {% endblocktrans %} {% else %} -{% blocktrans %} -Having trouble getting your documentation build to complete? By clicking on the button below you'll clean out your build checkouts and environment, but not your generated documentation. -{% endblocktrans %} + {% blocktrans %} + Having trouble getting your documentation build to complete? By clicking on the button below you'll clean out your build checkouts and environment, but not your generated documentation. + {% endblocktrans %} From 277b529a88a5fb4f290a61bf303c506390aaf257 Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Tue, 5 Dec 2017 15:24:03 -0800 Subject: [PATCH 6/6] Review feedback --- readthedocs/templates/wipe_version.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/readthedocs/templates/wipe_version.html b/readthedocs/templates/wipe_version.html index 046511646e2..e11235cc7b2 100644 --- a/readthedocs/templates/wipe_version.html +++ b/readthedocs/templates/wipe_version.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% load i18n %} {% block project_editing %} {% with versions_active="active" %} @@ -11,21 +12,25 @@ {% block content %} +

{% blocktrans with slug=version.slug %} -

Remove build environment for {{ slug }} version.

+ Remove build environment for {{ slug }} version. {% endblocktrans %} + {% if deleted %} +

{% blocktrans %} - Your project environment has been wiped.

+ Your project environment has been wiped. {% endblocktrans %} +

{% else %} {% blocktrans %} Having trouble getting your documentation build to complete? By clicking on the button below you'll clean out your build checkouts and environment, but not your generated documentation. {% endblocktrans %} - + {% endif %}