diff --git a/InvenTree/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js index b3209ca267..afc2a80755 100644 --- a/InvenTree/InvenTree/static/script/inventree/inventree.js +++ b/InvenTree/InvenTree/static/script/inventree/inventree.js @@ -1,14 +1,40 @@ function attachClipboard(selector) { - new ClipboardJS(selector, { + var cis = new ClipboardJS(selector, { text: function(trigger) { var content = trigger.parentElement.parentElement.textContent; return content.trim(); } }); + console.log(cis); } + +function attachmodalClipboard(selector) { + + new ClipboardJS(selector, { + text: function(trigger) { + var content = trigger.parentElement.parentElement.textContent; + return content.trim(); + }, + container: document.getElementById('modal-about') + }); +} + + +function AboutClipboard(selector) { + + new ClipboardJS(selector, { + text: function() { + console.log('about'); + return document.getElementById('about-copy-text').textContent; + }, + container: document.getElementById('modal-about') + }); +} + + function inventreeDocReady() { /* Run this function when the HTML document is loaded. * This will be called for every page that extends "base.html" @@ -62,6 +88,8 @@ function inventreeDocReady() { // Initialize clipboard-buttons attachClipboard('.clip-btn'); + attachmodalClipboard('.clip-btn'); + AboutClipboard('.clip-btn-version'); } diff --git a/InvenTree/templates/about.html b/InvenTree/templates/about.html index b1fb5ccd07..7d40388d3b 100644 --- a/InvenTree/templates/about.html +++ b/InvenTree/templates/about.html @@ -21,7 +21,7 @@ {% trans "InvenTree Version" %} - {% inventree_version %} + {% inventree_version %}{% include "clip.html" %} {% if up_to_date %} {% trans "Up to Date" %} {% else %} @@ -32,20 +32,20 @@ {% trans "Django Version" %} - {% django_version %} + {% django_version %}{% include "clip.html" %} {% inventree_commit_hash as hash %} {% if hash %} - {% trans "Commit Hash" %}{{ hash }} + {% trans "Commit Hash" %}{{ hash }}{% include "clip.html" %} {% endif %} {% inventree_commit_date as commit_date %} {% if commit_date %} - {% trans "Commit Date" %}{{ commit_date }} + {% trans "Commit Date" %}{{ commit_date }}{% include "clip.html" %} {% endif %} @@ -73,6 +73,14 @@ {% trans "Submit Bug Report" %} {% inventree_github_url %}issues + + + + + + + + diff --git a/InvenTree/templates/version.html b/InvenTree/templates/version.html new file mode 100644 index 0000000000..c8ec6862b6 --- /dev/null +++ b/InvenTree/templates/version.html @@ -0,0 +1,5 @@ +# Version Information:{% load inventree_extras %} +InvenTree-Version: {% inventree_version %} +Django Version: {% django_version %} +{% inventree_commit_hash as hash %}{% if hash %}Commit Hash: {{ hash }}{% endif %} +{% inventree_commit_date as commit_date %}{% if commit_date %}Commit Date: {{ commit_date }}{% endif %} \ No newline at end of file