📄 mysmstemplate.tmpl
字号:
#encoding UTF-8## $Id$#### Copyright 2006 UNINETT AS#### 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###### Author: Stein Magnus Jodal <stein.magnus.jodal@uninett.no>###extends MainTemplate#import datetime#attr $title = 'My SMS'#attr $path = [("Home", "/"), ("AlertProfiles", "/alertprofiles/"), ("My SMS","")]#def add_message($message) <tr class="$rowcycler"> <td>$message['time'].strftime('%Y-%m-%d %H:%M:%S')</td> #if $message['timesent']: <td>$message['timesent'].strftime('%Y-%m-%d %H:%M:%S')</td> #else <td></td> #end if <td>$message['phone']</td> <td>$message['msg']</td> <td>$message['severity']</td> #if $message['sent'] == 'Y': <td style="color: green">Sent</td> #else if $message['sent'] == 'N': <td style="color: red">Not sent</td> #else if $message['sent'] == 'I': <td style="color: gray">Ignored</td> #end if </tr>#end def#block content<h2>My SMS</h2><form id="searchform" action="" method="get"><p>Show messages from the last<input type="text" name="days" size="3" value="$days" />days for the phone numbers: $phones.<button type="submit">Search</button></p></form>#set $msgcount = len($messages)<table class="listtable"> <caption> Message list<br /> <span class="subtitle">$msgcount messages</span> </caption>#if $msgcount <thead> <tr> <th>Time</th> <th>Time Sent</th> <th>Phone No.</th> <th>Message</th> <th>Severity</th> <th>Status</th> </tr> </thead> <tbody>#for $message in $messages $add_message($message)#end for </tbody>#end if <tbody class="footer"> <tr> <th colspan="0">$msgcount messages</th> </tr> </tbody></table>#end block content#block additionalCSS$default_table_CSS#end block additionalCSS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -