File tree 2 files changed +14
-9
lines changed
2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 11
11
from django .contrib .auth .decorators import login_required
12
12
from django .core .urlresolvers import reverse
13
13
from django .utils .decorators import method_decorator
14
+ from requests .utils import quote
14
15
15
16
from readthedocs .builds .models import Build , Version
16
17
from readthedocs .core .utils import trigger_build
@@ -82,6 +83,17 @@ class BuildDetail(BuildBase, DetailView):
82
83
def get_context_data (self , ** kwargs ):
83
84
context = super (BuildDetail , self ).get_context_data (** kwargs )
84
85
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
85
97
return context
86
98
87
99
Original file line number Diff line number Diff line change @@ -163,15 +163,8 @@ <h3>{% trans "Error" %}</h3>
163
163
{{ build.error }}
164
164
</ p >
165
165
< 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 > .
175
168
{% endblocktrans %}
176
169
</ p >
177
170
</ div >
You can’t perform that action at this time.
0 commit comments