📄 grouppage.tmpl
字号:
## $Id: GroupPage.tmpl 2674 2004-04-28 13:03:41Z mortenv $## Extends the UserAdmin template for common useradmin structure.## Builds html for the edit Group screen of the useradmin module.#### Copyright 2003, 2004 Norwegian University of Science and Technology#### This file is part of Network Administration Visualized (NAV)#### NAV is free software; you can redistribute it and/or modify## it under the terms of the GNU General Public License as published by## the Free Software Foundation; either version 2 of the License, or## (at your option) any later version.#### NAV is distributed in the hope that it will be useful,## but WITHOUT ANY WARRANTY; without even the implied warranty of## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the## GNU General Public License for more details.#### You should have received a copy of the GNU General Public License## along with NAV; if not, write to the Free Software## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA###### Authors: Morten Vold <morten.vold@itea.ntnu.no>###extends UserAdmin#import urllib#def textfield($name, $value, $maxLength=0, $forceEditable=0)#if $editable or $forceEditable <input type="text" name="$name" value="$value" />#else <i>$value</i>#end if#end def#def add_account($account, $add=False) <a href="/useradmin/account?id=$account.id">$account.login</a> - $account.name -#if $add <a href="/useradmin/link?gid=$group.id&uid=$account.id&source=group">ADD</a>#else <a href="/useradmin/unlink?gid=$group.id&uid=$account.id&source=group">REMOVE</a> #end if <br>#end def#def add_privilege($privilege) <b>$privilege.privilegename</b> for <code>$privilege.target</code> (<a href="revoke?gid=$group.id&pid=$privilege.privilegeid&target=$urllib.quote($privilege.target)">Revoke</a>) <br>#end def## ## useradmin is the content block for all useradmin pages## it begins here###block useradmin<form method="POST" action="groupsubmit">#if not $newGroup <input type="hidden" name="id" value="$group.id">#end if <b>Name:</b> $textfield('name', $group.name)<br> <b>Description:</b> $textfield('description', $group.description)<br> <input type="submit" value="Submit changes" /></form>#if not $newGroup<p><a href="groupdel?id=$group.id">DELETE</a> this group</p><h3>Privileges</h3><p><font size=-1>(See <ahref="http://www.amk.ca/python/howto/regex/">http://www.amk.ca/python/howto/regex/</a>for a HOWTO on the Regular expressions used for matching targets for privilegeslike 'web_access'.)</font></p>#for $privilege in $group.privileges$add_privilege($privilege)#end for <h4>Grant privileges:</h4> <form name="privileges" action="grant"> <p> <input type="hidden" name="gid" value="$group.id" /> <select name="pid" size="1">#for $privilege in $privileges <option value="$privilege.id">$privilege.name</option>#end for </select> <b>Target:</b><input type="text" name="target" value="" size="60" /><br> <input type="submit" value="Grant" /> </p> </form><h3>Member list</h3>#for $account in $group.members$add_account($account, False)#end for<h3>Non-member list</h3>#for $account in $group.nonmembers$add_account($account, True)#end for#end if#end block useradmin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -