@@ -3226,25 +3226,25 @@ div.rst-block pre {
background-color: #eee;
border: 1px solid #ddd;
padding: 5px;
color: #444;
overflow: auto;
-webkit-box-shadow: rgba(0,0,0,0.07) 0 1px 2px inset;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
/** comment main **/
.comments {
padding:10px 20px;
.comments .comment {
margin-top: 10px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
@@ -3268,24 +3268,25 @@ div.rst-block pre {
.comments .comment .text {
padding: 8px 6px 6px 14px;
background-color: #FAFAFA;
.comments .comments-number{
padding:0px 0px 10px 0px;
font-weight: bold;
color: #666;
font-size: 16px;
/** comment form **/
.comment-form .clearfix{
background: #EEE;
padding: 10px;
div.comment-form {
margin-top: 20px;
@@ -3385,13 +3386,64 @@ form.comment-inline-form {
.comment-inline-form .comment {
margin-left: 10px;
.comment-inline-form .comment-help{
padding: 0px 0px 2px 0px;
color: #666666;
font-size: 10px;
.comment-inline-form .comment-button{
padding-top:5px;
\ No newline at end of file
/** comment inline **/
.inline-comments {
.inline-comments div.rst-block {
clear:both;
overflow:hidden;
margin:0;
padding:0 20px 0px;
.inline-comments .comment {
margin-left: 5px;
margin-right: 5px;
margin-bottom: 3px;
.inline-comments .comment .meta {
background: #f8f8f8;
padding: 6px;
border-bottom: 1px solid #ddd;
.inline-comments .comment .meta img {
vertical-align: middle;
.inline-comments .comment .meta .user {
.inline-comments .comment .meta .date {
float: right;
.inline-comments .comment .text {
.inline-comments .comments-number{
@@ -295,33 +295,38 @@ var ajaxPOST = function(url,postData,suc
},
};
var postData = postData;
var request = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, postData);
/** comments **/
var removeInlineForm = function(form) {
form.parentNode.removeChild(form);
var createInlineForm = function(parent_tr, f_path, line) {
var tableTr = function(cls,body){
var form = document.createElement('tr');
YUD.addClass(form, 'comment-form-inline');
YUD.addClass(form, cls);
form.innerHTML = '<td class="lineno new"></td>'+
'<td class="lineno old"></td>'+
'<td>{0}</td>'.format(body);
return form;
var tmpl = YUD.get('comment-inline-form-template').innerHTML;
tmpl = tmpl.format(f_path, line);
'<td>{0}</td>'.format(tmpl);
var form = tableTr('comment-form-inline',tmpl)
// create event for hide button
form = new YAHOO.util.Element(form);
var form_hide_button = new YAHOO.util.Element(form.getElementsByClassName('hide-inline-form')[0]);
form_hide_button.on('click', function(e) {
var newtr = e.currentTarget.parentNode.parentNode.parentNode.parentNode.parentNode;
removeInlineForm(newtr);
YUD.removeClass(parent_tr, 'form-open');
});
return form
var getLineNo = function(tr) {
var line;
@@ -9,24 +9,30 @@
<%def name="breadcrumbs_links()">
${h.link_to(u'Home',h.url('/'))}
»
${h.link_to(c.repo_name,h.url('summary_home',repo_name=c.repo_name))}
${_('Changeset')} - r${c.changeset.revision}:${h.short_id(c.changeset.raw_id)}
</%def>
<%def name="page_nav()">
${self.menu('changelog')}
<%def name="fid(raw_id,path)" filter="strip">
<%
return 'C-%s-%s' % (h.short_id(raw_id),h.safeid(h.safe_unicode(path)))
%>
<%def name="main()">
<div class="box">
<!-- box / title -->
<div class="title">
${self.breadcrumbs()}
</div>
<div class="table">
<div class="diffblock">
<div class="code-header">
<div>
» <span>${h.link_to(_('raw diff'),
@@ -83,41 +89,41 @@
<span class="tagtag" title="${'%s %s' % (_('tag'),tag)}">
${h.link_to(tag,h.url('files_home',repo_name=c.repo_name,revision=c.changeset.raw_id))}</span>
%endfor
</span>
<span style="font-size:1.1em;font-weight: bold">
${_('%s files affected with %s additions and %s deletions.') % (len(c.changeset.affected_files),c.lines_added,c.lines_deleted)}
<div class="cs_files">
%for change,filenode,diff,cs1,cs2,stat in c.changes:
<div class="cs_${change}">
<div class="node">${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor='C-%s-%s' % (h.short_id(filenode.changeset.raw_id),h.safeid(h.safe_unicode(filenode.path)))))}</div>
<div class="node">${h.link_to(h.safe_unicode(filenode.path),h.url.current(anchor=self.fid(filenode.changeset.raw_id,filenode.path)))}</div>
<div class="changes">${h.fancy_file_stats(stat)}</div>
% if c.cut_off:
${_('Changeset was too big and was cut off...')}
% endif
%if change !='removed':
<div style="clear:both;height:10px"></div>
<div class="diffblock margined">
<div id="${'C-%s-%s' % (h.short_id(filenode.changeset.raw_id),h.safeid(h.safe_unicode(filenode.path)))}" class="code-header">
<div id="${self.fid(filenode.changeset.raw_id,filenode.path)}" class="code-header">
<div class="changeset_header">
<span class="changeset_file">
${h.link_to_if(change!='removed',h.safe_unicode(filenode.path),h.url('files_home',repo_name=c.repo_name,
revision=filenode.changeset.raw_id,f_path=h.safe_unicode(filenode.path)))}
» <span>${h.link_to(_('diff'),
h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff'))}</span>
h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</span>
» <span>${h.link_to(_('download diff'),
h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download'))}</span>
@@ -133,27 +139,27 @@
%endif
<%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
## template for inline comment form
${comment.comment_inline_form()}
<div class="comments">
<div class="comments-number">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div>
%for path, lines in c.inline_comments:
<div class="inline-comment-placeholder" path="${path} ">
<div style="display:none" class="inline-comment-placeholder" path="${path}" target_id="${self.fid(c.changeset.raw_id,path)}">
% for line,comments in lines.iteritems():
<div class="inline-comment-placeholder-line" line="${line}">
<div class="inline-comment-placeholder-line" line="${line}" target_id="${h.safeid(h.safe_unicode(path))}">
%for co in comments:
${comment.comment_block(co)}
%for co in c.comments:
%if c.rhodecode_user.username != 'default':
@@ -199,18 +205,35 @@
YUE.on(YUQ('.line'),'click',function(e){
var tr = e.currentTarget;
if(YUD.hasClass(tr,'form-open') || YUD.hasClass(tr,'context')){
return
YUD.addClass(tr,'form-open');
var node = tr.parentNode.parentNode.parentNode.getElementsByClassName('full_f_path')[0];
var f_path = YUD.getAttribute(node,'path');
var lineno = getLineNo(tr);
var form = createInlineForm(tr, f_path, lineno);
YUD.insertAfter(form,tr);
})
// inject comments into they proper positions
var file_comments = YUQ('.inline-comment-placeholder');
for (f in file_comments){
var box = file_comments[f];
var inlines = box.children;
for(var i=0; i<inlines.length; i++){
var inline = inlines[i];
var lineno = YUD.getAttribute(inlines[i],'line');
var lineid = "a{0}_{1}".format(YUD.getAttribute(inline,'target_id'),lineno);
var target_line = YUD.get(lineid);
var comments = new YAHOO.util.Element(tableTr('inline-comments',inline.innerHTML))
YUD.insertAfter(comments,target_line.parentNode);
</script>
Status change: