Add Report Issue ribbon 55/11155/6
authorThanh Ha <thanh.ha@linuxfoundation.org>
Sun, 10 Jun 2018 04:14:53 +0000 (00:14 -0400)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Tue, 12 Jun 2018 21:57:58 +0000 (17:57 -0400)
Add a ribbon on the top right of the page which when clicked will
direct the reader to LF Jira to open an issue with the doc. It also
prefills the description with the version of dosc and current page
the user was viewing when they clicked the ribbon.

Change-Id: If8be81ec7a1c4a9b7b4ed21e5cafe65c98845e42
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
docs/_static/css/ribbon.css [new file with mode: 0644]
docs/_templates/layout.html [new file with mode: 0644]
docs/conf.py

diff --git a/docs/_static/css/ribbon.css b/docs/_static/css/ribbon.css
new file mode 100644 (file)
index 0000000..e95d3bf
--- /dev/null
@@ -0,0 +1,36 @@
+.ribbon {
+  z-index: 1000;
+  background-color: #a00;
+  overflow: hidden;
+  white-space: nowrap;
+  position: fixed;
+  top: 70px;
+  right: -50px;
+  -webkit-transform: rotate(45deg);
+     -moz-transform: rotate(45deg);
+      -ms-transform: rotate(45deg);
+       -o-transform: rotate(45deg);
+          transform: rotate(45deg);
+  -webkit-box-shadow: 0 0 10px #888;
+     -moz-box-shadow: 0 0 10px #888;
+          box-shadow: 0 0 10px #888;
+
+}
+
+.ribbon a {
+  border: 1px solid #faa;
+  color: #fff;
+  display: block;
+  font: bold 81.25% 'Helvetica Neue', Helvetica, Arial, sans-serif;
+  margin: 1px 0;
+  padding: 10px 50px;
+  text-align: center;
+  text-decoration: none;
+  text-shadow: 0 0 5px #444;
+  transition: 0.5s;
+}
+
+.ribbon a:hover {
+  background: #c11;
+  color: #fff;
+}
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
new file mode 100644 (file)
index 0000000..9f337f0
--- /dev/null
@@ -0,0 +1,17 @@
+{# Import the theme's layout. #}
+{% extends "!layout.html" %}
+
+{# Ribbon #}
+{% block content %}
+  <div class="ribbon">
+    <a href="https://jira.linuxfoundation.org/secure/CreateIssueDetails!init.jspa
+?pid=11415
+&issuetype=10001
+&components=10801
+&priority=2
+&description=version:+{{version}}%0Apage:+{{pagename}}%0A%0A">
+      Report Issue
+    </a>
+  </div>
+  {{ super() }}
+{% endblock %}
index 951d14b..859ba7e 100644 (file)
@@ -30,3 +30,6 @@ linkcheck_ignore = [
     'https://.*.example.org.*',
     'https://git.opendaylight.org/gerrit/#/settings/gpg-keys',
 ]
+
+def setup(app):
+    app.add_stylesheet("css/ribbon.css")