From a3c0624a4a96c6536eccd388c569983da6cebab0 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Fri, 17 Nov 2017 12:13:12 +0100 Subject: [PATCH 001/384] Issue #1889. Embed the CSS from webcompat/design for easier refactoring. --- webcompat/templates/layout.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webcompat/templates/layout.html b/webcompat/templates/layout.html index 999c7f07f..906a63da4 100644 --- a/webcompat/templates/layout.html +++ b/webcompat/templates/layout.html @@ -27,11 +27,10 @@ -{%- if config.PRODUCTION or config.STAGING -%} - -{%- else %} - -{%- endif %} + + + +
From 23da95b4a389ffa606684d6e452cfb19568e8123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Bo=CC=88hm?= Date: Fri, 17 Nov 2017 19:50:55 +0100 Subject: [PATCH 002/384] Issue #1896 - refactor template: footer.html --- webcompat/templates/error.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webcompat/templates/error.html b/webcompat/templates/error.html index d35c701fc..0898bd15a 100644 --- a/webcompat/templates/error.html +++ b/webcompat/templates/error.html @@ -1,13 +1,13 @@ {% extends "layout.html" %} {% block body %} {% include "shared/nav.html" %} -
-
-

Yikes! {{ error_message }} ({{ error_code }})

-

(sound of broken glass)

+
+
+

Yikes! {{ error_message }} ({{ error_code }})

+

(sound of broken glass)



- Return home -
-
+ Return home +
+ {% endblock %} From 7018a54eb3444c05fa515ae9a47cf2fc18f41374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Bo=CC=88hm?= Date: Fri, 17 Nov 2017 20:51:37 +0100 Subject: [PATCH 003/384] Issue #1896 - use headline classes and spaces for indentation --- webcompat/templates/error.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webcompat/templates/error.html b/webcompat/templates/error.html index 0898bd15a..44ae8d6a1 100644 --- a/webcompat/templates/error.html +++ b/webcompat/templates/error.html @@ -2,12 +2,12 @@ {% block body %} {% include "shared/nav.html" %}
-
-

Yikes! {{ error_message }} ({{ error_code }})

-

(sound of broken glass)

+
+

Yikes! {{ error_message }} ({{ error_code }})

+

(sound of broken glass)



- Return home -
+ Return home +
{% endblock %} From b7e84dea83e6159794a4ac03c846a6a9335f0bb7 Mon Sep 17 00:00:00 2001 From: Martin Sonnenholzer Date: Fri, 17 Nov 2017 20:34:28 +0100 Subject: [PATCH 004/384] Issue #1892 - Refactor footer.html to use the new markup --- webcompat/templates/shared/footer.html | 54 ++++++++++++++------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/webcompat/templates/shared/footer.html b/webcompat/templates/shared/footer.html index a6fbdf973..637f7ce48 100644 --- a/webcompat/templates/shared/footer.html +++ b/webcompat/templates/shared/footer.html @@ -1,40 +1,44 @@ - From e407a98df591374f18373c1d9c981884a89aee79 Mon Sep 17 00:00:00 2001 From: Martin Sonnenholzer Date: Fri, 17 Nov 2017 20:45:33 +0100 Subject: [PATCH 005/384] Issue #1893 - Add prefixes to SVG symbols to avoid conflicts --- webcompat/templates/shared/footer.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webcompat/templates/shared/footer.html b/webcompat/templates/shared/footer.html index 637f7ce48..9c779d94a 100644 --- a/webcompat/templates/shared/footer.html +++ b/webcompat/templates/shared/footer.html @@ -27,7 +27,7 @@ Twitter - Twitter + Twitter @@ -35,7 +35,7 @@ github - Github + Github From a4e51c8abae8fc71ca8f0e6623876fdf27a40628 Mon Sep 17 00:00:00 2001 From: Martin Sonnenholzer Date: Fri, 17 Nov 2017 23:11:19 +0100 Subject: [PATCH 006/384] Issue #1892 - add svg-icons and aria-labels * add "compiled" svg from design project to this projects svg-icons.html * add include for svg-icons.html to layout * add aria-labels to the last links in the footer --- webcompat/templates/layout.html | 1 + webcompat/templates/shared/footer.html | 8 +- webcompat/templates/shared/svg-icons.html | 316 ++++++++++++++++++++++ 3 files changed, 321 insertions(+), 4 deletions(-) create mode 100644 webcompat/templates/shared/svg-icons.html diff --git a/webcompat/templates/layout.html b/webcompat/templates/layout.html index 906a63da4..4f4021c0d 100644 --- a/webcompat/templates/layout.html +++ b/webcompat/templates/layout.html @@ -33,6 +33,7 @@ + {% include "shared/svg-icons.html" %}
{% block body %}{% endblock %} {% include "shared/footer.html" %} diff --git a/webcompat/templates/shared/footer.html b/webcompat/templates/shared/footer.html index 9c779d94a..2060d305c 100644 --- a/webcompat/templates/shared/footer.html +++ b/webcompat/templates/shared/footer.html @@ -7,7 +7,7 @@ @@ -17,14 +17,14 @@
- {% include "shared/LightbulbwithBug.svg" %} + {# TODO - we removed outdated images - include "shared/LightbulbwithBug.svg" #}
diff --git a/webcompat/templates/home-page/hero.html b/webcompat/templates/home-page/hero.html index 53a881e1b..9b13ce4d5 100644 --- a/webcompat/templates/home-page/hero.html +++ b/webcompat/templates/home-page/hero.html @@ -18,7 +18,7 @@

- {% include "shared/LightbulbwithBug.svg" %} + {# TODO - we removed outdated images - include "shared/LightbulbwithBug.svg" #} From ff0f8774d01f38c1dbecc952d836cef36e35bcda Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Sat, 18 Nov 2017 13:53:51 +0100 Subject: [PATCH 011/384] Issue #1903 - Prefix SVG IDs for conflict avoidance --- webcompat/templates/addon-links.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webcompat/templates/addon-links.html b/webcompat/templates/addon-links.html index d0f43c039..2fd6aaff7 100644 --- a/webcompat/templates/addon-links.html +++ b/webcompat/templates/addon-links.html @@ -2,7 +2,7 @@ cloud-download - + Download our Firefox Add-on @@ -11,7 +11,7 @@ class="js-Navbar-link"> cloud-download - + Download our Firefox for Android Add-on @@ -20,7 +20,7 @@ class="js-Navbar-link"> cloud-download - + Download our Chrome Extension @@ -29,7 +29,7 @@ class="js-Navbar-link"> cloud-download - + Download our Opera Extension From 09ccbe95519b78fd77b19a3cbec2c7e930ad38b9 Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Sat, 18 Nov 2017 14:24:13 +0100 Subject: [PATCH 012/384] Issue #1882 - Follow up: Add Google Fonts to the CSP whitelist this will also be removed when the refactoring is done! --- webcompat/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webcompat/helpers.py b/webcompat/helpers.py index 2742cb117..6521c2320 100644 --- a/webcompat/helpers.py +++ b/webcompat/helpers.py @@ -499,7 +499,7 @@ def add_csp(response): get_img_src_policy() + "manifest-src 'self'; " + "script-src 'self' https://www.google-analytics.com https://api.github.com; " + # nopep8 - "style-src 'self' 'unsafe-inline'; " + + "style-src 'self' 'unsafe-inline' https://webcompat.github.io https://fonts.googleapis.com; " + "report-uri /csp-report" ) From 353f8c71911c322e77d476573ea34ad76444126b Mon Sep 17 00:00:00 2001 From: Dennis Schubert Date: Fri, 17 Nov 2017 19:51:53 +0100 Subject: [PATCH 013/384] Issue #1891 - Port the report form to the new style. --- webcompat/form.py | 5 +- webcompat/static/js/lib/issues.js | 6 +- webcompat/templates/home-page/form.html | 307 ++++++++++++------------ 3 files changed, 155 insertions(+), 163 deletions(-) diff --git a/webcompat/form.py b/webcompat/form.py index 14df59f2c..071e6334b 100644 --- a/webcompat/form.py +++ b/webcompat/form.py @@ -55,11 +55,10 @@ username_message = u'A valid username must be {0} characters long'.format( random.randrange(0, 99)) -desc_label = (u'Please describe what was wrong' - u' *') +desc_label = u'Please describe what was wrong' desc_message = u'An issue description is required.' -url_label = u'Site URL *' +url_label = u'Site URL' browser_test_label = u'Did you test in another browser?' textarea_label = u'What steps did you take before this problem occurred?' diff --git a/webcompat/static/js/lib/issues.js b/webcompat/static/js/lib/issues.js index ea0fdff5f..b3a61fc17 100644 --- a/webcompat/static/js/lib/issues.js +++ b/webcompat/static/js/lib/issues.js @@ -259,7 +259,7 @@ issues.ImageUploadView = Backbone.View.extend({ this.inputMap[id].valid = false; $(this.inputMap[id].elm) - .parents(".wc-Form-group") + .parents(".js-Form-group") .removeClass("wc-Form-noError js-no-error") .addClass("wc-Form-error js-form-error"); @@ -272,12 +272,12 @@ issues.ImageUploadView = Backbone.View.extend({ makeValid: function(id) { this.inputMap[id].valid = true; $(this.inputMap[id].elm) - .parents(".wc-Form-group") + .parents(".js-Form-group") .removeClass("wc-Form-error js-form-error") .addClass("wc-Form-noError js-no-error"); $(this.inputMap[id].elm) - .parents(".wc-Form-group") + .parents(".js-Form-group") .find(".wc-Form-helpInline") .remove(); diff --git a/webcompat/templates/home-page/form.html b/webcompat/templates/home-page/form.html index 086f2333d..0f7154d1f 100644 --- a/webcompat/templates/home-page/form.html +++ b/webcompat/templates/home-page/form.html @@ -1,166 +1,159 @@ -
-
-
- {%- if request.url_rule.endpoint == 'create_issue' %} -

Report Site Issue

- {%- endif %} -
-
-
-
- {{ form.url.label(class_='wc-Form-label') }} - {% if form.url.errors %} - {% for error in form.url.errors %} - {{ error }} - {% endfor %} - {% endif %} -
- - {{ form.url(class_='wc-Form-item required', - placeholder='e.g. https://example.com', - required=True, type='url', pattern='') }} - -
- -
-
-
- - {% if form.problem_category.errors %}{% for error in form.problem_category.errors %} - {{ error }} - {% endfor %}{% endif %} -
- {% for subradio in form.problem_category %} -
- {{ subradio }} {{ subradio.label }} -
- {% endfor %} -
-
+ {%- if request.url_rule.endpoint == 'create_issue' %} +

Report Site Issue

+ {%- endif %} -
-
- {{ form.description.label(class_='wc-Form-label') }} - {% if form.description.errors %} - {% for error in form.description.errors %} - {{ error }} - {% endfor %} - {% endif %} -
- - {{ form.description(class_='wc-Form-item required', - placeholder="e.g. The video doesn't play", - required=True, type='text', pattern='') }} - -
-
- {{ form.steps_reproduce.label(class_='wc-Form-label') }} - {{ form.steps_reproduce(class_='wc-Form-item wc-Form-item--textarea', - rows=4, - placeholder="Please be as detailed as possible.") }} -
+ +
+
+
+ {{ form.url.label(class_='form-label form-required wc-Form-label') }} + {% if form.url.errors %} + {% for error in form.url.errors %} + {{ error }} + {% endfor %} + {% endif %} +
+ + {{ form.url(class_='form-field text-field wc-Form-item required', + placeholder='e.g. https://example.com', + required=True, type='url', pattern='') }} + +
+
+
+ + {% if form.problem_category.errors %} + {% for error in form.problem_category.errors %} + {{ error }} + {% endfor %} + {% endif %}
-
- -
- {{ form.browser.label(class_='wc-Form-label') }} - - {{ form.browser(class_='wc-Form-item') }} - - - {{ form.os(class_='wc-Form-item') }} - -
- -
-
-
- {{ form.browser_test.label(class_='wc-Form-label') }} - {% if form.browser_test.errors %}{% for error in form.browser_test.errors %} - {{ error }} - {% endfor %}{% endif %} -
-
- {% for subradio in form.browser_test %} - {{ subradio }} {{ subradio.label }} - {% endfor %} -
-
-
- -
- -
- -
-
- - -
-
-
+ {% for subradio in form.problem_category %} + {{ subradio(class_='input-radio') }} + {{ subradio.label(class_='form-label label-radio') }} + {% endfor %} +
+
+
+ {{ form.description.label(class_='form-label form-required wc-Form-label') }} + {% if form.description.errors %} + {% for error in form.description.errors %} + {{ error }} + {% endfor %} + {% endif %}
+ + {{ form.description(class_='form-field text-field wc-Form-item required', + placeholder="e.g. The video doesn't play", + required=True) }} + +
+
+ {{ form.steps_reproduce.label(class_='form-label wc-Form-label') }} + {{ form.steps_reproduce(class_='form-field text-field wc-Form-item', + rows=4, + placeholder="Please be as detailed as possible.") }} +
+
+
+
+ {{ form.browser.label(class_='wc-Form-label') }} + + {{ form.browser(class_='form-field text-field wc-Form-item') }} + + + + {{ form.os(class_='form-field text-field wc-Form-item') }} + +
- + {{ form.hidden_tag() }} +
From 67d98c410ecd332022398584c936a0df0c79c74d Mon Sep 17 00:00:00 2001 From: Martin Sonnenholzer Date: Fri, 17 Nov 2017 23:07:33 +0100 Subject: [PATCH 014/384] ISSUE #1902 - waiting for the /webcompat/design/issues/31 to solve the problem with the search the same way --- webcompat/templates/addon-links.html | 88 +++++++++++------ webcompat/templates/topbar.html | 141 ++++++++++++++++++++------- 2 files changed, 162 insertions(+), 67 deletions(-) diff --git a/webcompat/templates/addon-links.html b/webcompat/templates/addon-links.html index 2fd6aaff7..9eefacd98 100644 --- a/webcompat/templates/addon-links.html +++ b/webcompat/templates/addon-links.html @@ -1,38 +1,62 @@ + + + {%- if browser == 'firefox' %} - - - cloud-download - - - Download our Firefox Add-on - + {%- elif browser == 'firefox mobile' -%} - - - cloud-download - - - Download our Firefox for Android Add-on - + {%- elif browser == 'chrome' -%} - - - cloud-download - - - Download our Chrome Extension - + {%- elif browser == 'opera' -%} - - - cloud-download - - - Download our Opera Extension - + {%- else -%} -Give Feedback + {%- endif -%} diff --git a/webcompat/templates/topbar.html b/webcompat/templates/topbar.html index f489c5360..0eb97c153 100644 --- a/webcompat/templates/topbar.html +++ b/webcompat/templates/topbar.html @@ -1,36 +1,107 @@ -