Skip to content

Commit

Permalink
Requested Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bansalnitish committed Feb 26, 2018
1 parent 100e2df commit da61c8e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
12 changes: 12 additions & 0 deletions readthedocs/builds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from urllib import quote

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


Expand Down
11 changes: 2 additions & 9 deletions readthedocs/templates/builds/build_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,8 @@ <h3>{% trans "Error" %}</h3>
{{ build.error }}
</p>
<p>
{% blocktrans with build_id=build.pk proj_name=build.project.name build_path=request.get_full_path user_name=request.user %}
Report any build issues <a href="https://github.com/rtfd/readthedocs.org/issues/new?
title=Build%20error%20with%20build%20id%20%23{{ build_id }}
&body=%23%23%20Details%0A%0A
*%20Project%20Url%3A%20https://readthedocs.org/projects/{{ proj_name }}/%0A
*%20Build%20URL%20(if%20applicable)%3A%20https://readthedocs.org{{ build_path }}%0A
*%20Read%20the%20Docs%20username%20(if%20applicable)%3A%20{{ user_name }}%0A%0A
%23%23%20Expected%20Result%0A%0A*%20A%20description%20of%20what%20you%20wanted%20to%20happen*%0A%0A
%23%23%20Actual%20Result%0A%0A*A%20description%20of%20what%20actually%20happened*%0A">here</a>.
{% blocktrans with url=issue_url %}
Report any build issues <a href="{{ url }}">here</a>.
{% endblocktrans %}
</p>
</div>
Expand Down

0 comments on commit da61c8e

Please sign in to comment.