@@ -14,7 +14,11 @@ sub MAIN (Str:D :$host = 'localhost', UInt:D :$port = 10000) {
14
14
get -> ' alert' , Int $ id {
15
15
content ' text/html' , html-render-alerts $ Alerts . get : $ id
16
16
}
17
- get -> ' main.css' { static ' static/main.css' }# $CSS }
17
+ get -> ' main.css' { static ' static/main.css' }
18
+ get -> ' rss.svg' { static ' static/rss.svg' }
19
+ get -> ' api.svg' { static ' static/api.svg' }
20
+ get -> ' twitter.svg' { static ' static/twitter.svg' }
21
+ get -> ' camelia.svg' { static ' static/camelia.svg' }
18
22
}
19
23
20
24
with Cro::HTTP::Server. new : : $ host , : $ port , : $ application {
@@ -32,11 +36,19 @@ sub html-render-alerts(*@alerts) {
32
36
~ @ alerts . map (-> $ a {
33
37
q :to /✎✎✎✎✎ /;
34
38
<li class="alert alert-\qq[$a.severity()]">
35
- <p class="info"><a href="/alert/\qq[$a.id()]">#\qq[$a.id()]</a>
36
- | \qq[$a.time-human()]
37
- | posted by \qq[$a.creator()]
38
- | severity: \qq[$a.severity()]
39
- \qq[{"| affects: $a.affects()" if $a.affects}]
39
+ <h2 class="info"><a href="/alert/\qq[$a.id()]">#\qq[$a.id()]</a>
40
+ <span class="sep">|</span>
41
+ <span class="time">\qq[$a.time-human()]</span>
42
+ <span class="sep">|</span>
43
+ severity: <span class="severity">\qq[$a.severity()]</span>
44
+ \qq[{
45
+ '<span class="sep">|</span>
46
+ affects: <span class="affects">\qq[$a.affects()]</span>'
47
+ if $a.affects
48
+ }]
49
+ <span class="sep">|</span>
50
+ posted by <span class="creator">\qq[$a.creator()]</span>
51
+ </h2>
40
52
41
53
<p>\qq[$a.alert()]</p>
42
54
</li>
@@ -57,14 +69,23 @@ sub html-layout-default (Str:D $content) {
57
69
<link rel="stylesheet" href="/main.css">
58
70
</head>
59
71
<body>
60
- <h1>Perl 6 Alerts</h1>
61
72
<div id="content">
73
+ <h1>
74
+ <a href="https://perl6.org/"><img src="/camelia.svg" alt="»ö«"
75
+ width=25 height=25></a>
76
+ <a href="/">Perl 6 Alerts</a>
77
+ <a href="/rss"><img src="/rss.svg" alt="RSS" width=25 height=25></a>
78
+ <a href="https://twitter.com/p6lert"
79
+ ><img src="/twitter.svg" alt="Twitter" width=25 height=25></a>
80
+ <a href="/api"
81
+ ><img src="/api.svg" alt="API" width=25 height=25></a
82
+ ><small>keeping up to date with important changes</small></h1>
62
83
\qq[$content]
84
+ <footer>
85
+ <small>Code for this website is available at
86
+ <a href="https://github.com/perl6/alerts">github.com/perl6/alerts</a>
87
+ </footer>
63
88
</div>
64
- <footer>
65
- <small>Code for this website is available at
66
- <a href="https://github.com/perl6/alerts">github.com/perl6/alerts</a>
67
- </footer>
68
89
</body>
69
90
</html>
70
91
✎✎✎✎✎
0 commit comments