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'] 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) msg_obj = email.message_from_string(msg_data)
# format and tidy header data # format and tidy header data
@ -168,25 +168,28 @@ class MailRoom(Bureau):
resp = self.imapserv.fetch([imap_id], resp = self.imapserv.fetch([imap_id],
['INTERNALDATE', 'RFC822']) ['INTERNALDATE', 'RFC822'])
print("got imap msg:", imap_id, resp)
msg = self._make_msg_object(imap_id, resp) msg = self._make_msg_object(imap_id, resp)
# TODO: switch this to inline svgs
# make action barcodes # 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) code128.image("POun." + shortcode).save(barcode_png)
msg.un_bc = str(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) code128.image("POd." + shortcode).save(barcode_png)
msg.d_bc = str(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) code128.image("POsp." + shortcode).save(barcode_png)
msg.sp_bc = str(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) code128.image("POre." + shortcode).save(barcode_png)
msg.re_bc = str(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) code128.image("POrea." + shortcode).save(barcode_png)
msg.rea_bc = str(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) code128.image("POr." + shortcode).save(barcode_png)
msg.r_bc = str(barcode_png) msg.r_bc = str(barcode_png)

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

Loading…
Cancel
Save