mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-16 21:12:13 +00:00
QOL: Add copy to clipboard buttons to emails on event auth request modal
This commit is contained in:
@@ -1,8 +1,24 @@
|
||||
{% extends request.is_ajax|yesno:'base_ajax.html,base_rigs.html' %}
|
||||
{% load widget_tweaks %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Request Authorisation{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script src="{% static 'js/tooltip.js' %}"></script>
|
||||
<script src="{% static 'js/popover.js' %}"></script>
|
||||
<script src="{% static 'js/clipboard.min.js' %}"></script>
|
||||
<script>
|
||||
var clipboard = new ClipboardJS('.btn');
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
$(e.trigger).popover('show');
|
||||
window.setTimeout(function () {$(e.trigger).popover('hide')}, 3000);
|
||||
e.clearSelection();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@@ -14,10 +30,10 @@
|
||||
<div class="alert alert-info">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Person Email</dt>
|
||||
<dd>{{ object.person.email }}</dd>
|
||||
<dd id="person-email">{{ object.person.email }}</dd>{% if object.person.email %}<button class="btn btn-secondary btn-sm pr-1" data-clipboard-target="#person-email" data-content="Copied to clipboard!"><span class="fas fa-clipboard"></span></button>{% endif %}
|
||||
|
||||
<dt>Organisation Email</dt>
|
||||
<dd>{{ object.organisation.email }}</dd>
|
||||
<dd id="org-email">{{ object.organisation.email }}</dd>{% if object.organisation.email %}<button class="btn btn-secondary btn-sm pr-1" data-clipboard-target="#org-email" data-content="Copied to clipboard!"><span class="fas fa-clipboard"></span></button>{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
<form action="{{ form.action|default:request.path }}" method="POST" id="auth-request-form">
|
||||
|
||||
@@ -101,11 +101,11 @@
|
||||
<dd class="col-8">
|
||||
{% if user.api_key %}
|
||||
<code id="api-key">{{user.api_key}}</code>
|
||||
<button class="btn btn-secondary align-middle" data-clipboard-target="#api-key" data-content="Copied to clipboard!"><span class="fas fa-clipboard"></span></button>
|
||||
<button class="btn btn-secondary align-middle pr-1 btn-sm" data-clipboard-target="#api-key" data-content="Copied to clipboard!"><span class="fas fa-clipboard"></span></button>
|
||||
{% else %}
|
||||
<span id="api-key">No API Key Generated</span>
|
||||
{% endif %}
|
||||
<a href="{% url 'reset_api_key' %}" class="btn btn-secondary align-middle">
|
||||
<a href="{% url 'reset_api_key' %}" class="btn btn-secondary align-middle pr-1">
|
||||
{% if user.api_key %}Reset API Key{% else %}Generate API Key{% endif %}
|
||||
<span class="fas fa-redo"></span>
|
||||
</a>
|
||||
@@ -139,7 +139,7 @@
|
||||
<dd class="col-8">
|
||||
{% if user.api_key %}
|
||||
<code id="cal-url" data-url="http{{ request.is_secure|yesno:"s,"}}://{{ request.get_host }}{% url 'ics_calendar' api_pk=user.pk api_key=user.api_key %}"></code>
|
||||
<button class="btn btn-secondary align-middle" data-clipboard-target="#cal-url" data-content="Copied to clipboard!"><span class="fas fa-clipboard"></span></button>
|
||||
<button class="btn btn-secondary align-middle btn-sm pr-1" data-clipboard-target="#cal-url" data-content="Copied to clipboard!"><span class="fas fa-clipboard"></span></button>
|
||||
<br>
|
||||
<small><a id="gcal-link" data-url="https://support.google.com/calendar/answer/37100" href="">Click here</a> for instructions on adding to google calendar.<br/>
|
||||
To sync from Google Calendar to mobile device, visit <a href="https://www.google.com/calendar/syncselect" target="_blank">this page</a> on your device and tick "RIGS Calendar".</small>
|
||||
|
||||
Reference in New Issue
Block a user