Create an NFC button for browser supporting NFC API

This commit is contained in:
klmp200 committed 2024-07-25 07:18:39 +02:00
1 parent a24b1f5c2a
commit 15f51fb03f
7 files changed
+381 -320

No files matched your search

+10 -1
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: