Changeset - 929fc8d926d5
[Not reviewed]
beta
0 3 0
Aras Pranckevicius - 14 years ago 2012-01-07 18:07:00
aras@unity3d.com
changeset: replace diff/whitespace/context popup menu with icons
3 files changed with 17 insertions and 37 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changeset.py
Show inline comments
 
@@ -90,13 +90,14 @@ def _ignorews_url(fileid=None):
 
        ctx_val = 'C:%s' % ln_ctx
 
    # if we have passed in ln_ctx pass it along to our params
 
    if ln_ctx:
 
        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):
 
    ln_ctx_global = request.GET.get('context')
 
    ln_ctx = filter(lambda k: k.startswith('C'), GET.getall(fid))
 

	
 
@@ -140,13 +141,14 @@ def _context_url(fileid=None):
 
    if ig_ws:
 
        params[ig_ws_key] += [ig_ws_val]
 

	
 
    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):
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
rhodecode/templates/changeset/changeset.html
Show inline comments
 
@@ -27,23 +27,18 @@
 
    <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))}
 
                  ${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>
 
	    <div id="changeset_content">
 
			<div class="container">
 
	             <div class="left">
 
@@ -137,24 +132,12 @@
 
          }
 
          ajaxPOST(url,postData,success);
 
      }
 

	
 
      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;
 
              if(target.checked){
 
                  var show = ''
 
              }
rhodecode/templates/changeset/diff_block.html
Show inline comments
 
@@ -12,24 +12,19 @@
 
        <div class="code-header">
 
            <div class="changeset_header">
 
                <div 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)))}
 
                </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')}
 
                  ${h.checkbox('',checked="checked",class_="show-inline-comments",id_for=h.FID(filenode.changeset.raw_id,filenode.path))}
 
                  </label>
 
                </span>
0 comments (0 inline, 0 general)