Skip to content

Commit db0a618

Browse files
committed
Requested Changes
1 parent 100e2df commit db0a618

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

readthedocs/builds/views.py

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from django.contrib.auth.decorators import login_required
1212
from django.core.urlresolvers import reverse
1313
from django.utils.decorators import method_decorator
14+
from requests.utils import quote
1415

1516
from readthedocs.builds.models import Build, Version
1617
from readthedocs.core.utils import trigger_build
@@ -82,6 +83,17 @@ class BuildDetail(BuildBase, DetailView):
8283
def get_context_data(self, **kwargs):
8384
context = super(BuildDetail, self).get_context_data(**kwargs)
8485
context['project'] = self.project
86+
issue = "https://github.com/rtfd/readthedocs.org/issues/new?title="
87+
title = quote("Build error with build id #%s" %self.request.path[-3:-1])
88+
body = "&body=" + quote("## Details:\n\n")
89+
proj = "*Project URL: https://readthedocs.org/projects/%s/\n" %self.project
90+
build = "*Build URL(if applicable): https://readthedocs.org%s\n" %self.request.path
91+
uname = "*Read the Docs username(if applicable): %s\n\n" %self.request.user
92+
expec_res = "## Expected Result\n\n*A description of what you wanted to happen*\n\n"
93+
actual_res = "## Actual Result\n\n*A description of what actually happened*"
94+
body = body + quote(proj + build + uname + expec_res + actual_res)
95+
issue_url = issue + title + body
96+
context['issue_url'] = issue_url
8597
return context
8698

8799

readthedocs/templates/builds/build_detail.html

+2-9
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,8 @@ <h3>{% trans "Error" %}</h3>
163163
{{ build.error }}
164164
</p>
165165
<p>
166-
{% blocktrans with build_id=build.pk proj_name=build.project.name build_path=request.get_full_path user_name=request.user %}
167-
Report any build issues <a href="https://github.com/rtfd/readthedocs.org/issues/new?
168-
title=Build%20error%20with%20build%20id%20%23{{ build_id }}
169-
&body=%23%23%20Details%0A%0A
170-
*%20Project%20Url%3A%20https://readthedocs.org/projects/{{ proj_name }}/%0A
171-
*%20Build%20URL%20(if%20applicable)%3A%20https://readthedocs.org{{ build_path }}%0A
172-
*%20Read%20the%20Docs%20username%20(if%20applicable)%3A%20{{ user_name }}%0A%0A
173-
%23%23%20Expected%20Result%0A%0A*%20A%20description%20of%20what%20you%20wanted%20to%20happen*%0A%0A
174-
%23%23%20Actual%20Result%0A%0A*A%20description%20of%20what%20actually%20happened*%0A">here</a>.
166+
{% blocktrans with url=issue_url %}
167+
Report any build issues <a href="{{ url }}">here</a>.
175168
{% endblocktrans %}
176169
</p>
177170
</div>

0 commit comments

Comments
 (0)