Skip to content

Commit

Permalink
Suggest wiping your environment to folks with bad build outcomes. (#3347
Browse files Browse the repository at this point in the history
)

Suggest wiping your environment to folks with bad build outcomes.

This is a basic start to trying to be more helpful to users.
  • Loading branch information
ericholscher authored and agjohnson committed Dec 6, 2017
1 parent 4b01021 commit 0fb9b7e
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
4 changes: 4 additions & 0 deletions readthedocs/builds/static/builds/css/detail.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/core/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down
23 changes: 23 additions & 0 deletions readthedocs/templates/builds/build_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,29 @@
</span>
</div>

<div class="build-ideas">
{% if not build.success and build.commands.count < 4 %}
<p>

{% url 'wipe_version' build.version.project.slug build.version.slug as wipe_url %}
{% blocktrans %}
Having trouble with your build environment?
Try <a href="{{ wipe_url }}">reseting it</a>.
{% endblocktrans %}
</p>
{% endif %}

{% if not build.success and "setup.py install" in build.commands.last.output %}
<p>
{% url 'projects_advanced' build.version.project.slug as advanced_url %}
{% blocktrans %}
Don't want <pre>setup.py install</pre> called?
Change the <strong>Install Project</strong> setting in your <a href="{{ advanced_url }}">advanced settings</a>.
{% endblocktrans %}
</p>
{% endif %}
</div>

{% if build.output %}
{# If we have build output, this is an old build #}
<p>
Expand Down
26 changes: 23 additions & 3 deletions readthedocs/templates/wipe_version.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
{% extends "base.html" %}
{% load i18n %}

{% 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 %}

<h3>
{% blocktrans with slug=version.slug %}
Remove build environment for <em>{{ slug }}</em> version.
{% endblocktrans %}
</h3>

{% if deleted %}
Your project environment has been wiped.<br><br>
<p>
{% blocktrans %}
Your project environment has been wiped.
{% endblocktrans %}
</p>
{% 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.
{% 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 %}

<form method="post" action="#">
<input type="submit" value="Wipe version">
<input type="submit" value="{% trans 'Wipe' %} {{ version.slug }}">
</form>
{% endif %}

Expand Down

0 comments on commit 0fb9b7e

Please sign in to comment.