Mercurial > kallithea
changeset 4377:0111c18298a0
changelog: use select2 for branch selector
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 18 Jul 2014 19:22:01 +0200 |
parents | 2ddd4fb23b4e |
children | ac9cd5659c29 |
files | kallithea/controllers/changelog.py kallithea/templates/changelog/changelog.html |
diffstat | 2 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/changelog.py Fri Jul 18 19:22:01 2014 +0200 +++ b/kallithea/controllers/changelog.py Fri Jul 18 19:22:01 2014 +0200 @@ -154,7 +154,7 @@ 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)') + ' '
--- a/kallithea/templates/changelog/changelog.html Fri Jul 18 19:22:01 2014 +0200 +++ b/kallithea/templates/changelog/changelog.html Fri Jul 18 19:22:01 2014 +0200 @@ -66,12 +66,12 @@ %endif ## text and href of open_new_pr is controlled from javascript <a id="open_new_pr" class="btn btn-small"></a> - ${h.select('branch_filter',c.branch_name,c.branch_filters)} + ${_("Branch filter:")} ${h.select('branch_filter',c.branch_name,c.branch_filters)} </div> </div> </div> - <div style="clear:both"> + <div id="changelog" style="clear:both"> <div id="graph_nodes"> <canvas id="graph_canvas"></canvas> @@ -269,14 +269,20 @@ }); // 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};