{{extend 'layout.html'}} {{import os, stat, time}} {{block sectionclass}}errors{{end}} {{if db_ready['status'] == False: switchbutton = A(SPAN(T("switch to : db")), _href=db_ready['errlink'], _class="button unavailable btn btn-danger", _title="%s" % (db_ready['errmessage'])) else: switchbutton = A(SPAN(T("switch to : db")), _href=URL(args=[app, 'dbnew']), _class="button btn") pass}}

{{=T('Error logs for "%(app)s"',dict(app=app))}}

{{ if 'new' in method: }} {{base_url = 'db' in method and 'ticketdb' or 'ticket' }}

{{if 'db' in method:}} {{=T('source : db')}} {{=T('switch to : filesystem')}} {{=T('lists by ticket')}} {{else:}} {{=T('source : filesystem')}} {{=switchbutton}} {{=T('lists by ticket')}} {{pass}}

{{=T('Click row to expand traceback')}}
{{for e in errors:}} {{pass}}
{{=T("Count")}} {{=T("File")}} {{=T("Error")}}
{{=e['count']}} {{=e['causer']}} {{=A(e['last_line'],_href="#",_onclick="collapse('%s');return false;"%e['hash'])}} + {{=A(T('details'),_href=URL(base_url,args=[app,e['ticket']]))}}
{{=CODE(e['pickel']['traceback'])}}
{{ else: }}

{{if 'db' in method:}} {{=T('source : db')}} {{=T('switch to : filesystem')}} {{=T('lists by exception')}} {{else:}} {{=T('source : filesystem')}} {{=switchbutton}} {{=T('lists by exception')}} {{pass}}

{{=T('Click row to expand traceback')}}
{{for ticket in tickets:}} {{if 'db' in method:}} {{else:}} {{pass}} {{pass}}
{{=T("Ticket")}} {{=T("Date and Time")}}
{{=ticket}} {{=time.strftime('%Y-%m-%d %H:%M:%S',times[ticket].timetuple())}}{{=ticket}} {{=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(os.stat(os.path.join(request.folder,'../%s/errors/%s' % (app,ticket)))[stat.ST_CTIME]))}}
{{ pass }}