diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -363,7 +363,7 @@ from rhodecode.lib.vcs.utils import auth from rhodecode.lib.utils2 import credentials_filter, age as _age from rhodecode.model.db import User, ChangesetStatus -age = lambda x: _age(x) +age = lambda x,y=False: _age(x,y) capitalize = lambda x: x.capitalize() email = author_email short_id = lambda x: x[:12] diff --git a/rhodecode/lib/utils2.py b/rhodecode/lib/utils2.py --- a/rhodecode/lib/utils2.py +++ b/rhodecode/lib/utils2.py @@ -349,11 +349,15 @@ def engine_from_config(configuration, pr return engine -def age(prevdate): +def age(prevdate, show_short_version=False): """ turns a datetime into an age string. + If show_short_version is True, then it will generate a not so accurate but shorter string, + example: 2days ago, instead of 2 days and 23 hours ago. + :param prevdate: datetime object + :param show_short_version: if it should aproximate the date and return a shorter string :rtype: unicode :returns: unicode words describing age """ @@ -423,7 +427,7 @@ def age(prevdate): else: sub_value = 0 - if sub_value == 0: + if sub_value == 0 or show_short_version: if future: return _(u'in %s') % fmt_funcs[part](value) else: diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -1844,14 +1844,18 @@ div.form div.fields div.field div.button padding: 0 3px 2px; } -#summary { - float: left; - width: 80%; +#content div.box #summary { + /*float: left;*/ + /*width: 80%;*/ + margin-right: 200px; } #summary-menu-stats{ float: left; - width: 20%; + width: 200px; + position: absolute; + top: 0; + right: 0; } #summary-menu-stats ul { @@ -2521,10 +2525,10 @@ h3.files_location { text-align: right; } -#changeset_content .container .left .message { +#changeset_content .container .message { white-space: pre-wrap; } -#changeset_content .container .left .message a:hover { +#changeset_content .container .message a:hover { text-decoration: none; } .cs_files .cur_cs { @@ -2620,23 +2624,30 @@ h3.files_location { text-align: left; } +.table { + position: relative; +} + #graph { + position: relative; overflow: hidden; } #graph_nodes { - float: left; - margin-right: 0px; - margin-top: 0px; + position: absolute; +} + +#graph_content, +#graph .info_box, +#graph .container_header { + margin-left: 100px; } #graph_content { - width: 80%; - float: left; -} - -#graph_content .container_header { - border-bottom: 1px solid #DDD; + position: relative; +} + +#graph .container_header { padding: 10px; height: 25px; } @@ -2651,55 +2662,140 @@ h3.files_location { margin: 0px 0px 0px 3px; } +#graph_content #changesets { + table-layout: fixed; + border-collapse: collapse; + border-left: none; + border-right: none; + border-color: #cdcdcd; +} + #graph_content .container { - border-bottom: 1px solid #DDD; - height: 56px; + min-height: 5em; +} + +#graph_content #changesets td { overflow: hidden; + text-overflow:ellipsis; + white-space: nowrap; + height: 31px; + border-color: #cdcdcd; +} + +#graph_content .container .author { + width: 105px; +} + +#graph_content .container .hash{ + width: 90px; + font-size: 0.85em; +} + +#graph_content #changesets .container .date{ + width: 76px; + color: #666; + font-size: 10px; } #graph_content .container .right { - float: right; - width: 23%; - text-align: right; -} - -#graph_content .container .left { - float: left; - width: 25%; - padding-left: 5px; -} - + width: 120px; + padding-right: 0px; +} + +/* +#graph_content .container .column3 { + width: 12% +} +*/ #graph_content .container .mid { + position: relative; +} + + + + +#graph_content #changesets td.checkbox{ + width: 20px; +} + +#graph_content .container .changeset_range { float: left; - width: 49%; -} - - -#graph_content .container .left .date { - color: #666; - padding-left: 22px; - font-size: 10px; -} - -#graph_content .container .left .author { - height: 22px; -} - -#graph_content .container .left .author .user { + margin: 6px 3px; +} + + + +#graph_content .container .author img { + vertical-align: middle; +} + +#graph_content .container .author .user { color: #444444; - float: left; - margin-left: -4px; - margin-top: 4px; } #graph_content .container .mid .message { white-space: pre-wrap; + padding: 0; + overflow: hidden; + height: 1.1em; +} + +#graph_content .container .mid .logtags { + display: block; + position: absolute; + top: 0; + right: 0; + padding: 0 5px; + background: #FFFFFF; +} + +#graph_content .right .comments-container, +#graph_content .right .logtags { + display: block; + float: left; + overflow: hidden; + width: 50%; + padding: 0; + margin: 0; +} + +#graph_content .right .comments-container{ + width: 40px; +} + +#graph_content .right .logtags { + width: 80px; + height: 2.5em; + position: absolute; + left: 40px; +} + +#graph_content .right .logtags:hover { + position: absolute; + width: auto; +} + +#graph_content .right .logtags .bookbook, +#graph_content .right .logtags .tagtag { + float: left; + line-height: 1em; + margin-bottom: 1px; } #graph_content .container .mid .message a:hover { text-decoration: none; } +/* + * Stuff we might want to remove from the changelog, or reposition in a tooltip + */ +#graph_content .container .changeset_id, +#graph_content .container .changes, +#graph_content .container .changed_total, +#graph_content .container .parent { + display: none; +} + .revision-link { color:#3F6F9F; font-weight: bold !important; @@ -2735,17 +2831,18 @@ h3.files_location { .code-header .changeset-status-container .changeset-status-ico, .container .changeset-status-ico { float: left; } -.right .comments-container { - padding-right: 5px; - margin-top:1px; - float:right; - height:14px; -} .right .comments-cnt { - float: left; color: rgb(136, 136, 136); - padding-right: 2px; + padding: 5px 0; +} + +.right .comments-cnt a { + background-image: url('../images/icons/comments.png'); + background-repeat: no-repeat; + background-position: 100% 50%; + padding: 5px 0; + padding-right: 20px; } .right .changes { @@ -2790,7 +2887,6 @@ h3.files_location { padding: 1px 3px 1px 3px; background-color: #fca062; font-size: 10px; - font-weight: bold; color: #ffffff; text-transform: uppercase; white-space: nowrap; @@ -2804,7 +2900,8 @@ h3.files_location { clear:both; } .right .logtags { - padding: 2px 2px 2px 2px; + /*padding: 2px 2px 2px 2px;*/ + line-height: 2.2em; } .right .logtags .branchtag, .right .logtags .tagtag, .right .logtags .booktag { margin: 0px 2px; @@ -2814,20 +2911,30 @@ h3.files_location { .logtags .branchtag, .spantag { padding: 1px 3px 1px 3px; - background-color: #bfbfbf; font-size: 10px; - font-weight: bold; - color: #ffffff; + color: #336699; white-space: nowrap; - -webkit-border-radius: 3px; - border-radius: 3px; -} + -webkit-border-radius: 4px; + border-radius: 4px; + border: 1px solid #d9e8f8; + line-height: 1.5em; + margin: 1.1em 0; +} + +.right .logtags .branchtag, +.logtags .tagtag, +.right .merge { + float: right; + /*height: 1em;*/ + line-height: 1em; + /*padding: 0px 0px !important;*/ + margin: 1px 1px !important; + display: block; +} + .right .logtags .branchtag a:hover, .logtags .branchtag a { - color: #ffffff; -} -.right .logtags .branchtag a:hover, .logtags .branchtag a:hover { text-decoration: none; - color: #ffffff; + color: #336699; } .right .logtags .tagtag, .logtags .tagtag { padding: 1px 3px 1px 3px; @@ -2850,9 +2957,7 @@ h3.files_location { padding: 1px 3px 1px 3px; background-color: #46A546; font-size: 10px; - font-weight: bold; color: #ffffff; - text-transform: uppercase; white-space: nowrap; -webkit-border-radius: 3px; border-radius: 3px; @@ -3728,6 +3833,7 @@ div#legend_data, div#legend_container, d } #content div.box div.form, #content div.box div.table, #content div.box div.traffic { + position: relative; clear: both; overflow: hidden; margin: 0; @@ -3985,13 +4091,7 @@ div.form div.fields div.field div.highli width: 600px; } -#changeset_content .container .left { - float: left; - width: 75%; - padding-left: 5px; -} - -#changeset_content .container .left .date, .ac .match { +#changeset_content .container .date, .ac .match { font-weight: 700; padding-top: 5px; padding-bottom: 5px; diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -16,7 +16,7 @@ <%def name="main()"> - ${self.context_bar('changelog')} +${self.context_bar('changelog')}
@@ -25,11 +25,7 @@
% if c.pagination:
-
- -
-
-
+
@@ -39,246 +35,267 @@ %if h.is_hg(c.rhodecode_repo): ${_('Open new pull request')} %endif +
+
+ ${h.form(h.url.current(),method='get')} +
+ ${h.submit('set',_('Show'),class_="ui-btn")} + ${h.text('size',size=1,value=c.size)} + ${_('revisions')}
-
- ${h.form(h.url.current(),method='get')} -
- ${h.submit('set',_('Show'),class_="ui-btn")} - ${h.text('size',size=1,value=c.size)} - ${_('revisions')} -
- ${h.end_form()} + ${h.end_form()}
${h.select('branch_filter',c.branch_name,c.branch_filters)}
-
+
+
+ +
+
+ + %for cnt,cs in enumerate(c.pagination): -
-
-
+
+ + + + + + + + %endfor + +
${h.checkbox(cs.raw_id,class_="changeset_range")} - ${cs.revision}:${h.short_id(cs.raw_id)} - -
-
- gravatar -
-
${h.shorter(h.person(cs.author),22)}
-
-
${h.fmt_date(cs.date)}
- -
+
+ gravatar + ${h.shorter(h.person(cs.author),22)} + + + + ${cs.revision} : + ${h.short_id(cs.raw_id)} + + + +
${h.age(cs.date,True)}
+
${h.urlify_commit(cs.message, c.repo_name,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
↓ ${_('Show more')} ↓
- -
-
-
${len(cs.affected_files)}
-
- %if len(c.comments.get(cs.raw_id,[])) > 0: - + %if cs.branch: +
+
+ ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} +
+
+ %endif +
+
+
+ ${len(cs.affected_files)} +
+ +
+ %if c.statuses.get(cs.raw_id): +
${c.statuses.get(cs.raw_id)[1]}
+
+ %if c.statuses.get(cs.raw_id)[2]: + + %else: + %endif -
-
- %if c.statuses.get(cs.raw_id): -
${c.statuses.get(cs.raw_id)[1]}
-
- %if c.statuses.get(cs.raw_id)[2]: - - %else: - - %endif -
- %endif -
+
+ %endif +
+ + %if cs.parents: + %for p_cs in reversed(cs.parents): +
${_('Parent')} + ${p_cs.revision}:${h.link_to(h.short_id(p_cs.raw_id), + h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)}
- %if cs.parents: - %for p_cs in reversed(cs.parents): -
${_('Parent')} - ${p_cs.revision}:${h.link_to(h.short_id(p_cs.raw_id), - h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.raw_id),title=p_cs.message)} -
- %endfor - %else: -
${_('No parents')}
- %endif - - - %if len(cs.parents)>1: + %endfor + %else: +
${_('No parents')}
+ %endif +
+ %if len(c.comments.get(cs.raw_id,[])) > 0: + + %endif +
+
+ %if len(cs.parents)>1: ${_('merge')} - %endif - %if cs.branch: - - ${h.link_to(h.shorter(cs.branch),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} + %endif + + %if h.is_hg(c.rhodecode_repo): + %for book in cs.bookmarks: + + ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} + + %endfor + %endif + %for tag in cs.tags: + + ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} - %endif - %if h.is_hg(c.rhodecode_repo): - %for book in cs.bookmarks: - - ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} - - %endfor - %endif - %for tag in cs.tags: - - ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} - %endfor - -
- + %endfor + +
+ +
${c.pagination.pager('$link_previous ~2~ $link_next')}
-
+
- - + + + // Fetch changeset details + YUE.on(YUD.getElementsByClassName('changed_total'),'click',function(e){ + var id = e.currentTarget.id; + var url = "${h.url('changelog_details',repo_name=c.repo_name,cs='__CS__')}"; + var url = url.replace('__CS__',id.replace('changed_total_','')); + ypjax(url,id,function(){tooltip_activate()}); + }); + + // change branch filter + YUE.on(YUD.get('branch_filter'),'change',function(e){ + var selected_branch = e.currentTarget.options[e.currentTarget.selectedIndex].value; + 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); + if(selected_branch != ''){ + window.location = url; + }else{ + window.location = url_main; + } + + }); + + function set_canvas(width) { + var c = document.getElementById('graph_nodes'); + var t = document.getElementById('graph_content'); + canvas = document.getElementById('graph_canvas'); + var div_h = t.clientHeight; + //c.style.height=div_h+'px'; + canvas.setAttribute('height',div_h); + //c.style.height=width+'px'; + canvas.setAttribute('width',width); + }; + var heads = 1; + var line_count = 0; + var jsdata = ${c.jsdata|n}; + + for (var i=0;i line_count) + line_count = m; + } + } + set_canvas(100); + + var r = new BranchRenderer(); + r.render(jsdata,100,line_count); + + }); + %else: ${_('There are no changes yet')} %endif