diff --git a/nyaa/static/js/main.js b/nyaa/static/js/main.js index 4cb58df..8eb3624 100644 --- a/nyaa/static/js/main.js +++ b/nyaa/static/js/main.js @@ -260,6 +260,16 @@ document.addEventListener("DOMContentLoaded", function() { } }); +// Info bubble stuff +document.addEventListener("DOMContentLoaded", function() { + var bubble = document.getElementById('infobubble'); + if (Number(localStorage.getItem('infobubble_dismiss_ts')) < Number(bubble.dataset.ts)) { + bubble.removeAttribute('hidden'); + } + $('#infobubble').on('close.bs.alert', function () { + localStorage.setItem('infobubble_dismiss_ts', bubble.dataset.ts); + }) +}); // Decode HTML entities (> etc), used for decoding comment markdown from escaped text function htmlDecode(input){ diff --git a/nyaa/templates/home.html b/nyaa/templates/home.html index ae44076..a80641e 100644 --- a/nyaa/templates/home.html +++ b/nyaa/templates/home.html @@ -12,10 +12,7 @@ {% block body %} {% if not search.term %} -
-

We welcome you to provide feedback on IRC at #nyaa-dev@irc.rizon.net

-

Our GitHub: https://github.com/nyaadevs - creating issues for features and faults is recommended!

-
+{% include "infobubble.html" %} {% endif %} {% include "search_results.html" %} diff --git a/nyaa/templates/infobubble.html b/nyaa/templates/infobubble.html new file mode 100644 index 0000000..4926837 --- /dev/null +++ b/nyaa/templates/infobubble.html @@ -0,0 +1,14 @@ +{% import "infobubble_content.html" as info %} +{% if info.info_text %} + + +{% endif %} diff --git a/nyaa/templates/infobubble_content.html b/nyaa/templates/infobubble_content.html new file mode 100644 index 0000000..e6289f0 --- /dev/null +++ b/nyaa/templates/infobubble_content.html @@ -0,0 +1,3 @@ +{% set info_text = "Put your announcements here!" %} +{# Update this to a larger timestamp if you change your announcement #} +{% set info_ts = 1531215917 %}