def cap_history_rheader(r):
 rheader = None
 if (r.representation == 'html'):
  record = r.record
  if record:
   T = current.T
   db = current.db
   s3db = current.s3db
   if (r.tablename == 'cap_alert_history'):
    alert_id = record.id
    itable = s3db.cap_info_history
    row = db((itable.alert_history_id == alert_id)).select(itable.id, limitby=(0, 1)).first()
    tabs = [(T('Alert Details'), None), (T('Information'), 'info_history'), (T('Area'), 'area_history'), (T('Resource Files'), 'resource_history')]
    rheader_tabs = s3_rheader_tabs(r, tabs)
    rheader = DIV(TABLE(TR(TH(('%s: ' % T('Alert'))), TD(A(s3db.cap_alert_represent(alert_id, record), _href=URL(c='cap', f='alert', args=[alert_id, 'update']))))), rheader_tabs)
 return rheader

def cap_history_rheader ( r ) : rheader = None if ( r . representation == 'html' ) : record = r . record if record : T = current . T db = current . db s3db = current . s3db if ( r . tablename == 'cap_alert_history' ) : alert_id = record . id itable = s3db . cap_info_history row = db ( ( itable . alert_history_id == alert_id ) ) . select ( itable . id , limitby = ( 0 , 1 ) ) . first ( ) tabs = [ ( T ( 'Alert Details' ) , None ) , ( T ( 'Information' ) , 'info_history' ) , ( T ( 'Area' ) , 'area_history' ) , ( T ( 'Resource Files' ) , 'resource_history' ) ] rheader_tabs = s3_rheader_tabs ( r , tabs ) rheader = DIV ( TABLE ( TR ( TH ( ( '%s: ' % T ( 'Alert' ) ) ) , TD ( A ( s3db . cap_alert_represent ( alert_id , record ) , _href = URL ( c = 'cap' , f = 'alert' , args = [ alert_id , 'update' ] ) ) ) ) ) , rheader_tabs ) return rheader
resource header for cap history tables .