Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2@file 

3@brief HTML style to display an Email 

4""" 

5 

6template_email_css = """ 

7.dataframe100l { 

8 padding: 0; 

9 width=75% 

10 font-family: Calibri; 

11 font-size: 100%; 

12 cursor: pointer; 

13} 

14 

15.dataframe100l table { 

16 border-collapse: collapse; 

17 text-align: left; 

18 font-size: 11px; 

19} 

20 

21.dataframe100l table td, .dataframe100l table th { 

22 padding: 3px 6px; 

23} 

24 

25.dataframe100l table thead th { 

26 background-color:#AAAAAA; 

27 color:#ffffff; 

28 font-size: 11px; 

29 font-weight: bold; 

30 border-left: 1px solid #0070A8; 

31} 

32 

33.dataframe100l table tbody td { 

34 color: #00496B; 

35 border-left: 1px solid #E1EEF4; 

36 font-size: 11px; 

37 font-weight: normal; 

38} 

39 

40.dataframe100l table tbody .alt td { 

41 background: #E1EEF4; 

42 color: #00496B; 

43 } 

44 

45.dataframe100l_hl td { 

46 background: #FFFF00; 

47 } 

48 

49.dataframe100l_hl th { 

50 background: #FFFF00; 

51 } 

52 

53.dataframe100l_hl tr { 

54 background: #FFFF00; 

55 } 

56 

57.dataframe100l table tbody td:first-child { 

58 border-left: none; 

59} 

60 

61.dataframe100l table tbody tr:last-child td { 

62 border-bottom: none; 

63} 

64 

65.dataframe100l table tfoot td div { 

66 border-top: 1px solid #006699; 

67 background: #E1EEF4; 

68} 

69 

70.dataframe100l table tfoot td { 

71 padding: 0; 

72 font-size: 11px 

73} 

74 

75.dataframe100l table tfoot td div{ padding: 2px; } 

76.dataframe100l table tfoot td ul { 

77 margin: 0; 

78 padding:0; 

79 list-style: none; 

80 text-align: right; 

81} 

82 

83.dataframe100l table tfoot li { display: inline; } 

84.dataframe100l table tfoot li a { 

85 text-decoration: none; 

86 display: inline-block; 

87 padding: 2px 8px; 

88 margin: 1px; 

89 color: #FFFFFF; 

90 border: 1px solid #006699; 

91 border-radius: 3px; 

92 background-color:#006699; 

93} 

94 

95.dataframe100l table tfoot ul.active, .dataframe100l table tfoot ul a:hover { 

96 text-decoration: none; 

97 border-color: #006699; 

98 color: #FFFFFF; 

99 background: none; 

100 background-color:#00557F; 

101} 

102""" 

103 

104template_email_html = """<?xml version="1.0" encoding="utf-8"?> 

105<head> 

106<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

107</head> 

108<body> 

109<html> 

110<head> 

111<title>{{ message.get_field("subject") }}</title> 

112<link rel="stylesheet" type="text/css" href="{{ css }}"> 

113</head> 

114<body> 

115{{ '<a href="{0}">&lt;--</a>'.format(prev_mail) if prev_mail else '' }} 

116{{ '<a href="{0}">--&gt;</a>'.format(next_mail) if next_mail else '' }} 

117<h1>{{ message.get_date().strftime('%Y/%m/%d') }} - {{ message.get_field("subject") }}</h1> 

118<h2>attributes</h2> 

119{{ render.produce_table_html(message, toshow=EmailMessage.subset, location=location, avoid=EmailMessage.avoid, atts=attachments) }} 

120<h2>message</h2> 

121{{ render.process_body_html(location, message.body_html, attachments) }} 

122<h2>full list of attributes</h2> 

123{{ render.produce_table_html(message, toshow=message.Fields, location=location, tohighlight=EmailMessage.subset) }} 

124</body> 

125</html> 

126""" 

127 

128template_email_html_short = """<?xml version="1.0" encoding="utf-8"?> 

129<head> 

130<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

131</head> 

132<body> 

133<html> 

134<head> 

135<title>{{ message.get_field("subject") }}</title> 

136<link rel="stylesheet" type="text/css" href="{{ css }}"> 

137</head> 

138<body> 

139{{ '<a href="{0}">&lt;--</a>'.format(prev_mail) if prev_mail else '' }} 

140{{ '<a href="{0}">--&gt;</a>'.format(next_mail) if next_mail else '' }} 

141<h1>{{ message.get_date().strftime('%Y/%m/%d') }} - {{ message.get_field("subject") }}</h1> 

142{{ render.produce_table_html(message, toshow=EmailMessage.subset, location=location, avoid=EmailMessage.avoid, atts=attachments) }} 

143{{ render.process_body_html(location, message.body_html, attachments) }} 

144</body> 

145</html> 

146""" 

147 

148template_email_list_html_begin = """<?xml version="1.0" encoding="utf-8"?> 

149<head> 

150<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

151</head> 

152<body> 

153<html> 

154<head> 

155<title>{{ title }}</title> 

156<link rel="stylesheet" type="text/css" href="{{ css }}"> 

157</head> 

158<body> 

159<h1>{{ now.strftime('%Y/%m/%d') }} - {{ title }}</h1> 

160<ul> 

161""" 

162 

163template_email_list_html_end = """ 

164</ul> 

165 

166<div id="idallatts"></div> 

167 

168<script> 

169const url = "_summaryattachements.json"; 

170 

171function createNode(element) { 

172 return document.createElement(element); 

173} 

174 

175function append(parent, el) { 

176 return parent.appendChild(el); 

177} 

178 

179fetch(url) 

180 .then((resp) => resp.json()) 

181 .then(function(data) { 

182 // Here you get the data to modify as you please 

183 var div = document.getElementById('idallatts'); 

184 div.innerHTML = '<h2>Additional information</h2><ul id="idallattsul"></ul>'; 

185 var ul = document.getElementById('idallattsul'); 

186 var atts = data; // Get the results 

187 return atts.map(function(att) { // Map through the results and for each run the code below 

188 let li = createNode('li'); 

189 var msg = "" 

190 for (k in att) { 

191 if (k == "a" || k == 'name') continue; 

192 msg += ', <b>' + k + ':</b> ' + att[k]; 

193 } 

194 li.innerHTML = '<a href="' + att["a"] + '">' + att["name"] + '</a>' + msg; 

195 append(ul, li); 

196 }) 

197 }) 

198 .catch(function(error) { 

199 // This is where you run code if the server returns any errors 

200 var div = document.getElementById('idallatts'); 

201 div.innerHTML = "<p>No attachements</p>" + error; 

202 }); 

203</script> 

204 

205</body> 

206</html> 

207""" 

208 

209template_email_list_html_iter = """ 

210<li><a href="{{ url }}">{{ message.get_date().strftime('%Y/%m/%d') }} - 

211 {{ message.get_from_str() }}</a> to {{ message.get_to_str() }} - {{ message.get_field("subject") }}</li> 

212"""