mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-08 22:17:34 +01:00
Add open link to forum topic ID field
This commit is contained in:
parent
66ee706a6c
commit
515248eb8b
@ -21,4 +21,12 @@ $(function() {
|
||||
console.log("Not a URL");
|
||||
}
|
||||
});
|
||||
|
||||
var btn = $("#forums").parent().find("label").append("<a class='ml-3 btn btn-sm btn-primary'>Open</a>");
|
||||
btn.click(function() {
|
||||
var id = $("#forums").val();
|
||||
if (/^\d+$/.test(id)) {
|
||||
window.open("https://forum.minetest.net/viewtopic.php?t=" + id, "_blank");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
@ -22,7 +22,7 @@
|
||||
</div>
|
||||
</noscript>
|
||||
{% endif %}
|
||||
<script src="/static/package_edit.js"></script>
|
||||
<script src="/static/package_edit.js?v=2"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
@ -87,7 +87,7 @@
|
||||
|
||||
{{ render_field(form.website, class_="pkg_meta") }}
|
||||
{{ render_field(form.issueTracker, class_="pkg_meta") }}
|
||||
{{ render_field(form.forums, class_="pkg_meta") }}
|
||||
{{ render_field(form.forums, class_="pkg_meta", placeholder="Tip: paste in a forum topic URL") }}
|
||||
</fieldset>
|
||||
|
||||
<div class="pkg_meta">{{ render_submit_field(form.submit) }}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user