Create an NFC button for browser supporting NFC API

This commit is contained in:
2024-07-24 17:42:02 +02:00
parent a24b1f5c2a
commit 15f51fb03f
7 changed files with 381 additions and 320 deletions

View File

@ -66,7 +66,7 @@ class SelectDate(DateInput):
class MarkdownInput(Textarea):
template_name = "core/markdown_textarea.jinja"
template_name = "core/widgets/markdown_textarea.jinja"
def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
@ -100,6 +100,15 @@ class MarkdownInput(Textarea):
return context
class NFCTextInput(TextInput):
template_name = "core/widgets/nfc.jinja"
def get_context(self, name, value, attrs):
context = super().get_context(name, value, attrs)
context["translations"] = {"unsupported": _("Unsupported NFC card")}
return context
class SelectFile(TextInput):
def render(self, name, value, attrs=None, renderer=None):
if attrs: