Modify

Opened 8 years ago

Closed 5 months 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: rjollos
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 5 years ago by AdrianFritz

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

comment:2 Changed 5 months ago by rjollos

  • Owner changed from coderanger to rjollos
  • Status changed from new to assigned

comment:3 Changed 5 months ago by rjollos

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

In 14054:

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

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.