summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2019-02-09 20:38:19 +0100
committerJelle van der Waa <jelle@archlinux.org>2019-02-18 16:42:51 +0100
commitb4552b9c15cfefdb135a11f119420d6d9badd673 (patch)
treee021fcee83c16b9994e3591f9f3cb97c1d214ab5
parent3daade6aea2ae79703ffdfdaea0e14e5c58d6a72 (diff)
downloadarchweb-b4552b9c15cfefdb135a11f119420d6d9badd673.tar.gz
archweb-b4552b9c15cfefdb135a11f119420d6d9badd673.zip
flag: move inline css to a separate file
CSP dissalows inline CSS styles so move the CSS to a separate file.
-rw-r--r--packages/tests.py4
-rw-r--r--sitestatic/flaghelp.css4
-rw-r--r--templates/packages/flaghelp.html7
3 files changed, 9 insertions, 6 deletions
diff --git a/packages/tests.py b/packages/tests.py
index fecf27b6..30185081 100644
--- a/packages/tests.py
+++ b/packages/tests.py
@@ -307,6 +307,10 @@ class FlagPackage(TestCase):
self.assertIn('Enter a valid and useful out-of-date message', response.content.decode())
self.assertEqual(len(mail.outbox), 0)
+ def test_flag_help(self):
+ response = self.client.get('/packages/flaghelp/')
+ self.assertEqual(response.status_code, 200)
+
class UnFlagPackage(TransactionTestCase):
fixtures = ['main/fixtures/arches.json', 'main/fixtures/repos.json',
diff --git a/sitestatic/flaghelp.css b/sitestatic/flaghelp.css
new file mode 100644
index 00000000..f02bad0a
--- /dev/null
+++ b/sitestatic/flaghelp.css
@@ -0,0 +1,4 @@
+body { background: #f6f9fc; color: #222; font-family: sans-serif; }
+a:link { text-decoration: none; color: #07b; }
+a:visited { color: #666; }
+a:hover { text-decoration: underline; color: #666; }
diff --git a/templates/packages/flaghelp.html b/templates/packages/flaghelp.html
index c6860264..579d3a1e 100644
--- a/templates/packages/flaghelp.html
+++ b/templates/packages/flaghelp.html
@@ -5,12 +5,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="icon" type="image/x-icon" href="{% static "favicon.ico" %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% static "favicon.ico" %}" />
- <style type="text/css" media="screen, projection">
- body { background: #f6f9fc; color: #222; font-family: sans-serif; }
- a:link { text-decoration: none; color: #07b; }
- a:visited { color: #666; }
- a:hover { text-decoration: underline; color: #666; }
- </style>
+ <link rel="stylesheet" type="text/css" href="{% static "flaghelp.css" %}" media="screen, projection" />
</head>
<body>
<h3>Flagging Packages</h3>