~zubairassad89/sahana-eden/vms_gsoc

« back to all changes in this revision

Viewing changes to models/00_utils.py

  • Committer: Patricia Tressel
  • Date: 2010-07-27 12:07:30 UTC
  • Revision ID: tressel@phobos-20100727120730-rka362juja5t2387
Allow passing info via URL vars:
  Preserve vars across rheader tabs and shn_read.
  (There are more places where vars will need to be propagated.)
Fix vol tabs:
  Convert volunteer-specific pr component tables to pr_<name> and join by pe_id.
  Use same controller for generic person tabs and volunteer tabs and pass
  desired tab set in vars.
Remove obsolete message table comments from vol.
Minor style cleanup in vol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
               jr.custom_action and jr.method == component:
546
546
                _class = "rheader_tab_here"
547
547
            args = [jr.id, component]
548
 
            _href = URL(r=request, f=jr.name, args=args)
 
548
            _href = URL(r=request, f=jr.name, args=args, vars=jr.request.vars)
549
549
        else:
550
550
            if not jr.component:
551
551
                _class = "rheader_tab_here"
552
552
            args = [jr.id]
553
 
            _next = URL(r=request, f=jr.name, args=[jr.id])
554
 
            _href = URL(r=request, f=jr.name, args=args, vars = {"_next": _next})
 
553
            vars = jr.request.vars or {}
 
554
            if not "_next" in jr.request.vars:
 
555
                vars["_next"] = URL(r=request, f=jr.name, args=[jr.id])
 
556
            _href = URL(r=request, f=jr.name, args=args, vars=vars)
 
557
 
555
558
        tab = SPAN(A(title, _href=_href), _class=_class)
556
559
        rheader_tabs.append(tab)
557
560