fix layout news, especially post

workspace
Brendan Howell 7 years ago
parent 6ec91abd1b
commit 240c9507c6

@ -91,7 +91,7 @@ class MailRoom(Bureau):
"""
internaldate = resp_obj[b'INTERNALDATE']
msg_data = resp_obj[b'RFC822'].decode('utf-8')
msg_data = resp_obj[imap_id][b'RFC822'].decode('utf-8')
msg_obj = email.message_from_string(msg_data)
# format and tidy header data
@ -168,25 +168,28 @@ class MailRoom(Bureau):
resp = self.imapserv.fetch([imap_id],
['INTERNALDATE', 'RFC822'])
print("got imap msg:", imap_id, resp)
msg = self._make_msg_object(imap_id, resp)
# TODO: switch this to inline svgs
# make action barcodes
barcode_png = os.path.join("/tmp", "POun." + msg.shortcode + ".png")
barcode_png = os.path.join("/tmp", "POun." + shortcode + ".png")
code128.image("POun." + shortcode).save(barcode_png)
msg.un_bc = str(barcode_png)
barcode_png = os.path.join("/tmp", "POd." + msg.shortcode + ".png")
barcode_png = os.path.join("/tmp", "POd." + shortcode + ".png")
code128.image("POd." + shortcode).save(barcode_png)
msg.d_bc = str(barcode_png)
barcode_png = os.path.join("/tmp", "POsp." + msg.shortcode + ".png")
barcode_png = os.path.join("/tmp", "POsp." + shortcode + ".png")
code128.image("POsp." + shortcode).save(barcode_png)
msg.sp_bc = str(barcode_png)
barcode_png = os.path.join("/tmp", "POre." + msg.shortcode + ".png")
barcode_png = os.path.join("/tmp", "POre." + shortcode + ".png")
code128.image("POre." + shortcode).save(barcode_png)
msg.re_bc = str(barcode_png)
barcode_png = os.path.join("/tmp", "POrea." + msg.shortcode + ".png")
barcode_png = os.path.join("/tmp", "POrea." + shortcode + ".png")
code128.image("POrea." + shortcode).save(barcode_png)
msg.rea_bc = str(barcode_png)
barcode_png = os.path.join("/tmp", "POr." + msg.shortcode + ".png")
barcode_png = os.path.join("/tmp", "POr." + shortcode + ".png")
code128.image("POr." + shortcode).save(barcode_png)
msg.r_bc = str(barcode_png)

@ -9,11 +9,11 @@
}
}
html {
font-size: 120%;
font-size: 100%;
}
body {
font-family: "CMU Serif";
font-size: 24pt;
font-size: 12px;
line-height: 1;
}
h1 {
@ -36,7 +36,7 @@
font-family: "Fold";
font-weight: 400;
text-transform: uppercase;
font-size: 50mm;
font-size: 5em;
text-align: center;
margin: 0;
}
@ -46,7 +46,6 @@
padding: 5px;
clear: both;
font-variant: small-caps;
font-size: 24pt;
}
#motto {
float: left;
@ -78,14 +77,45 @@
margin-top: 0.25em;
}
.entry .barcode svg {
width: 130%;
margin-left: -15%;
border: 1px solid black;
width: 100%;
height: auto;
/*width: 130%;
margin-left: -15%;*/
}
.entry .summary{
text-align: justify;
hyphens: auto;
}
.mail {
clear: both;
}
.mail div {
float: left;
}
.mail .mailsender {
width: 25%;
word-break: break-all;
}
.mail .mailsubject {
width: 50%;
}
.mail .maildate {
width: 25%;
}
.mail div.mailact {
width: 25%;
float: right;
}
.mail div.actname {
font-variant: small-caps;
}
.mail div.mailact svg {
width: 100%;
height: auto;
}
.mail .mailrow {
clear: both;
}
</style>
<body>
<h1 id="masthead">Yesterday's Tomorrows</h1>
@ -107,19 +137,26 @@
</div>
% endfor
</div>
% if len(inbox) > 0:
<div id="email">
<h2>Post</h2>
<table>
% for msg in inbox:
<tr>
<td>${msg["fromname"]} ${msg["fromaddr"]}</td>
<td>${msg["subject"]}</td><td>${msg["date"]}</td>
</tr>
<tr><td> </td><td>READ</td><td>DELETE</td><td>MARK AS SPAM</td></tr>
<tr><td> </td><td>${msg["r_bc"]}</td><td>${msg["d_bc"]}</td><td>${msg["sp_bc"]}</td></tr>
<div class="mail">
<div class="mailrow">
<div class="mailsender">${msg["fromname"]} ${msg["fromaddr"]}</div>
<div class="mailsubject">${msg["subject"]}</div><div class="maildate">${msg["date"]}</div>
</div>
<div class="mailrow">
<div class="mailact">read</div><div class="mailact">delete</div><div class="mailact">mark as spam</div>
</div>
<div class="mailrow">
<div class="mailact">${msg["r_bc"]}</div><div class="mailact">${msg["d_bc"]}</div><div class="mailact">${msg["sp_bc"]}</div>
</div>
</div>
% endfor
</table>
</div>
% endif
</body>
</html>

Loading…
Cancel
Save