Code

Opened 6 years ago

Closed 3 years ago

Last modified 3 years ago

#6750 closed (fixed)

Invalid xhtml in AdminFileWidget (target="_blank")

Reported by: garcia_marc Owned by:
Component: contrib.admin Version: newforms-admin
Severity: Keywords: admin invalid xhtml AdminFileWidget nfa-someday
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

As requested in #5695, here is the fix for the invalid xhtml in the AdminFileWidget. It's just a target="_blank" replaced by the javascript open.window().

May be I could develop another patch changing string variables by a dictionay to make the code clearer.

Attachments (1)

6750.diff (829 bytes) - added by garcia_marc 6 years ago.
Patch for the ticket (without a dictionary as string variables)

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by garcia_marc

Patch for the ticket (without a dictionary as string variables)

comment:1 Changed 6 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

Hm. I'm not sure I like doing this all that much -- embedding Javascript in HTML in Python feels super yucky. Personally, I'm OK with the invalid XHTML as long at it works.

comment:2 Changed 6 years ago by garcia_marc

  • Keywords fs-rf added

What about simply removing the target="_blank", or moving the javascript to a .js file?

It's supposed to be a framework for perfectionists, we shouldn't leave the invalid code in there... ;)

comment:3 Changed 6 years ago by Karen Tracey <kmtracey@…>

  • Keywords nfa-someday added

Jacob's comment makes me think this is not critical to be addressed before nfa merge?

comment:4 Changed 6 years ago by Gulopine

  • Keywords fs-rf removed

The filestorage refactor has nothing to do with widgets, much less anything admin-specific, so I'm removing the fs-rf keyword.

comment:5 Changed 6 years ago by garcia_marc

  • Owner changed from nobody to garcia_marc

comment:6 Changed 5 years ago by garcia_marc

  • Owner garcia_marc deleted

comment:7 Changed 3 years ago by julien

  • Resolution set to fixed
  • Status changed from new to closed

Things have changed since 3 years ago and I now can't find any occurrence of target="_blank" in the code, so let's consider this as fixed.

comment:8 Changed 3 years ago by lrekucki

Just for reference, (x)HTML 5 no longer deprecates target="_blank".

Last edited 3 years ago by lrekucki (previous) (diff)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.