From 96297fa6d1a81108f12980d69ea7fcf25eb4c172 Mon Sep 17 00:00:00 2001 From: Decky Coss Date: Tue, 15 Mar 2016 23:26:16 -0400 Subject: [PATCH 1/4] Issue #741: Display bug report origin on GitHub --- webcompat/form.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webcompat/form.py b/webcompat/form.py index e5617c596..89fa1b989 100644 --- a/webcompat/form.py +++ b/webcompat/form.py @@ -26,6 +26,7 @@ PROXY_REPORT = 'github-proxy-report' SCHEMES = ('http://', 'https://') BAD_SCHEMES = ('http:/', 'https:/', 'http:', 'https:') +GITHUB_HELP = '

This issue was filed via webcompat.com

' # nopep8 problem_choices = [ (u'detection_bug', u'Desktop site instead of mobile site'), @@ -196,11 +197,13 @@ def build_formdata(form_object): 'browser': form_object.get('browser'), 'os': form_object.get('os'), 'problem_type': get_problem(form_object.get('problem_category')), - 'description': form_object.get('description') + 'description': form_object.get('description'), + 'help_message': GITHUB_HELP } # Preparing the body body = u'''{browser_label}{ua_label} +{help_message} **URL**: {url} **Browser / Version**: {browser} **Operating System**: {os} From 46a5165791ea2720fab21c9cab4d87abbb5d61e5 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Sun, 3 Apr 2016 19:29:46 -0700 Subject: [PATCH 2/4] Issue #741. Move help_message below bug body. --- webcompat/form.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webcompat/form.py b/webcompat/form.py index 89fa1b989..189d7bf96 100644 --- a/webcompat/form.py +++ b/webcompat/form.py @@ -203,7 +203,6 @@ def build_formdata(form_object): # Preparing the body body = u'''{browser_label}{ua_label} -{help_message} **URL**: {url} **Browser / Version**: {browser} **Operating System**: {os} @@ -211,6 +210,8 @@ def build_formdata(form_object): **Steps to Reproduce** {description} + +{help_message} '''.format(**formdata) # Add the image, if there was one. if form_object.get('image_upload') is not None: From 9455b269ef8bf700a8ef7d6992ed2549ac94897d Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Sun, 3 Apr 2016 20:12:04 -0700 Subject: [PATCH 3/4] Issue #741. Tweak "From webcompat" messaging a bit. --- webcompat/form.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webcompat/form.py b/webcompat/form.py index 189d7bf96..ea4c77d1e 100644 --- a/webcompat/form.py +++ b/webcompat/form.py @@ -26,7 +26,7 @@ PROXY_REPORT = 'github-proxy-report' SCHEMES = ('http://', 'https://') BAD_SCHEMES = ('http:/', 'https:/', 'http:', 'https:') -GITHUB_HELP = '

This issue was filed via webcompat.com

' # nopep8 +GITHUB_HELP = u'_From [webcompat.com](https://webcompat.com/) with ❤️_' problem_choices = [ (u'detection_bug', u'Desktop site instead of mobile site'), @@ -197,8 +197,7 @@ def build_formdata(form_object): 'browser': form_object.get('browser'), 'os': form_object.get('os'), 'problem_type': get_problem(form_object.get('problem_category')), - 'description': form_object.get('description'), - 'help_message': GITHUB_HELP + 'description': form_object.get('description') } # Preparing the body @@ -211,12 +210,13 @@ def build_formdata(form_object): **Steps to Reproduce** {description} -{help_message} '''.format(**formdata) # Add the image, if there was one. if form_object.get('image_upload') is not None: body += '\n\n![Screenshot of the site issue]({image_url})'.format( image_url=form_object.get('image_upload').get('url')) + # Append "from webcompat.com" message to bottom (for GitHub issue viewers) + body += u'\n\n{0}'.format(GITHUB_HELP) result = {} result['title'] = summary result['body'] = body From 76fb9d19e9f6927c2b60f4c37b454264e46826ab Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Sun, 3 Apr 2016 20:13:47 -0700 Subject: [PATCH 4/4] Issue #741. Hide "From webcompat" message from UI --- webcompat/static/js/lib/issues.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webcompat/static/js/lib/issues.js b/webcompat/static/js/lib/issues.js index 9a2d28070..fd2b8997e 100644 --- a/webcompat/static/js/lib/issues.js +++ b/webcompat/static/js/lib/issues.js @@ -140,13 +140,21 @@ issues.BodyView = Backbone.View.extend({ render: function() { this.$el.html(this.template(this.model.toJSON())); // hide metadata - $('.js-Issue-markdown') + var issueDesc = $('.js-Issue-markdown'); + issueDesc .contents() .filter(function() { //find the bare html comment-ish text nodes return this.nodeType === 3 && this.nodeValue.match(/