[%# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
#%]
[%#
# types: array of flag_type objects
# no_label: if set to a true value, flag name and status will not be outputted (default: false)
# read_only: if true, don't output edit ui (default: false)
#%]
[% IF read_only %]
[% FOREACH type IN types %]
[% FOREACH flag IN type.flags %]
[% UNLESS no_label %]
[% INCLUDE bug_modal/user.html.tmpl u=flag.setter nick_only=1 %]
[%+ flag.type.name FILTER html %][% flag.status FILTER none %]
[% END %]
[% IF flag.requestee %]
[%+ INCLUDE bug_modal/user.html.tmpl u=flag.requestee nick_only=1 %]
[% END %]
[% END %]
[% END %]
[% RETURN %]
[% END %]
[%
FOREACH type IN types;
FOREACH flag IN type.flags;
IF flag.requestee && flag.requestee.id == user.id;
INCLUDE edit_flag t=type f=flag;
ELSE;
%]
[% INCLUDE view_flag t=type f=flag %]
[% INCLUDE edit_flag t=type f=flag %]
[%
END;
END;
END;
%]
[%
FOREACH type IN types;
NEXT IF !type.is_active || type.flags.size;
INCLUDE edit_flag t=type;
END;
FOREACH type IN types;
NEXT IF !type.is_active || !type.is_multiplicable;
INCLUDE edit_flag t=type;
END;
%]
[% BLOCK view_flag %]
[% INCLUDE bug_modal/user.html.tmpl u=f.setter nick_only=1 %]
[% f.type.name FILTER html %]
[% f.status FILTER html %]
[% IF f.requestee %]
[% INCLUDE bug_modal/user.html.tmpl u=f.requestee nick_only=1 %]
[% END %]
[% END %]
[% BLOCK edit_flag %]
[%
flag_id = f ? "flag-$f.id" : "flag_type-$t.id";
%]
[% IF f %]
[% INCLUDE bug_modal/user.html.tmpl u=f.setter nick_only=1 %]
[% ELSIF t.flags.size %]
addl.
[% END %]
[% IF (t.is_requestable && t.is_requesteeble) || (f && f.requestee) %]
[% flag_name = f ? "requestee-$f.id" : "requestee_type-$t.id" %]
[%
flag_requestee = (f && f.requestee) ? f.requestee.login : '';
flag_multiple = f ? 0 : t.is_multiplicable * 3;
flag_empty_ok = f ? 1 : !t.is_multiplicable;
INCLUDE global/userselect.html.tmpl
name = flag_name
id = flag_name
value = flag_requestee
emptyok = flag_empty_ok
classes = [ "requestee" ]
%]