Modify

Opened 18 years ago

Closed 10 years ago

#1393 closed defect (fixed)

[PATCH] Use 'select' attribute in drop-down list to show current project by default without breaking alphabetical order

Reported by: Bryan Owned by: Ryan J Ollos
Priority: normal Component: ProjectMenuPlugin
Severity: trivial Keywords:
Cc: Trac Release: 0.10

Description

I've changed the loop over the project environments in web_ui.py to this, so that the current project will be shown by default as selected in the drop-down list, but the projects will still be in alphabetical order.

for project in os.listdir(search_path):
           if project != this_project:
                proj_env = _open_environment(os.path.join(search_path, project))
                
                proj_elm = tag.OPTION(proj_env.project_name, value=posixpath.join(base_url, project))
                
                projects.append((proj_elm, proj_env.project_name))
           else:
                proj_elm = tag.OPTION(self.env.project_name, selected='selected', value='')

                projects.append((proj_elm, self.env.project_name))

Minor detail I know, but I think the UI is nicer if the list ordering is kept constant across projects.

Attachments (0)

Change History (3)

comment:1 Changed 15 years ago by Adrian Fritz

Summary: Use 'select' attribute in drop-down list to show current project by default without breaking alphabetical order[PATCH] Use 'select' attribute in drop-down list to show current project by default without breaking alphabetical order

comment:2 Changed 10 years ago by Ryan J Ollos

Owner: changed from Noah Kantrowitz to Ryan J Ollos
Status: newassigned

comment:3 Changed 10 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

In 14054:

2.0dev: Sort items in select alphabetically. Fixes #1393.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
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.