[%# 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 %]