[%# Allows users to enable/disable beta features Authors: Afuna Copyright (c) 2015 by Dreamwidth Studios, LLC. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. For a copy of the license, please reference 'perldoc perlartistic' or 'perldoc perlgpl'. %] [%- sections.title = ".title" | ml( sitename = site.name ) -%] [%- CALL dw.active_resource_group( "foundation" ) -%]
[%- IF news_journal -%] [%- ".staytuned.newscomm" | ml( news = news_journal.ljuser_display ) -%] [%- ELSE -%] [%- ".staytuned.generic" | ml -%] [%- END -%]
[%- IF features.size > 0 -%] [%- FOREACH feature = features -%]
[%- PROCESS item handler = feature -%] [%- END -%] [%- ELSE -%] [%- '.nofeatures' | ml -%] [%- END -%] [%- BLOCK item handler = "" -%]
[%- dw.form_auth -%]
[%- IF handler.is_active -%]

[%- ".betafeature.${handler.key}.title" | ml -%]

[%- END -%] [%- IF handler.is_active && handler.user_can_add( remote ) -%] [%- SET submit_actions = handler.is_optout ? [ "on", "off" ] : [ "off", "on" ] -%] [%- IF remote.is_in_beta( handler.key ) -%]
[% replace_ljuser_tag( dw.ml( ".betafeature.${handler.key}.on", handler.args_list ) ) -%]
[%- form.submit( name = "off", value = dw.ml( ".betafeature.btn.$submit_actions.0" ), class = "secondary submit" ) -%]
[%- ELSE -%]
[% replace_ljuser_tag( dw.ml( ".betafeature.${handler.key}.off", handler.args_list ) ) -%]
[%- form.submit( name = "on", value = dw.ml( ".betafeature.btn.$submit_actions.1" ) ) -%]
[%- END -%] [%- form.hidden( name = "feature", value = handler.key ) -%] [%- form.hidden( name = "user", value = remote.user ) -%] [%- ELSIF ! handler.user_can_add( remote ) -%] [%- ".betafeature.${handler.key}.cantadd" | ml -%] [%- END -%]
[%- END -%]