Mercurial Hosting > nabble
view src/nabble/modules/hacks/UserNamespaceExt.java @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
line wrap: on
line source
package nabble.modules.hacks; import nabble.model.User; import nabble.naml.compiler.Command; import nabble.naml.compiler.IPrintWriter; import nabble.naml.compiler.Interpreter; import nabble.naml.compiler.NamespaceExtension; import nabble.view.web.template.UserNamespace; @NamespaceExtension( name = "user_hacks", target = UserNamespace.class ) public final class UserNamespaceExt { private final User user; public UserNamespaceExt(UserNamespace ns) { user = ns.user(); } @Command public void registration_sequence(IPrintWriter out, Interpreter interp) { out.print(user == null? -1 : UserHack.of(user).getRegistrationSequence()); } }