mirror of https://github.com/jumpserver/jumpserver
fix: 修复由于更新django captch版本引起的css丢失问题 (#5204)
* fix: 修复由于更新django captch版本引起的css丢失问题 * perf: 优化验证码的高度 Co-authored-by: ibuler <ibuler@qq.com>pull/5221/head
parent
5aee2ce3db
commit
d4feaf1e08
@ -0,0 +1,29 @@
|
||||
{% load i18n %}
|
||||
{% spaceless %}
|
||||
<img src="{{ image }}" alt="captcha" class="captcha" />
|
||||
<div class="row" style="padding-bottom: 10px">
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group-prepend">
|
||||
{% if audio %}
|
||||
<a title="{% trans "Play CAPTCHA as audio file" %}" href="{{ audio }}">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% include "django/forms/widgets/multiwidget.html" %}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var placeholder = '{% trans "Captcha" %}'
|
||||
function refresh_captcha() {
|
||||
$.getJSON("{% url "captcha-refresh" %}",
|
||||
function (result) {
|
||||
$('.captcha').attr('src', result['image_url']);
|
||||
$('#id_captcha_0').val(result['key'])
|
||||
})
|
||||
}
|
||||
$(document).ready(function () {
|
||||
$('.captcha').click(refresh_captcha)
|
||||
$('#id_captcha_1').addClass('form-control').attr('placeholder', placeholder)
|
||||
})
|
||||
</script>
|
||||
|
||||
{% endspaceless %}
|
@ -1,12 +0,0 @@
|
||||
{{image}}{{hidden_field}}{{text_field}}
|
||||
|
||||
<script>
|
||||
function refresh_captcha() {
|
||||
$.getJSON("{% url "captcha-refresh" %}",
|
||||
function (result) {
|
||||
$('.captcha').attr('src', result['image_url']);
|
||||
$('#id_captcha_0').val(result['key'])
|
||||
})
|
||||
}
|
||||
$('.captcha').click(refresh_captcha)
|
||||
</script>
|
@ -1 +0,0 @@
|
||||
<input id="{{id}}_0" name="{{name}}_0" type="hidden" value="{{key}}" />
|
@ -1,4 +0,0 @@
|
||||
{% load i18n %}
|
||||
{% spaceless %}
|
||||
{% if audio %}<a title="{% trans "Play CAPTCHA as audio file" %}" href="{{audio}}">{% endif %}<img src="{{image}}" alt="captcha" class="captcha" />{% if audio %}</a>{% endif %}
|
||||
{% endspaceless %}
|
@ -1,7 +0,0 @@
|
||||
{% load i18n %}
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<input autocomplete="off" id="{{id}}_1" class="form-control" name="{{name}}_1" placeholder="{% trans 'Captcha' %}" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
</br>
|
Loading…
Reference in new issue