mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 04:20:17 +02:00
remove temps from more templates
This commit is contained in:
parent
baf3c85ac7
commit
168e6cc290
@ -11,9 +11,9 @@
|
||||
{% endblock header_nav_brand %}
|
||||
|
||||
{% block content %}
|
||||
<div class="allianceauth-mumbletemps">
|
||||
<div class="allianceauth-mumble">
|
||||
<div class="row">
|
||||
{% block mumbletemps %}{% endblock %}
|
||||
{% block mumble %}{% endblock mumble %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,10 +1,9 @@
|
||||
{% extends "mumbletemps/base.html" %}
|
||||
{% extends "services/mumble/base.html" %}
|
||||
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% load timetags %}
|
||||
|
||||
{% block mumbletemps %}
|
||||
{% block mumble %}
|
||||
<div class="col-md-6 mb-2">
|
||||
<div class="card h-100">
|
||||
<div class="card-header bg-warning">
|
||||
@ -13,20 +12,29 @@
|
||||
|
||||
<div class="card-body text-center">
|
||||
<p>
|
||||
{% translate 'Temp Links Give Access to mumble with the <b class="text-success">Guest</b> Group for the preset time.' %}
|
||||
{% blocktranslate trimmed with bold_start="<b>" bold_end="</b>" %}
|
||||
Temp Links Give Access to mumble with the {{ bold_start }}Guest{{ bold_end }} Group for the preset time
|
||||
{% endblocktranslate %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% translate 'Connected users <b class="text-warning">will not</b> be kicked at the end of this period.' %}
|
||||
{% blocktranslate trimmed with bold_start="<b class='text-warning'>" bold_end="</b>" %}
|
||||
Connected users {{ bold_start }}will not{{ bold_end }} be kicked at the end of this period.
|
||||
{% endblocktranslate %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% translate 'Templink users can be kicked in mumble by typing <span class="badge bg-danger">!kicktemps</span> in mumble chat.' %}
|
||||
{% blocktranslate trimmed with badge_start="<span class='badge bg-danger'>" badge_end="</span>" %}
|
||||
Templink users can be kicked in mumble by typing {{ badge_start }}!kicktemps{{ badge_end }} in mumble chat.
|
||||
{% endblocktranslate %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{% translate 'There are <b class="text-warning">no restrictions</b> on who or how many can use a templink, share wisely.' %}
|
||||
{% blocktranslate trimmed with bold_start="<b class='text-warning'>" bold_end="</b>" %}
|
||||
There are {{ bold_start }}no restrictions{{ bold_end }} on who or how many can use a templink, share wisely.
|
||||
{% endblocktranslate %}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,7 +48,7 @@
|
||||
<div class="card-body text-center">
|
||||
<p>{% translate "Your link will be displayed on the next page for an easy copy and paste." %}</p>
|
||||
|
||||
<form action="{% url 'mumbletemps:index' %}" method="post">
|
||||
<form action="{% url 'mumble:index' %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="mb-3">
|
||||
@ -71,9 +79,9 @@
|
||||
{% translate "Expires in" %}: <span id="countdown{{ tl.link_ref }}hot"></span>
|
||||
</p>
|
||||
|
||||
<pre>{{ SITE_URL }}{% url 'mumbletemps:join' tl.link_ref %}</pre>
|
||||
<pre>{{ SITE_URL }}{% url 'mumble:join' tl.link_ref %}</pre>
|
||||
|
||||
<button class="btn btn-info" id="clipboard-new" data-clipboard-text="{{ SITE_URL }}{% url 'mumbletemps:join' tl.link_ref %}">
|
||||
<button class="btn btn-info" id="clipboard-new" data-clipboard-text="{{ SITE_URL }}{% url 'mumble:join' tl.link_ref %}">
|
||||
{% translate "Copy to Clipboard!" %}
|
||||
</button>
|
||||
</div>
|
||||
@ -116,13 +124,13 @@
|
||||
<td class="text-center">
|
||||
<button class="btn btn-info"
|
||||
id="clipboard-{{ lnk.link_ref }}"
|
||||
data-clipboard-text="{{ SITE_URL }}{% url 'mumbletemps:join' lnk.link_ref %}">
|
||||
data-clipboard-text="{{ SITE_URL }}{% url 'mumble:join' lnk.link_ref %}">
|
||||
{% translate "Copy to Clipboard!" %}
|
||||
</button>
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<a class="btn btn-danger" href="{% url 'mumbletemps:nuke' lnk.link_ref %}">{% translate "Nuke Link!" %}</a>
|
||||
<a class="btn btn-danger" href="{% url 'mumble:nuke' lnk.link_ref %}">{% translate "Nuke Link!" %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -162,7 +170,7 @@
|
||||
<td class="text-center">{{ lnk.link_ref }}</td>
|
||||
|
||||
<td class="text-center">
|
||||
<a class="btn btn-danger" href="{% url 'mumbletemps:nuke' lnk.link_ref %}">{% translate "Nuke Link!" %}</a>
|
||||
<a class="btn btn-danger" href="{% url 'mumble:nuke' lnk.link_ref %}">{% translate "Nuke Link!" %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -172,103 +180,18 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock mumbletemps %}
|
||||
{% endblock mumble %}
|
||||
|
||||
{% block extra_javascript %}
|
||||
{% include 'bundles/clipboard-js.html' %}
|
||||
{% include "bundles/clipboard-js.html" %}
|
||||
|
||||
<script>
|
||||
/* global ClipboardJS, moment */
|
||||
/* global ClipboardJS */
|
||||
const clipboard = new ClipboardJS('#clipboard-new');
|
||||
|
||||
{
|
||||
%
|
||||
for lnk in tl_list %
|
||||
}
|
||||
const lnk {
|
||||
{
|
||||
lnk.link_ref
|
||||
}
|
||||
} = new ClipboardJS('#clipboard-{{ lnk.link_ref }}'); {
|
||||
% endfor %
|
||||
}
|
||||
{% for lnk in tl_list %}
|
||||
const lnk{{ lnk.link_ref }} = new ClipboardJS('#clipboard-{{ lnk.link_ref }}');
|
||||
{% endfor %}
|
||||
</script>
|
||||
|
||||
{% include "bundles/moment-js.html" with locale=True %}
|
||||
{% include "bundles/timers-js.html" %}
|
||||
|
||||
<script>
|
||||
const locale = '{{ LANGUAGE_CODE }}';
|
||||
|
||||
const timers = [{
|
||||
%
|
||||
for lnk in tl_list %
|
||||
} {
|
||||
'id': "{{ lnk.link_ref }}",
|
||||
'targetDate': moment("{{ lnk.expires|print_timestamp| date:"
|
||||
c " }}"),
|
||||
'expired': false
|
||||
}, {
|
||||
% endfor %
|
||||
}
|
||||
|
||||
{
|
||||
%
|
||||
if tl %
|
||||
} {
|
||||
'id': "{{ tl.link_ref }}hot",
|
||||
'targetDate': moment('{{ tl.expires|print_timestamp| date:"c" }}'),
|
||||
'expired': false
|
||||
}, {
|
||||
% endif %
|
||||
}
|
||||
];
|
||||
|
||||
moment.locale(locale);
|
||||
|
||||
/**
|
||||
* Update a timer
|
||||
*
|
||||
* @param timer
|
||||
*/
|
||||
const updateTimer = (timer) => {
|
||||
if (timer.targetDate.isAfter(Date.now())) {
|
||||
const duration = moment.duration(timer.targetDate - moment(), 'milliseconds');
|
||||
|
||||
document.getElementById('countdown' + timer.id).innerHTML = getDurationString(duration);
|
||||
} else {
|
||||
timer.expired = true;
|
||||
|
||||
document.getElementById('countdown' + timer.id).innerHTML = '';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update all timers
|
||||
*/
|
||||
const updateAllTimers = () => {
|
||||
const l = timers.length;
|
||||
|
||||
for (let i = 0; i < l; ++i) {
|
||||
if (timers[i].expired) {
|
||||
continue;
|
||||
}
|
||||
|
||||
updateTimer(timers[i]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Timed update function
|
||||
*/
|
||||
const timedUpdate = () => {
|
||||
updateAllTimers();
|
||||
};
|
||||
|
||||
// Set initial values
|
||||
timedUpdate();
|
||||
|
||||
// Start timed updates
|
||||
setInterval(timedUpdate, 1000);
|
||||
</script>
|
||||
{% endblock extra_javascript %}
|
||||
|
@ -1,19 +1,18 @@
|
||||
{% extends "mumbletemps/base.html" %}
|
||||
{% extends "services/mumble/base.html" %}
|
||||
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load timetags %}
|
||||
|
||||
{% block mumbletemps %}
|
||||
{% block mumble %}
|
||||
<div class="text-center">
|
||||
<p>
|
||||
<img class="ra-avatar img-circle" src="{{ link.creator.portrait_url_128 }}" alt="{{ link.creator.character_name }}" />
|
||||
</p>
|
||||
|
||||
<h4>
|
||||
{% blocktranslate with character=link.creator.character_name %}
|
||||
{% blocktranslatelate with character=link.creator.character_name %}
|
||||
{{ character }} has invited you to join Mumble!
|
||||
{% endblocktranslate %}
|
||||
{% endblocktranslatelate %}
|
||||
</h4>
|
||||
|
||||
<p>
|
||||
@ -25,7 +24,7 @@
|
||||
|
||||
<p>
|
||||
<a class="btn btn-primary" href="mumble://{{ connect_url }}">
|
||||
<img src="{% static 'mumbletemps/images/mumble-icon.png' %}" alt="{% translate 'Mumble' %}" height="64" width="64" style="margin: 15px" />
|
||||
<img src="{% static 'services/mumble/images/mumble-icon.png' %}" alt="{% translate 'Mumble' %}" height="64" width="64" style="margin: 15px" />
|
||||
|
||||
<span style="margin: 15px;">
|
||||
{% translate "Click to Join Mumble as" %}: <b>{{ temp_user.name }}</b>
|
||||
@ -67,7 +66,7 @@
|
||||
const locale = '{{ LANGUAGE_CODE }}';
|
||||
const timers = [{
|
||||
'id': '{{ link.link_ref }}',
|
||||
'targetDate': moment('{{ link.expires|print_timestamp| date:"c" }}'),
|
||||
'targetDate': moment('{{ link.expires| date:"c" }}'),
|
||||
'expired': false
|
||||
}];
|
||||
|
||||
@ -118,4 +117,4 @@
|
||||
// Start timed updates
|
||||
setInterval(timedUpdate, 1000);
|
||||
</script>
|
||||
{% endblock mumbletemps %}
|
||||
{% endblock mumble %}
|
||||
|
@ -1,20 +1,19 @@
|
||||
{% extends "mumbletemps/base.html" %}
|
||||
{% extends "services/mumble/base.html" %}
|
||||
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load timetags %}
|
||||
|
||||
{% block mumbletemps %}
|
||||
{% block mumble %}
|
||||
<div class="col-md-12 text-center">
|
||||
<div class="mumbletemps-sso-login mb-3">
|
||||
<div class="mumble-sso-login mb-3">
|
||||
<p>
|
||||
<img class="ra-avatar img-circle" src="{{ link.creator.portrait_url_128 }}" alt="{{ link.creator.character_name }}" />
|
||||
</p>
|
||||
|
||||
<h4>
|
||||
{% blocktranslate with character=link.creator.character_name %}
|
||||
{% blocktranslatelate with character=link.creator.character_name %}
|
||||
{{ character }} has invited you to join Mumble!
|
||||
{% endblocktranslate %}
|
||||
{% endblocktranslatelate %}
|
||||
</h4>
|
||||
|
||||
<p>
|
||||
@ -24,7 +23,7 @@
|
||||
<span class="label label-info">{% translate "Link Ref" %}: {{ link.link_ref }}</span>
|
||||
</p>
|
||||
|
||||
<form action="{% url 'mumbletemps:join' link.link_ref %}" method="post">
|
||||
<form action="{% url 'mumble:join' link.link_ref %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<input type="hidden" name="sso" value="True" />
|
||||
@ -37,7 +36,7 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="mumbletemps-non-sso-login">
|
||||
<div class="mumble-non-sso-login">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10 col-lg-8">
|
||||
<div class="card">
|
||||
@ -47,7 +46,7 @@
|
||||
|
||||
<div class="card-body text-start">
|
||||
<div class="form-group">
|
||||
<form action="{% url 'mumbletemps:join' link.link_ref %}" method="post">
|
||||
<form action="{% url 'mumble:join' link.link_ref %}" method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<input type="hidden" name="sso" value="False" />
|
||||
@ -86,7 +85,7 @@
|
||||
const locale = '{{ LANGUAGE_CODE }}';
|
||||
const timers = [{
|
||||
'id': '{{ link.link_ref }}',
|
||||
'targetDate': moment('{{ link.expires|print_timestamp| date:"c" }}'),
|
||||
'targetDate': moment('{{ link.expires| date:"c" }}'),
|
||||
'expired': false
|
||||
}];
|
||||
|
||||
@ -137,4 +136,4 @@
|
||||
// Start timed updates
|
||||
setInterval(timedUpdate, 1000);
|
||||
</script>
|
||||
{% endblock mumbletemps %}
|
||||
{% endblock mumble %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user