Mercurial > kallithea
changeset 1859:929fc8d926d5 beta
changeset: replace diff/whitespace/context popup menu with icons
author | Aras Pranckevicius <aras@unity3d.com> |
---|---|
date | Sat, 07 Jan 2012 19:07:00 +0200 |
parents | 609ec28bd2d1 |
children | 1f06cd49cb3e |
files | rhodecode/controllers/changeset.py rhodecode/templates/changeset/changeset.html rhodecode/templates/changeset/diff_block.html |
diffstat | 3 files changed, 17 insertions(+), 37 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/controllers/changeset.py Fri Jan 06 22:12:22 2012 +0200 +++ b/rhodecode/controllers/changeset.py Sat Jan 07 19:07:00 2012 +0200 @@ -93,7 +93,8 @@ params[ctx_key] += [ctx_val] params['anchor'] = fileid - return h.link_to(lbl, h.url.current(**params)) + img = h.image('/images/icons/text_strikethrough.png', lbl, class_='icon') + return h.link_to(img, h.url.current(**params), title=lbl) def get_line_ctx(fid, GET): @@ -143,7 +144,8 @@ lbl = _('%s line context') % ln_ctx params['anchor'] = fileid - return h.link_to(lbl, h.url.current(**params)) + img = h.image('/images/icons/table_add.png', lbl, class_='icon') + return h.link_to(img, h.url.current(**params), title=lbl) class ChangesetController(BaseRepoController):
--- a/rhodecode/templates/changeset/changeset.html Fri Jan 06 22:12:22 2012 +0200 +++ b/rhodecode/templates/changeset/changeset.html Sat Jan 07 19:07:00 2012 +0200 @@ -30,17 +30,12 @@ <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))} ${c.changeset.date}</div> - <div class="diff-menu-wrapper"> - <img class="diff-menu-activate" style="cursor: pointer" alt="diff-menu" src="${h.url('/images/icons/script_gear.png')}" /> - <div class="diff-menu" style="display:none"> - <ul> - <li>${h.link_to(_('raw diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='show'))}</li> - <li>${h.link_to(_('download diff'),h.url('raw_changeset_home',repo_name=c.repo_name,revision=c.changeset.raw_id,diff='download'))}</li> - <li>${c.ignorews_url()}</li> - <li>${c.context_url()}</li> - </ul> - </div> - </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> + ${c.ignorews_url()} + ${c.context_url()} + </span> <div class="comments-number" style="float:right;padding-right:5px">${len(c.comments)} comment(s) (${c.inline_cnt} ${_('inline')})</div> </div> </div> @@ -140,18 +135,6 @@ YUE.onDOMReady(function(){ - YUE.on(YUQ('.diff-menu-activate'),'click',function(e){ - var act = e.currentTarget.nextElementSibling; - - if(YUD.hasClass(act,'active')){ - YUD.removeClass(act,'active'); - YUD.setStyle(act,'display','none'); - }else{ - YUD.addClass(act,'active'); - YUD.setStyle(act,'display',''); - } - }); - YUE.on(YUQ('.show-inline-comments'),'change',function(e){ var show = 'none'; var target = e.currentTarget;
--- a/rhodecode/templates/changeset/diff_block.html Fri Jan 06 22:12:22 2012 +0200 +++ b/rhodecode/templates/changeset/diff_block.html Sat Jan 07 19:07:00 2012 +0200 @@ -15,18 +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> - <div class="diff-menu-wrapper"> - <img class="diff-menu-activate" style="margin-bottom:-6px;cursor: pointer" alt="diff-menu" src="${h.url('/images/icons/script_gear.png')}" /> - <div class="diff-menu" style="display:none"> - <ul> - <li>${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',fulldiff=1))}</li> - <li>${h.link_to(_('raw diff'),h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(filenode.path),diff2=cs2,diff1=cs1,diff='raw'))}</li> - <li>${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'))}</li> - <li>${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))}</li> - <li>${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))}</li> - </ul> - </div> - </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> + ${c.ignorews_url(h.FID(filenode.changeset.raw_id,filenode.path))} + ${c.context_url(h.FID(filenode.changeset.raw_id,filenode.path))} + </span> <span style="float:right;margin-top:-3px"> <label> ${_('show inline comments')}