Opened 14 years ago

Closed 14 years ago

#19464 closed New feature (fixed)

The markup for ClearableFileInput's link should be a widget template string

Reported by: Ruy Asan Owned by: nobody
Component: Forms Version: 1.5-beta-1
Severity: Normal Keywords: widget ClearableFileInput
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

ClearableFileInput already makes great use of class attribute to let us customize various templates and wording details, except, notably (and sadly) ​the markup for the actual link.

This could easily be made to fall in line with the other templates, and covers the fairly common use case of wanting a more appropriate inline preview (e.g. img tags for ImageField widgets).

Attachments (1)

url_markup_template.diff​ (1.0 KB ) - added by Ruy Asan 14 years ago.

Download all attachments as: .zip

Change History (7)

by Ruy Asan, 14 years ago

Attachment: url_markup_template.diff​ added

comment:1 by Ruy Asan, 14 years ago

Has patch: set

have a patch why not

comment:2 by Claude Paroz, 14 years ago

Triage Stage: Unreviewed → Accepted
Type: Uncategorized → New feature

comment:3 by Tomek Paczkowski, 14 years ago

Needs documentation: set
Needs tests: set

comment:4 by Ruy Asan, 14 years ago

Err... as far as as I can tell, this is an internal implementation detail that is only relevant when sub-classing - it's not really documented for any of the other widgets.

Nor is this change specifically testable - unless you mean this breaks an existing test (which I didn't think it did...)

comment:5 by Carl Meyer, 14 years ago

Needs documentation: unset
Needs tests: unset

I agree that this is an internal refactoring for better subclassability and does not require new tests, only that all existing tests pass.

A case could be made that if we're refactoring widget implementations specifically to make them more easily subclassable, we should also document those class attributes intended for overriding; otherwise we're encouraging reliance on undocumented implementation details. I don't feel strongly enough about that to block this going in, though.

comment:6 by Claude Paroz <claude@…>, 14 years ago

Resolution: → fixed
Status: new → closed

In 51cc7029b96d028989e92a185a2f88b89283d287:

Fixed #19464 -- Eased customization of ClearableFileInput's link markup

Thanks rubyruy for the report and the patch.

Note: See TracTickets for help on using tickets.
Back to Top