Changeset - f22d103ba9e8
[Not reviewed]
default
0 4 0
Mads Kiilerich - 11 years ago 2014-07-18 18:45:54
madski@unity3d.com
changelog: use css for message expand and make it toggle so it also can be collapsed again
4 files changed with 16 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -2614,48 +2614,60 @@ BIN_FILENODE = 6
 
#graph_content .log-container {
 
    position: relative;
 
}
 

	
 
#graph_content .container .changeset_range {
 
    float: left;
 
    margin: 6px 3px;
 
}
 

	
 
#graph_content .container .author img {
 
    vertical-align: middle;
 
}
 

	
 
#graph_content .container .author .user {
 
    color: #444444;
 
}
 

	
 
#graph_content .container .mid .message {
 
    white-space: pre-wrap;
 
    padding: 0;
 
    overflow: hidden;
 
    height: 1.1em;
 
}
 

	
 
#graph_content_pr .compare_view_commits .message {
 
    white-space: normal !important;
 
    padding: 0 !important;
 
    height: 1.1em;
 
}
 

	
 
#graph_content .container .mid .message.expanded,
 
#graph_content_pr .compare_view_commits .message.expanded {
 
    height: auto;
 
    margin: 4px 0px 4px 0px;
 
}
 

	
 
#graph_content .container .extra-container {
 
    display: block;
 
    position: absolute;
 
    top: -15px;
 
    right: 0;
 
    padding-left: 5px;
 
    background: #FFFFFF;
 
    height: 41px;
 
}
 

	
 
#graph_content .comments-container,
 
#shortlog_data .comments-container,
 
#graph_content .logtags {
 
    display: block;
 
    float: left;
 
    overflow: hidden;
 
    padding: 0;
 
    margin: 0;
 
}
 

	
 
#graph_content .comments-container {
 
    margin: 0.8em 0;
 
    margin-right: 0.5em;
 
}
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -238,51 +238,50 @@ ${self.repo_context_bar('changelog', c.f
 
                        var cb = checkboxes[i];
 
                        cb.checked = false;
 
                    }
 
                    checkbox_checker();
 
                    YUE.preventDefault(e);
 
                });
 

	
 
                var msgs = YUQ('.message');
 
                // get first element height
 
                var el = YUQ('#graph_content .container')[0];
 
                var row_h = el.clientHeight;
 
                for(var i=0;i<msgs.length;i++){
 
                    var m = msgs[i];
 

	
 
                    var h = m.clientHeight;
 
                    var pad = YUD.getStyle(m,'padding');
 
                    if(h > row_h){
 
                        var offset = row_h - (h+12);
 
                        YUD.setStyle(m.nextElementSibling,'display','block');
 
                        YUD.setStyle(m.nextElementSibling,'margin-top',offset+'px');
 
                    };
 
                }
 

	
 
                $('.expand_commit').on('click',function(e){
 
                    $(this).children('i').hide();
 
                    var cid = $(this).attr('commit_id');
 
                    $('#C-'+cid).css({'height': 'auto', 'margin': '4px 0px 4px 0px'})
 
                    $('#C-'+cid).toggleClass('expanded');
 

	
 
                    //redraw the graph, r and jsdata are bound outside function
 
                    r.render(jsdata,100);
 
                });
 

	
 
                // change branch filter
 
                YUE.on(YUD.get('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});
 
                    }else{
 
                        window.location = pyroutes.url('changelog_home', {'repo_name': '${c.repo_name}'});
 
                    }
 
                });
 

	
 
                var jsdata = ${c.jsdata|n};
 
                var r = new BranchRenderer('graph_canvas', 'graph_content');
 
                r.render(jsdata,100);
 
            });
 

	
 
        </script>
 
        %else:
 
            ${_('There are no changes yet')}
kallithea/templates/compare/compare_cs.html
Show inline comments
 
@@ -11,73 +11,72 @@
 
    %endif
 

	
 
    <table class="compare_view_commits noborder">
 
    %for cs in reversed(c.cs_ranges):
 
        <tr id="row-${cs.raw_id}">
 
        <td style="width:50px">
 
          %if cs.raw_id in c.statuses:
 
            <div title="${_('Changeset status: %s') % c.statuses[cs.raw_id][1]}" class="changeset-status-ico">
 
                <img height="16" width="16" src="${h.url('/images/icons/flag_status_%s.png' % c.statuses[cs.raw_id][0])}" />
 
            </div>
 
          %endif
 
        </td>
 
        <td style="width: 140px"><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
 
        <td><div class="gravatar" commit_id="${cs.raw_id}"><img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),14)}" height="14" width="14"/></div></td>
 
        <td><div class="author">${h.person(cs.author)}</div></td>
 
        <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.other_repo.repo_name,revision=cs.raw_id))}</td>
 
        <td>
 
        %if cs.branch:
 
        <span class="branchtag">${cs.branch}</span>
 
        %endif
 
        </td>
 
        <td class="expand_commit" commit_id="${cs.raw_id}" title="${_('Expand commit message')}">
 
            <i class="icon-resize-vertical" style="color:#DDD"></i>
 
        </td>
 
        <td><div id="C-${cs.raw_id}" class="message" style="white-space:normal; height:1.1em; padding:0">${h.urlify_commit(cs.message, c.repo_name)}</div></td>
 
        <td><div id="C-${cs.raw_id}" class="message">${h.urlify_commit(cs.message, c.repo_name)}</div></td>
 
        </tr>
 
    %endfor
 
    </table>
 
    %if c.as_form:
 
      <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
 
      ## links should perhaps use ('rev', c.org_rev) instead ...
 
      ${h.link_to(_('Show merge diff'),
 
        h.url('compare_url',
 
          repo_name=c.org_repo.repo_name,
 
          org_ref_type=c.org_ref_type, org_ref_name=c.org_ref_name,
 
          other_repo=c.other_repo.repo_name,
 
          other_ref_type=c.other_ref_type, other_ref_name=c.other_ref_name,
 
          merge='1'),
 
        )}
 
      </div>
 
      <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
 
        ${_('Common ancestor')}:
 
        %if c.ancestor:
 
        ${h.link_to(h.short_id(c.ancestor),h.url('changeset_home',repo_name=c.repo_name,revision=c.ancestor))}
 
        %else:
 
        ${_('No common ancestor found - repositories are unrelated')}
 
        %endif
 
      </div>
 
    %endif
 
    %if c.cs_ranges_org is not None:
 
      ## TODO: list actual changesets?
 
      <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">
 
        ${h.link_to_ref(c.other_repo.repo_name, c.other_ref_type, c.other_ref_name, c.other_rev)}
 
        ${_('is')}
 
        <a href="${c.swap_url}">${_('%s changesets') % (len(c.cs_ranges_org))}</a>
 
        ${_('behind')}
 
        ${h.link_to_ref(c.org_repo.repo_name, c.org_ref_type, c.org_ref_name, c.org_rev)}
 
      </div>
 
    %endif
 
  %endif
 
</div>
 

	
 
<script>
 
$('.expand_commit').on('click',function(e){
 
    $(this).children('i').hide();
 
    var cid = $(this).attr('commit_id');
 
    $('#C-'+cid).css({'height': 'auto','width': 'auto', 'white-space': 'pre'})
 
    $('#C-'+cid).toggleClass('expanded');
 
});
 
$('.gravatar').on('click',function(e){
 
    var cid = $(this).attr('commit_id');
 
    $('#row-'+cid).toggleClass('hl', !$('#row-'+cid).hasClass('hl'));
 
});
 
</script>
kallithea/tests/functional/test_compare.py
Show inline comments
 
@@ -21,49 +21,49 @@ def _commit_change(repo, filename, conte
 
            filename: {
 
                'content': content
 
            }
 
        }
 
        cs = ScmModel().create_nodes(
 
            user=TEST_USER_ADMIN_LOGIN, repo=repo,
 
            message=message,
 
            nodes=nodes,
 
            parent_cs=_cs,
 
            author=TEST_USER_ADMIN_LOGIN,
 
        )
 
    else:
 
        cs = ScmModel().commit_change(
 
            repo=repo.scm_instance, repo_name=repo.repo_name,
 
            cs=parent, user=TEST_USER_ADMIN_LOGIN,
 
            author=TEST_USER_ADMIN_LOGIN,
 
            message=message,
 
            content=content,
 
            f_path=filename
 
        )
 
    return cs
 

	
 

	
 
def _commit_div(sha, msg):
 
    return """<div id="C-%s" class="message" style="white-space:normal; height:1.1em; padding:0">%s</div>""" % (sha, msg)
 
    return """<div id="C-%s" class="message">%s</div>""" % (sha, msg)
 

	
 

	
 
class TestCompareController(TestController):
 

	
 
    def setUp(self):
 
        self.r1_id = None
 
        self.r2_id = None
 

	
 
    def tearDown(self):
 
        if self.r2_id:
 
            RepoModel().delete(self.r2_id)
 
        if self.r1_id:
 
            RepoModel().delete(self.r1_id)
 
        Session().commit()
 
        Session.remove()
 

	
 
    def test_compare_forks_on_branch_extra_commits_hg(self):
 
        self.log_user()
 
        repo1 = fixture.create_repo('one', repo_type='hg',
 
                                    repo_description='diff-test',
 
                                    cur_user=TEST_USER_ADMIN_LOGIN)
 
        self.r1_id = repo1.repo_id
 
        #commit something !
 
        cs0 = _commit_change(repo1.repo_name, filename='file1', content='line1\n',
0 comments (0 inline, 0 general)