django allauth帐户模板中的CSS定义
我正在试用django allauth,在自定义allauth帐户模板时遇到了一个障碍。我目前正在处理emails.html模板,但我找不到默认模板中使用的css类的任何定义 CSS分类,如ctrlHolder或主要电子邮件。请帮我弄清楚这些定义在哪里。我可以使用引导css,但希望保留默认css,如果它们足够好的话 accounts/emails.htmldjango allauth帐户模板中的CSS定义,django,django-allauth,Django,Django Allauth,我正在试用django allauth,在自定义allauth帐户模板时遇到了一个障碍。我目前正在处理emails.html模板,但我找不到默认模板中使用的css类的任何定义 CSS分类,如ctrlHolder或主要电子邮件。请帮我弄清楚这些定义在哪里。我可以使用引导css,但希望保留默认css,如果它们足够好的话 accounts/emails.html {% extends "account/base.html" %} {% load i18n %} {% block head_titl
{% extends "account/base.html" %}
{% load i18n %}
{% block head_title %}{% trans "E-mail Addresses" %}{% endblock %}
{% block content %}
<h1>{% trans "E-mail Addresses" %}</h1>
{% if user.emailaddress_set.all %}
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p>
<form action="{% url 'account_email' %}" method="post">
{% csrf_token %}
<div class="form-group">
{% for emailaddress in user.emailaddress_set.all %}
<div class="ctrlHolder">
<label for="email_radio_{{ forloop.counter }}"
class="{% if emailaddress.primary %}primary_email{% endif %}">
<input id="email_radio_{{ forloop.counter }}" type="radio" name="email"
{% if emailaddress.primary or user.emailaddress_set.count == 1 %}checked="checked"{% endif %}
value="{{ emailaddress.email }}"/>
{{ emailaddress.email }}
{% if emailaddress.verified %}
<span class="verified">{% trans "Verified" %}</span>
{% else %}
<span class="unverified">{% trans "Unverified" %}</span>
{% endif %}
{% if emailaddress.primary %}<span class="primary">{% trans "Primary" %}</span>{% endif %}
</label>
</div>
{% endfor %}
<div class="buttonHolder">
<button class="secondaryAction" type="submit"
name="action_primary">{% trans 'Make Primary' %}</button>
<button class="secondaryAction" type="submit"
name="action_send">{% trans 'Re-send Verification' %}</button>
<button class="primaryAction" type="submit" name="action_remove">{% trans 'Remove' %}</button>
</div>
</div>
</form>
{% else %}
<p>
<strong>{% trans 'Warning:' %}</strong> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
</p>
{% endif %}
<h2>{% trans "Add E-mail Address" %}</h2>
<form method="post" action="{% url 'account_email' %}" class="add_email">
{% csrf_token %}
{{ form.as_p }}
<button name="action_add" type="submit">{% trans "Add E-mail" %}</button>
</form>
{% endblock %}
{% block extra_body %}
<script type="text/javascript">
(function () {
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
var actions = document.getElementsByName('action_remove');
if (actions.length) {
actions[0].addEventListener("click", function (e) {
if (!confirm(message)) {
e.preventDefault();
}
});
}
})();
</script>
{% endblock %}
该类未在allauth中定义。它就在那里,因此您可以在CSS中定义它。我猜名称是ctrlHolder和buttonHolder,因为它们是输入控件和按钮html语句的占位符类名。谢谢。我想是的。我在django的块系统中使用了自定义js和css,在特定页面中插入所需的类!
{% extends "shared/base.html" %}