⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maintenancenewtemplate.tmpl

📁 Network Administration Visualized 网络管理可视化源码
💻 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 MaintenanceTemplate#import math#import time#from nav.web.templates.TreeSelectTemplate import TreeSelectTemplate#block tabcontent## Print form<form action="" method="post" id="newform">#set $edit_taskid = $getVar('edit_taskid', False)#if $edit_taskid<input type="hidden" name="edit_taskid" value="$edit_taskid" />#end if<table class="vertitable">    <tr>        <th>Add components</th>        <td>            #set ts = TreeSelectTemplate()            $ts.treeselect($selectbox)            #if $selectsubmit.enabled            <input type="submit" name="$selectsubmit.control" value="$selectsubmit.value" />            #else            <input disabled="disabled" type="submit" name="$selectsubmit.control" value="$selectsubmit.value" />            #end if        </td>    </tr>    <tr>        <th>Selected components *</th>        <td>            $listComponents($components, True)        </td>    </tr>    <tr>        <th>Start maintenance</th>        <td>            <select name="start_year">#set $current_year = int(time.strftime('%Y'))#set $selected_year = $getVar('start_year', $current_year)#for $year in xrange($current_year - 1, $current_year + 5)    #if $year == $selected_year                <option value="$year" selected="selected">$year</option>    #else                <option value="$year">$year</option>    #end if#end for            </select>            <select name="start_month">#set $current_month = int(time.strftime('%m'))#set $selected_month = $getVar('start_month', $current_month)#for $month in xrange(1, 1 + 12)    #if $month == $selected_month                <option value="$month" selected="selected">$month</option>    #else                <option value="$month">$month</option>    #end if#end for            </select>            <select name="start_day">#set $current_day = int(time.strftime('%d'))#set $selected_day =$getVar('start_day', $current_day)#for $day in xrange(1, 1 + 31)    #if $day == $selected_day                <option value="$day" selected="selected">$day</option>    #else                <option value="$day">$day</option>     #end if#end for            </select>            at            <select name="start_hour">#set $current_hour = int(time.strftime('%H'))#set $selected_hour = $getVar('start_hour', $current_hour)#for $hour in xrange(0, 24)    #if $hour == $selected_hour                <option value="$hour" selected="selected">$hour</option>    #else                <option value="$hour">$hour</option>    #end if#end for            </select>            <select name="start_min">#set $current_min = int(math.floor(int(time.strftime('%M')) / 5) * 5)#set $selected_min = $getVar('start_min', $current_min)#set $selected_min = int(math.floor($selected_min / 5) * 5)#for $min in xrange(0, 60, 5)    #if $min == $selected_min                <option value="$min" selected="selected">$min</option>    #else                <option value="$min">$min</option>    #end if#end for            </select>                </td>    </tr>## Default to one week into the future#set $totime = time.localtime(int(time.time()) + 7*24*60*60)    <tr>        <th>End maintenance</th>        <td>            <select name="end_year">#set $current_year = int(time.strftime('%Y', $totime))#set $selected_year = $getVar('end_year', $current_year)#for $year in xrange($current_year - 1, $current_year + 5)    #if $year == $selected_year                <option value="$year" selected="selected">$year</option>    #else                <option value="$year">$year</option>    #end if#end for            </select>            <select name="end_month">#set $current_month = int(time.strftime('%m', $totime))#set $selected_month = $getVar('end_month', $current_month)#for $month in xrange(1, 1 + 12)    #if $month == $selected_month                <option value="$month" selected="selected">$month</option>    #else                <option value="$month">$month</option>    #end if#end for            </select>            <select name="end_day">#set $current_day = int(time.strftime('%d', $totime))#set $selected_day = $getVar('end_day', $current_day)#for $day in xrange(1, 1 + 31)    #if $day == $selected_day                <option value="$day" selected="selected">$day</option>    #else                <option value="$day">$day</option>    #end if#end for            </select>            at            <select name="end_hour">#set $current_hour = int(time.strftime('%H', $totime))#set $selected_hour = $getVar('end_hour', $current_hour)#for $hour in xrange(0, 24)    #if $hour == $selected_hour                <option value="$hour" selected="selected">$hour</option>    #else                <option value="$hour">$hour</option>    #end if#end for            </select>            <select name="end_min">#set $current_min = int(math.floor(int(time.strftime('%M', $totime)) / 5) * 5)#set $selected_min = $getVar('end_min', $current_min)#set $selected_min = int(math.floor($selected_min / 5) * 5)#for $min in xrange(0, 60, 5)    #if $min == $selected_min                <option value="$min" selected="selected">$min</option>    #else                <option value="$min">$min</option>    #end if#end for            </select>            (default: one week)        </td>    </tr>    <tr>        <th>Description *</th>        <td><textarea name="description" cols="72" rows="5">$getVar('description', '')</textarea></td>    </tr>    <tr>        <th></th>        <td><input type="submit" name="submit_final" value="$submittext" /></td>    </tr></table></form>#end block tabcontent

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -