Move to maketext: sample templates

SnowyOwl vitaly.fedrushkov at gmail.com
Tue Jan 20 13:24:34 UTC 2009


> Natural language in real example consisted of

>    <>Edit this user<> or <>find other accounts<>
>    or go <>back to the user list<>

Another idea went in while reading this back:

implement FILTER linkify(anchor1, ... anchorN):

Instance of <N> within text is replaced to <a anchorN>, empty <> with
</a>.  Would enhance readability and simplify separation of text and
markup.  Optionally FILTER url_quote may be enforced on anchors, to
make the whole construct safe (anyone to provide counter-example when
we should not do so?)

Example:

 [% FILTER linkify('href="editusers.cgi?action=edit&userid=' _
otheruser.id _
                     " title="' _ l("Edit user '[_1]'",
otheruser.login) _ '"',
                   'title="' _ l("Search For Users") _ '"
href="editusers.cgi"') %]
   {{<1>Edit this user<> or <2>find other accounts<>}}
 [% END %]

Here 'linkify' and 'l' filters are orthogonal, and 'l' is inner.

   Regards,
   Vitaly.

_______________________________________________
dev-apps-bugzilla mailing list
dev-apps-bugzilla at lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-apps-bugzilla



More information about the developers mailing list