Modify

Opened 14 months ago

Last modified 12 months ago

#11215 new enhancement

Set focus when admin Users page loads

Reported by: rjollos Owned by: hasienda
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 rjollos 14 months ago.
Patch against r13290 of the trunk.

Download all attachments as: .zip

Change History (6)

comment:1 follow-up: Changed 14 months ago by rjollos

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 14 months ago by rjollos

Patch against r13290 of the trunk.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 14 months ago by jun66j5

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 14 months ago by rjollos

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 14 months ago by hasienda

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 12 months ago by rjollos

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

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

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.