Modify

Opened 7 years ago

Last modified 4 years ago

#1393 new defect

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

Reported by: Bryan Owned by: coderanger
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 (1)

comment:1 Changed 4 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

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.