-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(settings): tup-308, new form templates by #500
Not a straight clone of #500. I added a little CSS and a small document to avoid cloning one template. See: - default.html.md - django.cms.forms.css
- Loading branch information
1 parent
d813bee
commit 8a46a21
Showing
5 changed files
with
50 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
taccsite_cms/templates/captcha/widget_v2_checkbox.custom.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{# https://github.com/torchbox/django-recaptcha/blob/4921a6c/captcha/templates/captcha/widget_v2_checkbox.html #} | ||
{# https://developers.google.com/recaptcha/docs/display#config #} | ||
{% load static %} | ||
|
||
{% include "captcha/includes/js_v2_checkbox.html" %} | ||
<noscript>Never mind. We assume you are not a robot.</noscript> | ||
<button | ||
class="g-recaptcha c-button c-button--secondary" | ||
id="tacc-spam-toggle-{{ widget_uuid }}" | ||
data-sitekey="{% for name, value in widget.attrs.items %}{% ifequal name 'data-sitekey' %}{{ value }}{% endifequal %}{% endfor %}" | ||
data-callback="onSubmit_{{ widget_uuid }}" | ||
data-badge="bottomright" | ||
hidden | ||
> | ||
I am not a robot | ||
</button> | ||
<script> | ||
document.getElementById('tacc-spam-toggle-{{ widget_uuid }}').hidden = false; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# TACC CMS - Templates - Custom Captcha | ||
|
||
Default captcha (`django-recaptcha` via `django-forms-maintained`) is limited. | ||
|
||
You can use the `.custom` template to create a custom captcha interface. | ||
|
||
To use, clone the `.custom` file and remove `.custom` from the new file's name. |
85 changes: 0 additions & 85 deletions
85
taccsite_cms/templates/djangocms_forms/form_template/default.html
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
taccsite_cms/templates/djangocms_forms/form_template/default.html.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# TACC CMS - Templates - Default Form | ||
|
||
The [original template] could have been cloned and edited. | ||
|
||
But, to avoid that[^1], the two changes have been performed other ways: | ||
|
||
1. [Remove redundant load of `google.com/recaptcha/api.js`.][1] | ||
2. [Add `c-button` class styles to form submit button via CSS not markup.][2] | ||
|
||
[^1]: Avoid editing the template because it does not use `block`s (which means we need to clone the whole template; which means if the [original template] changes, and we update form plugin, ours will become out of date). | ||
|
||
[original template]: https://github.com/avryhof/djangocms-forms/blob/30f4643/djangocms_forms/templates/djangocms_forms/form_template/default.html | ||
[1]: https://github.com/avryhof/djangocms-forms/pull/12 | ||
[2]: ../../../static/site_cms/css/src/_imports/components/django.cms.forms.css#L103 |