-- vim:set ft=lua: dofile(mg.script_name:gsub('[^\\/]*$','')..'util.lua') ct={title='予約一覧'} if (not SIDE_PANEL) then ct.css='\n' ct.js='\n' end focus=nil post=AssertPost() if post then focus=edcb.GetReserveData(GetVarInt(post,'del') or 0) if focus then edcb.DelReserveData(focus.reserveID) ct.js=ct.js..'' end end edcb.htmlEscape=15 a=edcb.GetReserveData() if not focus then focus=GetVarInt(mg.request_info.query_string,'id') focus=focus and BinarySearch(a,{reserveID=focus},CompareFields('reserveID')) end table.sort(a, function(a,b) return os.time(a.startTime) < os.time(b.startTime) end) pageCount=tonumber(edcb.GetPrivateProfile('SET','PAGE_COUNT','30',INI)) if pageCount==0 then pageCount=#a end if focus then --focusの行を含むページを探す focusIndex=BinarySearchBound(a,focus,function(a,b) return os.time(a.startTime)' ..'\n ' ..'\n '..FormatTimeAndDuration(v.startTime, v.durationSecond) ..'\n '..ConvertTitle(v.title) ..'\n '..v.stationName ..'\n '..v.comment ..'\n '..(size and ('%.1fGB'):format(size/1024/1024/1024) or '-') ..'\n grade'..v.recSetting.priority ..'\n') end pageNav=Pagination(page, a) ct.main='
\n' ..SidePanelTemplate(true) ..'
'..pageNav..'
' ..'\n' ..'\n' ..'\n\n' ..' \n' ..table.concat(ctt) ..'
'..#a..' 件中 '..math.min(#a,page*pageCount+1)..' - '..math.min(#a,(page+1)*pageCount)..' 件
録画\n' ..' 日付\n' ..' 番組名\n' ..' サービス\n' ..' コメント\n' ..' 予想サイズ\n' ..' 優先度\n' ..'
\n
\n'..ThumbContainerTemplate()..pageNav..'
\n' ..'' ct=Template(ct) mg.write(ct:Pop(Response(200,'text/html','utf-8',ct.len,ct.gzip)..'\r\n'))