Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #21201 -- Enable customization of ClearableFileInput #1807

Closed
wants to merge 1 commit into from

Conversation

ziima
Copy link
Contributor

@ziima ziima commented Oct 25, 2013

Adding extra methods into ClearableFileInput widget to enable
easier customization of the widget.

@@ -330,12 +330,10 @@ class ClearableFileInput(FileInput):
input_text = ugettext_lazy('Change')
clear_checkbox_label = ugettext_lazy('Clear')

template_with_initial = '%(initial_text)s: %(initial)s %(clear_template)s<br />%(input_text)s: %(input)s'
template_with_initial = '%(initial_text)s: <a href="%(initial_url)s">%(initial)s</a> %(clear_template)s<br />%(input_text)s: %(input)s'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing url_markup_template breaks the customization use case in #19464.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked, but I haven't found it in docs.

I investigated the related ticket, but I didn't get if there is a reason to have template split between two attributes? Or is it only a matter of backwards compatibility?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea was to replace with . Maybe the change is fine as I guess it's still possible; it just requires overriding the entire template_with_initial instead of url_markup_template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the link with img is possible by changing the template_with_initial, so I didn't made any further changes.

Adding extra methods into ClearableFileInput widget to enable
easier customization of the widget.
@ziima ziima force-pushed the ticket_21201-clearable-file-input branch from f794876 to 6098e3b Compare August 29, 2014 07:57
@ziima
Copy link
Contributor Author

ziima commented Aug 29, 2014

Rebased on master, moved the relase notes from 1.7 to 1.8.

@timgraham
Copy link
Member

buildbot, test this please.

@timgraham
Copy link
Member

merged in e622caa, thanks.

@timgraham timgraham closed this Aug 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants