# HG changeset patch # User Mads Kiilerich # Date 2014-07-18 19:22:01 # Node ID 0111c18298a0629888d9b3cfc6f7e03f76a10212 # Parent 2ddd4fb23b4e4c5aff338df1d58241cb6379d35a changelog: use select2 for branch selector diff --git a/kallithea/controllers/changelog.py b/kallithea/controllers/changelog.py --- a/kallithea/controllers/changelog.py +++ b/kallithea/controllers/changelog.py @@ -154,7 +154,7 @@ class ChangelogController(BaseRepoContro return redirect(url('changelog_home', repo_name=c.repo_name)) c.branch_name = branch_name - c.branch_filters = [('', _('All Branches'))] + \ + c.branch_filters = [('', _('None'))] + \ [(k, k) for k in c.db_repo_scm_instance.branches.keys()] if c.db_repo_scm_instance.closed_branches: prefix = _('(closed)') + ' ' diff --git a/kallithea/templates/changelog/changelog.html b/kallithea/templates/changelog/changelog.html --- a/kallithea/templates/changelog/changelog.html +++ b/kallithea/templates/changelog/changelog.html @@ -66,12 +66,12 @@ ${self.repo_context_bar('changelog', c.f %endif ## text and href of open_new_pr is controlled from javascript - ${h.select('branch_filter',c.branch_name,c.branch_filters)} + ${_("Branch filter:")} ${h.select('branch_filter',c.branch_name,c.branch_filters)} -
+
@@ -269,14 +269,20 @@ ${self.repo_context_bar('changelog', c.f }); // change branch filter - YUE.on(YUD.get('branch_filter'),'change',function(e){ + $("#branch_filter").select2({ + dropdownAutoWidth: true, + minimumInputLength: 1, + }); + + $("#branch_filter").change(function(e){ var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; if(selected_branch != ''){ window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}', - 'branch':selected_branch}); + 'branch': selected_branch}); }else{ window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'}); } + $("#changelog").hide(); }); var jsdata = ${c.jsdata|n};