Browse Source

[fix] new_issue.html: drop inline style attributes (CSP conformance)

Inline styles are blocked by default with Content Security Policy (CSP).  Move
the inline styles from 'new_issue.html' to::

    searx/static/themes/__common__/less/new_issue.less

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Markus Heiser 4 years ago
parent
commit
70cc196e2d

+ 14 - 0
searx/static/themes/__common__/less/new_issue.less

@@ -0,0 +1,14 @@
+.github-issue-button {
+  display: block;
+  padding: 8px 16px;
+  font-family: sans-serif;
+  font-size: 16px;
+  color: white;
+  background-color: #238636 !important; /* important is needed cause to an !important in logicodev-dark */
+  border: #2ea043;
+  border-radius: 10px !important;
+  box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;
+}
+.github-issue-button:hover {
+  background-color: #2ea043;
+}

+ 1 - 0
searx/static/themes/oscar/src/less/logicodev-dark/oscar.less

@@ -1,4 +1,5 @@
 @import "../logicodev/variables.less";
+@import "../../../../__common__/less/new_issue.less";
 
 @stacked-bar-chart: rgb(213, 216, 215, 1);
 

+ 1 - 10
searx/static/themes/oscar/src/less/logicodev/oscar.less

@@ -1,23 +1,14 @@
 @import "variables.less";
+@import "../../../../__common__/less/new_issue.less";
 
 @import "navbar.less";
-
 @import "footer.less";
-
 @import "checkbox.less";
-
 @import "onoff.less";
-
 @import "results.less";
-
 @import "infobox.less";
-
 @import "search.less";
-
 @import "advanced.less";
-
 @import "cursor.less";
-
 @import "code.less";
-
 @import "preferences.less";

+ 1 - 11
searx/static/themes/oscar/src/less/pointhi/oscar.less

@@ -1,25 +1,15 @@
 @import "variables.less";
+@import "../../../../__common__/less/new_issue.less";
 
 @import "footer.less";
-
 @import "checkbox.less";
-
 @import "onoff.less";
-
 @import "results.less";
-
 @import "infobox.less";
-
 @import "search.less";
-
 @import "advanced.less";
-
 @import "cursor.less";
-
 @import "code.less";
-
 @import "navbar.less";
-
 @import "code.less";
-
 @import "preferences.less";

+ 2 - 0
searx/static/themes/simple/less/style.less

@@ -6,6 +6,8 @@
 
 @stacked-bar-chart: rgb(0, 0, 0);
 
+@import "../../__common__/less/new_issue.less";
+
 @import "normalize.less";
 
 @import "definitions.less";

+ 1 - 18
searx/templates/__common__/new_issue.html

@@ -10,7 +10,7 @@
 in order to fetch the latest commit ID:
 ```
 git log -1
-``` 
+```
 If you are using searx-docker then look at the bottom of the SearXNG page
 and check for the version after "Powered by SearXNG"
 
@@ -52,23 +52,6 @@ or manually by executing the searx/webapp.py file? -->
 {{-'\n  '}}* {{ test_name }}: {% for result in results%}`{{ result }}`,{% endfor -%}
 {%- endfor -%}
     </textarea>
-    <style>
-        .github-issue-button { 
-            display: block;
-            padding: 8px 16px;
-            font-family: sans-serif;
-            font-size: 16px;
-            color: white;
-            background-color: rgb(35, 134, 54);
-            border: rgb(46, 160, 67);
-            border-radius: 10px !important;
-            box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;
-        }
-
-        .github-issue-button:hover {
-            background-color: rgb(46, 160, 67);
-        }
-    </style>
     <button type="submit" class="github-issue-button" title="{{ new_issue_url }}">{{ _('Submit a new issue on Github including the above information') }}</button>
 </form>
 {% endmacro %}