ticket-depends-on.mdwn 1.2 KB

1234567891011121314151617181920212223242526
  1. This template is used to indicate on a [[ticket|/tickets]] page that is depends
  2. on another given ticket, i.e. there is a ticket that needs to be closed first.
  3. For example, "eat salad" depends on "make salad". Parameters:
  4. - `proj`: Name of the project the depended ticket belongs to, i.e. a page under
  5. [[/projects]]. If you specify `proj`, there's no need to specify
  6. `dir` (default: the dependent ticket's project)
  7. - `dir`: The parent page under which the depended ticket is located. Use this
  8. if `proj` doesn't suit your needs. (default: the parent page of the
  9. dependent ticket, unless `proj` is used)
  10. - `n`: The depended ticket's page name (required)
  11. [[!templatebody <<ENDBODY
  12. [[!tag
  13. <TMPL_IF proj>
  14. /projects/<TMPL_VAR raw_proj>/tickets/<TMPL_VAR raw_n>]] Depends on [[/projects/<TMPL_VAR raw_proj>]] >> [[!template id=tktref proj="""<TMPL_VAR raw_proj>""" n="""<TMPL_VAR raw_n>"""
  15. <TMPL_ELSE>
  16. <TMPL_IF dir>
  17. <TMPL_VAR raw_dir>/<TMPL_VAR raw_n>]] Depends on [[<TMPL_VAR raw_dir>]] >> [[!template id=tktref dir="""<TMPL_VAR raw_dir>""" n="""<TMPL_VAR raw_n>"""
  18. <TMPL_ELSE>
  19. <TMPL_VAR raw_n>]] Depends on [[!template id=tktref dir=. n="""<TMPL_VAR raw_n>"""
  20. </TMPL_IF>
  21. </TMPL_IF>
  22. ]]
  23. ENDBODY]]