Mercurial > kallithea
changeset 1877:395a3196de73 beta
merge upstream (keeping my graph.js changes)
author | Aras Pranckevicius <aras@unity3d.com> |
---|---|
date | Mon, 09 Jan 2012 09:37:15 +0200 |
parents | d832f2bbb466 (current diff) 941dee113136 (diff) |
children | 287eff9614fa |
files | rhodecode/public/css/style.css rhodecode/public/js/graph.js rhodecode/templates/changelog/changelog.html |
diffstat | 17 files changed, 132 insertions(+), 70 deletions(-) [+] |
line wrap: on
line diff
--- a/CONTRIBUTORS Mon Jan 09 09:33:36 2012 +0200 +++ b/CONTRIBUTORS Mon Jan 09 09:37:15 2012 +0200 @@ -15,4 +15,4 @@ Les Peabody <lpeabody@gmail.com> Jonas Oberschweiber <jonas.oberschweiber@d-velop.de> Matt Zuba <matt.zuba@goodwillaz.org> - \ No newline at end of file + Aras Pranckevicius <aras@unity3d.com> \ No newline at end of file
--- a/development.ini Mon Jan 09 09:33:36 2012 +0200 +++ b/development.ini Mon Jan 09 09:37:15 2012 +0200 @@ -74,17 +74,17 @@ ## pattern to get the issues from commit messages ## default one used here is #1234 -#url_pat = (?:^#|\s#)(\w+) +url_pat = (?:^#|\s#)(\w+) ## server url to the issue, each {id} will be replaced with id -## fetched from the regex +## fetched from the regex and {repo} is replaced with repository name -#issue_server = https://myissueserver.com/issue/{id} +issue_server_link = https://myissueserver.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by <issue_prefix><id> -#issue_prefix = # +issue_prefix = # ####################################
--- a/docs/changelog.rst Mon Jan 09 09:33:36 2012 +0200 +++ b/docs/changelog.rst Mon Jan 09 09:37:15 2012 +0200 @@ -33,8 +33,9 @@ - implements #330 api method for listing nodes ar particular revision - fixed #331 RhodeCode mangles repository names if the a repository group contains the "full path" to the repositories -- #73 added linking issues in commit messages to choosen issue tracker url +- #73 added linking issues in commit messages to chosen issue tracker url based on user defined regular expression +- new compact changelog with expandable commit messages fixes -----
--- a/docs/setup.rst Mon Jan 09 09:33:36 2012 +0200 +++ b/docs/setup.rst Mon Jan 09 09:37:15 2012 +0200 @@ -434,16 +434,19 @@ uncomment following variables in the ini file:: url_pat = (?:^#|\s#)(\w+) - issue_server = https://myissueserver.com/issue/{id} + issue_server_link = https://myissueserver.com/{repo}/issue/{id} issue_prefix = # -`url_pat` is the regular expression that will match issues, default given regex -will match issues in format of #<number> eg. #300. -Matched issues will be replace with the `issue_server` url replacing {id} with -id fetched from regex. Since the # is striped `issue_prefix` is added as a -prefix to url. `issue_prefix` can be something different than # if you pass -ISSUE- as issue prefix this will generate an url in format -`<a href="https://myissueserver.com/issue/300">ISSUE-300</a>` +`url_pat` is the regular expression that will fetch issues from commit messages. +Default regex will match issues in format of #<number> eg. #300. + +Matched issues will be replace with the link specified as `issue_server_link` +{id} will be replaced with issue id, and {repo} with repository name. +Since the # is striped `issue_prefix` is added as a prefix to url. +`issue_prefix` can be something different than # if you pass +ISSUE- as issue prefix this will generate an url in format:: + + <a href="https://myissueserver.com/example_repo/issue/300">ISSUE-300</a> Hook management ---------------
--- a/production.ini Mon Jan 09 09:33:36 2012 +0200 +++ b/production.ini Mon Jan 09 09:37:15 2012 +0200 @@ -77,9 +77,9 @@ #url_pat = (?:^#|\s#)(\w+) ## server url to the issue, each {id} will be replaced with id -## fetched from the regex +## fetched from the regex and {repo} is replaced with repository name -#issue_server = https://myissueserver.com/issue/{id} +#issue_server_link = https://myissueserver.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by <issue_prefix><id>
--- a/rhodecode/config/deployment.ini_tmpl Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/config/deployment.ini_tmpl Mon Jan 09 09:37:15 2012 +0200 @@ -77,9 +77,9 @@ #url_pat = (?:^#|\s#)(\w+) ## server url to the issue, each {id} will be replaced with id -## fetched from the regex +## fetched from the regex and {repo} is replaced with repository name -#issue_server = https://myissueserver.com/issue/{id} +#issue_server_link = https://myissueserver.com/{repo}/issue/{id} ## prefix to add to link to indicate it's an url ## #314 will be replaced by <issue_prefix><id>
--- a/rhodecode/controllers/admin/repos.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/controllers/admin/repos.py Mon Jan 09 09:37:15 2012 +0200 @@ -278,7 +278,7 @@ return redirect(url('repos')) - @HasRepoPermissionAllDecorator('repository.admin') + @HasRepoPermissionAllDecorator('repository.admin') def delete_perm_user(self, repo_name): """ DELETE an existing repository permission user
--- a/rhodecode/controllers/changelog.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/controllers/changelog.py Mon Jan 09 09:37:15 2012 +0200 @@ -37,8 +37,7 @@ from rhodecode.lib.helpers import RepoPage from rhodecode.lib.compat import json -from vcs.exceptions import RepositoryError, ChangesetError, \ -ChangesetDoesNotExistError,BranchDoesNotExistError +from vcs.exceptions import RepositoryError, ChangesetDoesNotExistError log = logging.getLogger(__name__) @@ -54,7 +53,7 @@ def index(self): limit = 100 - default = 40 + default = 20 if request.params.get('size'): try: int_size = int(request.params.get('size'))
--- a/rhodecode/lib/helpers.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/lib/helpers.py Mon Jan 09 09:37:15 2012 +0200 @@ -739,36 +739,42 @@ def url_func(match_obj): url_full = match_obj.groups()[0] - return '<a href="%(url)s">%(url)s</a>' % ({'url':url_full}) + return '<a href="%(url)s">%(url)s</a>' % ({'url': url_full}) return literal(url_pat.sub(url_func, text_)) -def urlify_commit(text_): + +def urlify_commit(text_, repository=None): import re import traceback - + try: conf = config['app_conf'] - + URL_PAT = re.compile(r'%s' % conf.get('url_pat')) - + if URL_PAT: - ISSUE_SERVER = conf.get('issue_server') + ISSUE_SERVER_LNK = conf.get('issue_server_link') ISSUE_PREFIX = conf.get('issue_prefix') + def url_func(match_obj): issue_id = match_obj.groups()[0] tmpl = ( - '<a class="%(cls)s" href="%(url)s">' - ' %(issue-prefix)s%(id-repr)s' + ' <a class="%(cls)s" href="%(url)s">' + '%(issue-prefix)s%(id-repr)s' '</a>' ) + url = ISSUE_SERVER_LNK.replace('{id}', issue_id) + if repository: + url = url.replace('{repo}', repository) + return tmpl % ( { - 'cls':'issue-tracker-link', - 'url':ISSUE_SERVER.replace('{id}',issue_id), - 'id-repr':issue_id, - 'issue-prefix':ISSUE_PREFIX, - 'serv':ISSUE_SERVER, + 'cls': 'issue-tracker-link', + 'url': url, + 'id-repr': issue_id, + 'issue-prefix': ISSUE_PREFIX, + 'serv': ISSUE_SERVER_LNK, } ) return literal(URL_PAT.sub(url_func, text_)) @@ -778,10 +784,12 @@ return text_ + def rst(source): return literal('<div class="rst-block">%s</div>' % MarkupRenderer.rst(source)) + def rst_w_mentions(source): """ Wrapped rst renderer with @mention highlighting
--- a/rhodecode/lib/rcmail/response.py Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/lib/rcmail/response.py Mon Jan 09 09:37:15 2012 +0200 @@ -141,7 +141,7 @@ MailResponse.to_message. This lets you change it and work with it, then send it out when it's ready. """ - def __init__(self, To=None, From=None, Subject=None, Body=None, Html=None, + def __init__(self, To=None, From=None, Subject=None, Body=None, Html=None, separator="; "): self.Body = Body self.Html = Html
--- a/rhodecode/public/css/style.css Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/public/css/style.css Mon Jan 09 09:37:15 2012 +0200 @@ -1130,7 +1130,27 @@ clear: both; overflow: hidden; margin: 0; - padding: 10px 0; + padding: 5px 0; + white-space: pre-wrap; +} +#content div.box div.expand{ +position:absolute; +width:inherit; +height:14px; +font-size:14px; +text-align:left; +cursor: pointer; +font-family: monospace; +color:#003367; +/* +background:-webkit-gradient(linear,0% 50%,100% 50%,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1))); +background:-webkit-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:-moz-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:-o-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:-ms-linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +background:linear-gradient(top,rgba(255,255,255,0),rgba(255,255,255,1)); +*/ +display: none; } #content div.box div.message a { @@ -2115,8 +2135,12 @@ padding: 5px !important; } +.tablerow0 { + background-color: #F8F8F8; +} + .tablerow1 { - background-color: #F8F8F8; + background-color: #FFFFFF; } .changeset_id { @@ -2246,7 +2270,7 @@ } #graph_content #rev_range_container { - padding: 5px 20px; + padding: 7px 20px; float: left; } @@ -2276,6 +2300,7 @@ #graph_content .container .left .date { color: #444444; + padding-left: 22px; } #graph_content .container .left .author { @@ -2532,7 +2557,10 @@ margin-left:1px; } - +.diffblock .diff-actions { + padding: 2px 0px 0px 2px; + float: left; +} .diffblock .diff-menu ul li { padding: 0px 0px 0px 0px !important; } @@ -3980,6 +4008,7 @@ div.diffblock .code-header .date{ float:left; text-transform: uppercase; + padding: 2px 0px 0px 2px; } div.diffblock .code-header div{ margin-left:4px; @@ -4092,4 +4121,4 @@ cursor: auto !important; background-color: inherit !important; -} \ No newline at end of file +}
--- a/rhodecode/public/js/graph.js Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/public/js/graph.js Mon Jan 09 09:37:15 2012 +0200 @@ -63,18 +63,14 @@ var rela = document.getElementById('graph'); var pad = pad; var scale = 22; - + for (var i in data) { this.scale(scale); + var row = document.getElementById("chg_"+idx); var next = document.getElementById("chg_"+(idx+1)); var extra = 0; - //skip this since i don't have DATE in my app - //if (next.is('.changesets-date')) { - // extra = next.outerHeight(); - //} - this.cell[1] += row.clientWidth; this.bg[1] += this.bg_height; @@ -102,6 +98,7 @@ } this.setColor(color, 0.0, 0.65); + x = pad-((this.cell[0] + this.box_size * start - 1) + this.bg_height-2); @@ -128,6 +125,7 @@ color = node[1] radius = this.dot_radius; + x = pad-(Math.round(this.cell[0] * scale/2 * column + radius) + 15 - (column*4)); this.ctx.beginPath();
--- a/rhodecode/public/js/rhodecode.js Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/public/js/rhodecode.js Mon Jan 09 09:37:15 2012 +0200 @@ -657,7 +657,6 @@ return name } var get_date = function(node){ - console.log(node.firstElementChild) var date_ = node.firstElementChild.innerHTML; return date_ }
--- a/rhodecode/templates/changelog/changelog.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changelog/changelog.html Mon Jan 09 09:37:15 2012 +0200 @@ -44,11 +44,11 @@ </div> %for cnt,cs in enumerate(c.pagination): - <div id="chg_${cnt+1}" class="container ${'tablerow1' if cnt%2==0 else 'tablerow2'}"> + <div id="chg_${cnt+1}" class="container ${'tablerow%s' % (cnt%2)}"> <div class="left"> <div> ${h.checkbox(cs.short_id,class_="changeset_range")} - <span class="tooltip" title="${cs.date}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span> + <span class="tooltip" title="${h.age(cs.date)}"><a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}"><span class="changeset_id">${cs.revision}:<span class="changeset_hash">${h.short_id(cs.raw_id)}</span></span></a></span> </div> <div class="author"> <div class="gravatar"> @@ -56,9 +56,11 @@ </div> <div title="${cs.author}" class="user">${h.person(cs.author)}</div> </div> + <div class="date">${cs.date}</div> </div> <div class="mid"> - <div class="message">${h.link_to(h.wrap_paragraphs(cs.message),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</div> + <div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div> + <div class="expand ${'tablerow%s' % (cnt%2)}">↓ ${_('show more')} ↓</div> </div> <div class="right"> <div id="${cs.raw_id}_changes_info" class="changes"> @@ -132,6 +134,34 @@ } }); + var msgs = YUQ('.message'); + // get firts element height; + var el = YUQ('.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){ + YUD.setStyle(m.nextElementSibling,'display','block'); + YUD.setStyle(m.nextElementSibling,'margin-top',row_h-(h+14)+'px'); + YUD.setAttribute(m.nextElementSibling,'expand',h); + }; + } + YUE.on(YUQ('.expand'),'click',function(e){ + var elem = e.currentTarget.parentElement.parentElement; + YUD.setStyle(e.currentTarget,'display','none'); + YUD.setStyle(elem,'height',YUD.getAttribute(e.currentTarget,'expand')+'px'); + + //redraw the graph max_w and jsdata are global vars + set_canvas(max_w); + + var r = new BranchRenderer(); + r.render(jsdata,max_w); + + }) + // Fetch changeset details YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ var id = e.currentTarget.id @@ -143,7 +173,6 @@ // change branch filter YUE.on(YUD.get('branch_filter'),'change',function(e){ var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; - console.log(selected_branch); var url_main = "${h.url('changelog_home',repo_name=c.repo_name)}"; var url = "${h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__')}"; var url = url.replace('__BRANCH__',selected_branch); @@ -188,4 +217,4 @@ %endif </div> </div> -</%def> \ No newline at end of file +</%def>
--- a/rhodecode/templates/changeset/changeset.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changeset/changeset.html Mon Jan 09 09:37:15 2012 +0200 @@ -27,15 +27,15 @@ <div class="table"> <div class="diffblock"> <div class="code-header"> - <div class="date">${c.changeset.revision}: - ${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} + <div class="date"> + R${c.changeset.revision}:${h.link_to(h.short_id(c.changeset.raw_id),h.url('changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id))} ${c.changeset.date}</div> - <span class="diff-actions"> - <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white_text.png')}"/></a> - <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/down_16.png')}"/></a> + <div class="diff-actions"> + <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a> + <a href="${h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a> ${c.ignorews_url()} ${c.context_url()} - </span> + </div> <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> </div> </div> @@ -49,7 +49,7 @@ <span>${h.person(c.changeset.author)}</span><br/> <span><a href="mailto:${h.email_or_none(c.changeset.author)}">${h.email_or_none(c.changeset.author)}</a></span><br/> </div> - <div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message))}</div> + <div class="message">${h.urlify_commit(h.wrap_paragraphs(c.changeset.message),c.repo_name)}</div> </div> <div class="right"> <div class="changes"> @@ -138,15 +138,11 @@ YUE.on(YUQ('.show-inline-comments'),'change',function(e){ var show = 'none'; var target = e.currentTarget; - console.log(target); if(target.checked){ var show = '' } - console.log('aa') var boxid = YUD.getAttribute(target,'id_for'); - console.log(boxid); var comments = YUQ('#{0} .inline-comments'.format(boxid)); - console.log(comments) for(c in comments){ YUD.setStyle(comments[c],'display',show); }
--- a/rhodecode/templates/changeset/changeset_range.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changeset/changeset_range.html Mon Jan 09 09:37:15 2012 +0200 @@ -41,7 +41,7 @@ <td>${h.link_to('r%s:%s' % (cs.revision,h.short_id(cs.raw_id)),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}</td> <td><div class="author">${h.person(cs.author)}</div></td> <td><span class="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td> - <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message))}</div></td> + <td><div class="message">${h.urlify_commit(h.wrap_paragraphs(cs.message),c.repo_name)}</div></td> </tr> %endfor </table>
--- a/rhodecode/templates/changeset/diff_block.html Mon Jan 09 09:33:36 2012 +0200 +++ b/rhodecode/templates/changeset/diff_block.html Mon Jan 09 09:37:15 2012 +0200 @@ -15,13 +15,13 @@ ${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)))} </div> - <span class="diff-actions"> - <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" title="${_('diff')}"><img class="icon" src="${h.url('/images/icons/page_white_text.png')}"/></a> - <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white_text.png')}"/></a> - <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/down_16.png')}"/></a> + <div class="diff-actions"> + <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='diff',fulldiff=1)}" title="${_('diff')}"><img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/></a> + <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw')}" title="${_('raw diff')}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a> + <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='download')}" title="${_('download diff')}"><img class="icon" src="${h.url('/images/icons/page_white_get.png')}"/></a> ${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))} ${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))} - </span> + </div> <span style="float:right;margin-top:-3px"> <label> ${_('show inline comments')}