Modify

Opened 4 years ago

Closed 4 months ago

#11215 closed enhancement (fixed)

Set focus when admin Users page loads

Reported by: Ryan J Ollos Owned by: Steffen Hoffmann
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

Set the focus to #username when the /admin/accounts/users page loads, and set the focus to #password when the /admin/accounts/users/<username> page loads.

Attachments (1)

t11215.diff (2.1 KB) - added by Ryan J Ollos 4 years ago.
Patch against r13290 of the trunk.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by Ryan J Ollos

I'd also suggest a refactoring, such as (untested):

<label py:choose="">Password:<br />
  <input type="password" name="password" class="textwidget"
         py:when="password_change_enabled" />
  <input type="password" name="password" class="textwidget"
         py:otherwise="" disabled="disabled" />
</label>

->

<label>Password:<br />
  <input type="password" name="password" class="textwidget"
         py:attrs="{'disabled': not password_change_enabled and
                                'disabled' or None}" />
</label>

Changed 4 years ago by Ryan J Ollos

Attachment: t11215.diff added

Patch against r13290 of the trunk.

comment:2 in reply to:  1 ; Changed 4 years ago by Jun Omae

Replying to rjollos:

I'd also suggest a refactoring, such as (untested):

I would do like this.

<label for="account-editor-password">Password:<br />
  <input id="account-editor-password"
         type="password" name="password" class="textwidget"
         disabled="${not password_change_enabled and 'disabled' or None}" />
</label>

Or

<label for="account-editor-password">Password:<br />
  <input id="account-editor-password"
         type="password" name="password" class="textwidget"
         disabled="${('disabled', None)[bool(password_change_enabled)]}" />
</label>

comment:3 in reply to:  2 Changed 4 years ago by Ryan J Ollos

Replying to jun66j5:

Replying to rjollos:

I'd also suggest a refactoring, such as (untested):

I would do like this

The first of your two suggestions looks best to me.

comment:4 Changed 4 years ago by Steffen Hoffmann

In 13323:

AccountManagerPlugin: Set sensible focus to an input field on page load, refs #11213 and #11215.

Template improvements are done too, mainly following valuable suggestions by
Jun and Ryan - thanks to both of you.

comment:5 Changed 4 years ago by Ryan J Ollos

Here is another possibility using presentation.classes (untested):

disabled="${classes(disabled=not password_change_enabled)}"

comment:6 Changed 4 months ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.