aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates/wiki/plugins/links
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2019-04-14 15:04:28 +0100
committerGravatar Gareth Coles <[email protected]>2019-04-14 15:04:28 +0100
commit7992729e29a18f67c6b3324a64a8fc4e58f5acb8 (patch)
tree6dfb7c161edf6d789b01542bb12bfd2b2de5a2ca /pydis_site/templates/wiki/plugins/links
parentFixing up image plugin (diff)
Remove attachments plugin, add plugin templates
Diffstat (limited to 'pydis_site/templates/wiki/plugins/links')
-rw-r--r--pydis_site/templates/wiki/plugins/links/sidebar.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/pydis_site/templates/wiki/plugins/links/sidebar.html b/pydis_site/templates/wiki/plugins/links/sidebar.html
new file mode 100644
index 00000000..45096edd
--- /dev/null
+++ b/pydis_site/templates/wiki/plugins/links/sidebar.html
@@ -0,0 +1,44 @@
+{% load i18n sekizai_tags static %}
+
+<h4>{% trans "Link to another wiki page" %}</h4>
+
+<p>
+ {% trans "Type in something from another wiki page's title and auto-complete will help you create a tag for your wiki link. Tags for links look like this:" %}<br />
+</p>
+
+<pre>[Title of link](wiki:ArticleSlug)</pre>
+
+<div class="input-group">
+ <input type="text" class="page_title_query form-control" id="links_page_title_query" value="" placeholder="Type to search..." />
+ <span class="input-group-btn">
+ <button type="button" class="btn btn-default" onclick="wikiInsertLink()">
+ {% trans "Insert" %}
+ </button>
+ </span>
+</div>
+
+<hr />
+
+<h4>{% trans "An external link" %}</h4>
+
+<p>
+ {% trans "You can link to another website simply by inserting an address example.com or http://example.com or by using the markdown syntax:" %}<br />
+</p>
+<pre>[Clickable text](http://example.com)</pre>
+
+{% addtoblock "js" %}<script type="text/javascript" src="{% static "wiki/js/typeahead.min.js" %}"></script>{% endaddtoblock %}
+{% addtoblock "js" %}
+<script type="text/javascript">
+ $(document).ready(function() {
+ $('.page_title_query').typeahead({
+ remote: "{% url 'wiki:links_query_urlpath' path=urlpath.path article_id=article.id %}?query=%QUERY",
+ dataType: String
+ });
+ });
+
+function wikiInsertLink() {
+ $('#id_content').insertAtCaret($('#links_page_title_query').val());
+}
+
+</script>
+{% endaddtoblock %}