📄 frontpagetemplate.tmpl
字号:
#encoding UTF-8## $Id: FrontpageTemplate.tmpl 3809 2007-01-19 14:16:23Z jodal $#### 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: Magnar Sveen <magnars@stud.ntnu.no>## Stein Magnus Jodal <stein.magnus.jodal@uninett.no>###extends MainTemplate#attr boxesdown = False#attr numberOfBoxesShown = 10#attr numberOfMessagesShown = 5#from nav.web import shouldShow#block additionalCSS<link rel="stylesheet" type="text/css" href="/style/FrontpageTemplate.css" />$default_table_CSS#end block#block content<table border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" width="190">$navlinksbox <br />$externallinksbox <br />$contactinformationbox <br /> </td> <td style="width: 10px;"></td> <td valign="top">$welcome$messages$status </td> </tr></table>#end block#def navlinksbox $sideboxstart('NAV links') $navlinks $sideboxend() #end def#def navlinks#end def#def externallinksbox $sideboxstart('External links') $externallinks $sideboxend()#end def#def externallinks#end def#def contactinformationbox $sideboxstart('Contact information') $contactinformation $sideboxend()#end def#def contactinformation#end def#def welcome#end def#def sideboxstart($title) <table border="0" cellspacing="0" cellpadding="3" width="100%" class="sidebox"> <tr> <td class="sideboxtitle"> $title </td> </tr> <tr> <td class="sideboxlinks">#end def#def sideboxend </td> </tr> </table>#end def#def messages#set $msgs = $getVar('msgs', False)#if $msgs #set $msgcount = len($msgs) #set $rowcount = $msgcount + 1<table class="horiztable"> <caption> <span class="cornerkludge"></span> <a href="/messages/">Messages</a><br /> #if $msgcount == 1 <span class="subtitle">$msgcount active message</span> #else <span class="subtitle">$msgcount active messages</span> #end if </caption> <tr class="header"> <td class="leftkludge" rowspan="$rowcount"></td> <th>Published</th> <th>Title</th> <th style="white-space: normal;">Description</th> <th>Tasks</th> <td class="rightkludge" rowspan="$rowcount"></td> </tr> #for $msg in $msgs #if len($msg.description) > 80 #set $desc = $msg.description[:80] + '...' #else #set $desc = $msg.description #end if #if $msg.tasks #set $tasks = len($msg.tasks) #else #set $tasks = 0 #end if <tr class="$rowcycler"> <td>$msg.publish_start.strftime('%Y-%m-%d %H:%M')</td> <td><a href="/messages/view?id=$msg.messageid">$msg.title.replace('<', '<').replace('>', '>')</a></td> <td>$desc.replace('<', '<').replace('>', '>')</td> #if $tasks <td><a href="/messages/view?id=$msg.messageid"> <img src="/images/wrench.gif" width="10" height="10" alt="Tasks"> $tasks</a></td> #else <td> </td> #end if </tr> #end for</table><br />#end if#end def#def status#set $rowcount = len($boxesdown) + 1<table class="horiztable"> <caption> <span class="cornerkludge"></span> <a href="/status/">Status Now</a><br /> <span class="subtitle">$numboxesdown boxes down, $numboxesshadow in shadow</span> </caption> <tr class="header"> <td class="leftkludge" rowspan="$rowcount"></td> <th>Sysname</th> <th>IP</th> <th>Down since</th> <th>Downtime</th> <td class="rightkludge" rowspan="$rowcount"></td> </tr>#set $numberdown = 0#for $box in $boxesdown#if not $box[4] #if $numberdown < $numberOfBoxesShown <tr class="$rowcycler"> #if shouldShow("/browse/$box[1]", $user) <td><a href="/browse/$box[1]">$box[1]</a></td> #else <td>$box[1]</td> #end if <td>$box[2]</td> #set $since = $box[3].strftime('%Y-%m-%d %H:%M') <td>$since</td> <td style="text-align: right;"><span title="$box[0]">$box[5]</span></td> </tr> #end if #set $numberdown = $numberdown + 1#end if#end for#if len($boxesdown) > $numberOfBoxesShown #set $linktext = "(more)"#else #set $linktext = "(to status page)"#end if <tr> <td colspan="6" style="text-align: center; font-size: smaller;"> <a href="/status/">$linktext</a> </td> </tr></table><br />#end def
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -