Opened 2 years ago

Closed 2 years ago

#19464 closed New feature (fixed)

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

Reported by: rubyruy 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 rubyruy 2 years ago.

Download all attachments as: .zip

Change History (7)

Changed 2 years ago by rubyruy

comment:1 Changed 2 years ago by rubyruy

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

have a patch why not

comment:2 Changed 2 years ago by claudep

  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to New feature

comment:3 Changed 2 years ago by oinopion

  • Needs documentation set
  • Needs tests set

comment:4 Changed 2 years ago by rubyruy

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 Changed 2 years ago by carljm

  • 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 Changed 2 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to 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