Changeset - 0111c18298a0
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2014-07-18 19:22:01
madski@unity3d.com
changelog: use select2 for branch selector
2 files changed with 11 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changelog.py
Show inline comments
 
@@ -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)') + ' '
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -66,12 +66,12 @@ ${self.repo_context_bar('changelog', c.f
 
                            %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 @@ ${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};
0 comments (0 inline, 0 general)