Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

Commit da07ffb

Browse files
committed
Add a news block
1 parent 39576e0 commit da07ffb

3 files changed

Lines changed: 94 additions & 1 deletion

File tree

pastebin.css

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,63 @@ pre { display: inline; }
285285

286286
}
287287

288+
/* News Block Styles */
289+
.news-block {
290+
border: 1px solid #3d8ea8;
291+
background-color: #f9f9f9;
292+
margin-bottom: 15px;
293+
padding: 0;
294+
}
295+
296+
.news-header {
297+
background-color: #DF0451;
298+
color: white;
299+
padding: 5px 10px;
300+
cursor: pointer;
301+
display: flex;
302+
justify-content: space-between;
303+
align-items: center;
304+
}
305+
306+
.news-header h3 {
307+
margin: 0;
308+
font-size: 12px;
309+
font-weight: bold;
310+
}
311+
312+
.toggle-icon {
313+
font-size: 10px;
314+
}
315+
316+
.news-content {
317+
padding: 10px;
318+
}
319+
320+
.news-block.collapsed .news-content {
321+
display: none;
322+
}
323+
324+
.news-block.collapsed .toggle-icon {
325+
transform: rotate(-90deg);
326+
}
327+
328+
/* Layout for News Positioning */
329+
.paste-layout-container {
330+
display: flex;
331+
flex-direction: column;
332+
}
333+
334+
.news-section {
335+
order: 1; /* top by default */
336+
}
337+
338+
.form-section {
339+
order: 2;
340+
}
341+
342+
@media (max-width: 600px) {
343+
.news-section {
344+
order: 99; /* move to bottom on mobile */
345+
margin-top: 20px;
346+
}
347+
}

templates/news_block

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<div id="news-block" class="news-block collapsed">
2+
<div class="news-header" onclick="toggleNews()">
3+
<h3>Latest News</h3>
4+
<span class="toggle-icon">▼</span>
5+
</div>
6+
<div class="news-content">
7+
<p><strong>2026-01-05:</strong> Comprehensive Service Overhaul. We have modernized the backend using <strong>Mojolicious</strong> and integrated <strong>Debian/Salsa authentication</strong>. Authenticated users now enjoy relaxed rate limits and spam validation.</p>
8+
<p>To enhance privacy, <strong>public indexing is disabled</strong> (all pastes are hidden by default) and the legacy <strong>XML-RPC API</strong> has been retired. We have also deployed <strong>iocaine</strong> to protect against AI scrapers. Please note that paste retention is now strictly capped at <strong>90 days</strong>.</p>
9+
</div>
10+
</div>
11+
12+
<script>
13+
function toggleNews() {
14+
var block = document.getElementById('news-block');
15+
block.classList.toggle('collapsed');
16+
}
17+
</script>

templates/paste

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,21 @@
44

55
<h1>New paste:</h1>
66

7-
[% IF status %]
7+
<noscript>
8+
<style>
9+
.news-section { order: 99 !important; margin-top: 20px; }
10+
.news-block.collapsed .news-content { display: block !important; } /* force expand */
11+
.toggle-icon { display: none; }
12+
</style>
13+
</noscript>
14+
15+
<div class="paste-layout-container">
16+
<div class="news-section">
17+
[% INCLUDE news_block %]
18+
</div>
19+
20+
<div class="form-section">
21+
[% IF status %]
822
<div class=status>
923
[% status %]
1024
</div>
@@ -46,6 +60,8 @@ Include comments to indicate what you need feedback on.</label><br />
4660
<input type="file" name="upload" /><input type="submit" name="paste" value="Send"/>
4761

4862
</form>
63+
</div>
64+
</div>
4965

5066
[% END %]
5167
[%# vim: syntax=html sw=4 ts=4 noet shiftround

0 commit comments

Comments
 (0)