Changeset - 90282e663313
[Not reviewed]
default
0 2 0
domruf - 8 years ago 2017-07-03 21:45:37
dominikruf@gmail.com
changelog: avoid cutting off commit messages

Split commit message into 2 <div> elements: one with just the first line, and
one with the full message. This makes it easier to handle the toggling of
showing the whole commit message. This way, we no longer have to mess with the
line height, and we avoid problems with cutting off parts of the text below the
text baseline.

Also stop cutting off the first line if it is too long for the table column.

It adds a bit of overhead to store the first line twice, but having them
separate make things simpler and is worth it.

Patch modified by Mads Kiilerich.
2 files changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -1507,16 +1507,15 @@ tr.out-of-range {
 
#graph_content tr .author .user {
 
    color: #444444;
 
}
 

	
 
#graph_content tr td.mid .message,
 
#graph_content_pr .compare_view_commits .message {
 
    white-space: pre-wrap;
 
    white-space: nowrap;
 
    padding: 0;
 
    overflow: hidden;
 
    height: 1.2em;
 
}
 

	
 
#graph_content_pr .compare_view_commits .message {
 
    padding: 0 !important;
 
}
 

	
kallithea/templates/changelog/changelog.html
Show inline comments
 
@@ -101,18 +101,22 @@ ${self.repo_context_bar('changelog', c.f
 
                        <td class="hash">
 
                            ${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id), class_='changeset_hash')}
 
                        </td>
 
                        <td class="date">
 
                            <div class="date" data-toggle="tooltip" title="${h.fmt_date(cs.date)}">${h.age(cs.date,True)}</div>
 
                        </td>
 
                        <% message_lines = cs.message.splitlines() %>
 
                        <td class="expand_commit" title="${_('Expand commit message')}">
 
                            <i class="icon-align-left"></i>
 
                        </td>
 
                        <td class="mid">
 
                            <div class="log-container">
 
                                <div class="message">${h.urlify_text(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
                                <div class="message">
 
                                    <div class="message-firstline">${h.urlify_text(message_lines[0], c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div>
 
                                    <div class="message-full hidden">${h.urlify_text(cs.message, c.repo_name)}</div>
 
                                </div>
 
                                <div class="extra-container">
 
                                    %if c.comments.get(cs.raw_id):
 
                                        <a class="comments-container comments-cnt" href="${c.comments[cs.raw_id][0].url()}" data-toggle="tooltip" title="${_('%s comments') % len(c.comments[cs.raw_id])}">
 
                                            ${len(c.comments[cs.raw_id])}
 
                                            <i class="icon-comment-discussion"></i>
 
                                        </a>
 
@@ -283,13 +287,13 @@ ${self.repo_context_bar('changelog', c.f
 
                        $(m.nextElementSibling).css('display', 'block');
 
                        $(m.nextElementSibling).css('margin-top', offset+'px');
 
                    }
 
                });
 

	
 
                $('.expand_commit').on('click',function(e){
 
                    $(this).next('.mid').find('.message').toggleClass('expanded');
 
                    $(this).next('.mid').find('.message > div').toggleClass('hidden');
 

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

	
 
                // change branch filter
0 comments (0 inline, 0 general)