From 0aa10d86cd3634c0adb37d65eba61afd9adc078b Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Sun, 15 Nov 2020 16:53:11 +0000 Subject: [PATCH] Improvements to profile detail page --- RIGS/static/js/clipboard.min.js | 7 +++ gulpfile.js | 1 + package.json | 1 + users/templates/profile_detail.html | 66 +++++++++++++++++------------ users/views.py | 5 +++ 5 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 RIGS/static/js/clipboard.min.js diff --git a/RIGS/static/js/clipboard.min.js b/RIGS/static/js/clipboard.min.js new file mode 100644 index 00000000..2d408a01 --- /dev/null +++ b/RIGS/static/js/clipboard.min.js @@ -0,0 +1,7 @@ +/*! + * clipboard.js v2.0.6 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,(function(){return n={},t.m=e=[function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),r=document.createRange();r.selectNodeContents(t),o.removeAllRanges(),o.addRange(r),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o + + + var clipboard = new ClipboardJS('.btn'); + + clipboard.on('success', function(e) { + $(e.trigger).popover('show'); + window.setTimeout(function () {$(e.trigger).popover('hide')}, 3000); + e.clearSelection(); + }); + {% endblock %} {% block content %} -

Profile: {{object.name}}

-{% if not request.is_ajax %} +{% if not request.is_ajax and object.pk == user.pk %}
- {% if object.pk == user.pk %} -
+ - {% endif %}
{% endif %}
-
+
@@ -76,7 +84,7 @@
{{object.initials}}
Phone
-
{% if object.phone %}}{% endif %}{{object.phone}}{% if object.phone %}}{% endif %}
+
{{object.phone|linkornone:'tel'}}
@@ -84,44 +92,44 @@
{% if not request.is_ajax and object.pk == user.pk %} -
+
+
Personal iCal Details
-

Personal iCal Details

API Key
-
+
{% if user.api_key %} - {{user.api_key}} + {{user.api_key}} + {% else %} No API Key Generated {% endif %} -
- + {% if user.api_key %}Reset API Key{% else %}Generate API Key{% endif %} - - -
Calendar Options
+ + +
Calendar Options
-
-