@@ -72,49 +72,49 @@ def _ignorews_url(fileid=None):
params = defaultdict(list)
lbl = _('show white space')
ig_ws = get_ignore_ws(fileid, request.GET)
ln_ctx = get_line_ctx(fileid, request.GET)
# global option
if fileid is None:
if ig_ws is None:
params['ignorews'] += [1]
lbl = _('ignore white space')
ctx_key = 'context'
ctx_val = ln_ctx
# per file options
else:
params[fileid] += ['WS:1']
ctx_key = fileid
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
img = h.image('/images/icons/text_strikethrough.png', lbl, class_='icon')
img = h.image(h.url('/images/icons/text_strikethrough.png'), lbl, class_='icon')
return h.link_to(img, h.url.current(**params), title=lbl, class_='tooltip')
def get_line_ctx(fid, GET):
ln_ctx_global = request.GET.get('context')
ln_ctx = filter(lambda k: k.startswith('C'), GET.getall(fid))
retval = ln_ctx[0].split(':')[-1]
retval = ln_ctx_global
try:
return int(retval)
except:
return
def _context_url(fileid=None):
"""
Generates url for context lines
:param fileid:
@@ -123,49 +123,49 @@ def _context_url(fileid=None):
if ln_ctx > 0:
params['context'] += [ln_ctx]
if ig_ws:
ig_ws_key = 'ignorews'
ig_ws_val = 1
# per file option
params[fileid] += ['C:%s' % ln_ctx]
ig_ws_key = fileid
ig_ws_val = 'WS:%s' % 1
params[ig_ws_key] += [ig_ws_val]
lbl = _('%s line context') % ln_ctx
img = h.image('/images/icons/table_add.png', lbl, class_='icon')
img = h.image(h.url('/images/icons/table_add.png'), lbl, class_='icon')
class ChangesetController(BaseRepoController):
@LoginRequired()
@HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
'repository.admin')
def __before__(self):
super(ChangesetController, self).__before__()
c.affected_files_cut_off = 60
def index(self, revision):
c.anchor_url = anchor_url
c.ignorews_url = _ignorews_url
c.context_url = _context_url
#get ranges of revisions if preset
rev_range = revision.split('...')[:2]
enable_comments = True
if len(rev_range) == 2:
enable_comments = False
Status change: