Share url view
* adds modal for rendering the share url * adds new custom_widget text-to-clipboard-input.html * provides a copy button for writing the text input's value into the client's clipboard * adds translation
This commit is contained in:
@@ -220,15 +220,28 @@ class OpenInterventionForm(EditInterventionForm):
|
||||
self.disable_form_field(field)
|
||||
|
||||
|
||||
class DummyFilterInput(forms.HiddenInput):
|
||||
""" A dummy input widget
|
||||
|
||||
Does not render anything. Can be used to keep filter logic using django_filter without having a pre defined
|
||||
filter widget being rendered to the template.
|
||||
|
||||
"""
|
||||
template_name = "konova/custom_widgets/dummy-filter-input.html"
|
||||
|
||||
|
||||
class TextToClipboardInput(forms.TextInput):
|
||||
template_name = "konova/custom_widgets/text-to-clipboard-input.html"
|
||||
|
||||
|
||||
class ShareInterventionForm(BaseModalForm):
|
||||
url = forms.CharField(
|
||||
label=_("Share link"),
|
||||
label_suffix="",
|
||||
disabled=True,
|
||||
required=False,
|
||||
widget=forms.TextInput(
|
||||
widget=TextToClipboardInput(
|
||||
attrs={
|
||||
"style": "width:100%",
|
||||
"readonly": True
|
||||
}
|
||||
)
|
||||
)
|
||||
@@ -251,16 +264,3 @@ class ShareInterventionForm(BaseModalForm):
|
||||
"url",
|
||||
self.share_link
|
||||
)
|
||||
|
||||
def save(self):
|
||||
i = 0
|
||||
|
||||
|
||||
class DummyFilterInput(forms.HiddenInput):
|
||||
""" A dummy input widget
|
||||
|
||||
Does not render anything. Can be used to keep filter logic using django_filter without having a pre defined
|
||||
filter widget being rendered to the template.
|
||||
|
||||
"""
|
||||
template_name = "intervention/dummy-filter-input.html"
|
||||
@@ -1,5 +0,0 @@
|
||||
{% comment %}
|
||||
This is an empty template.
|
||||
It's used to dismiss a default widget for a django_filter filter and to use a predefined input directly in the
|
||||
template without losing the comfort of matching the filter methods declared in the filter
|
||||
{% endcomment %}
|
||||
Reference in New Issue
Block a user