%
import time
email_string = ''
email_url = ''
if len(user_email):
email_string = "<" + user_email + ">"
email_url = '?email=' + user_email
# endif
def job_link(uid):
string = ''
if len(email_url):
string = "%s&uid=%d" % (email_url, uid)
else:
string = "?uid=%d" % uid
return string
def despam_user(email):
user, server = email.split('@')
server = server.replace('.', ' ')
return user + ' ' + server
def relative_date_helper(val, desc, text):
if val > 0:
if len(text) > 0:
text = text + ', '
if val == 1:
text = text + '1 %s' % desc
elif val > 1:
text = text + '%d %ss' % (val, desc)
return text
def relative_date(tm):
""" Returns a relative date from a given
seconds since the epoch """
from datetime import datetime, timedelta
curdt = datetime.today()
convdt = datetime.fromtimestamp(tm)
delta = curdt - convdt
# Convert stuff to relative text
ret = relative_date_helper(delta.days, 'day', '')
seconds = delta.seconds
hours = seconds / 3600
seconds = seconds - (hours * 3600)
ret = relative_date_helper(hours, 'hour', ret)
minutes = seconds / 60
seconds = seconds - (minutes * 60)
if seconds >= 30:
minutes = minutes + 1
ret = relative_date_helper(minutes, 'minute', ret)
if len(ret) > 0:
ret = ret + ' ago'
return ret
def relative_date_short_helper(val, desc, text):
if val > 0:
if len(text) > 0:
text = text + ' '
text = text + '%d%s' % (val, desc)
return text
def relative_date_short(tm):
""" Returns a relative date from a given
seconds since the epoch """
from datetime import datetime, timedelta
curdt = datetime.today()
convdt = datetime.fromtimestamp(tm)
delta = curdt - convdt
# Convert stuff to relative text
ret = relative_date_short_helper(delta.days, 'd', '')
seconds = delta.seconds
hours = seconds / 3600
seconds = seconds - (hours * 3600)
ret = relative_date_short_helper(hours, 'h', ret)
if len(ret) <= 0:
minutes = seconds / 60
seconds = seconds - (minutes * 60)
if seconds >= 30:
minutes = minutes + 1
ret = relative_date_short_helper(minutes, 'm', ret)
if len(ret) > 0:
ret = ret + ' ago'
return ret
main_active = ''
if curpage == 'main':
main_active = '-active'
failed_active = ''
if curpage == 'failed':
failed_active = '-active'
success_active = ''
if curpage == 'success':
success_active = '-active'
builders_active = ''
if curpage == 'builders':
builders_active = '-active'
indiv_active = ''
if curpage == 'individual':
indiv_active = '-active'
#endif
%>
<%=config_opts['system_name']%>