Complete ircquotes application with all features
- Added copy quote functionality with clipboard integration - Implemented bulk moderation actions for admin - Created mobile responsive design with bash.org styling - Added API rate limiting per IP address - Implemented dark mode toggle with flash prevention - Enhanced error messages throughout application - Fixed all security vulnerabilities (SQL injection, XSS, CSRF) - Added comprehensive rate limiting on all endpoints - Implemented secure session configuration - Added input validation and length limits - Created centralized configuration system with config.json - Set up production deployment with Gunicorn - Added security headers and production hardening - Added password generation and config management tools
This commit is contained in:
@@ -6,6 +6,18 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>ircquotes: Random Quote</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}" />
|
||||
<script>
|
||||
// Prevent flash of white content by applying theme immediately
|
||||
(function() {
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
if (savedTheme === 'dark' || (!savedTheme && prefersDark)) {
|
||||
document.documentElement.className = 'dark-theme';
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='voting.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='theme.js') }}"></script>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#ffffff" text="#000000" link="#c08000" vlink="#c08000" alink="#c08000">
|
||||
@@ -30,8 +42,9 @@
|
||||
<a href="/submit">Submit</a> /
|
||||
<a href="/browse">Browse</a> /
|
||||
<a href="/modapp">ModApp</a> /
|
||||
<a href="/search">Search</a>
|
||||
<a href="/search">Search</a> /
|
||||
<a href="/faq">FAQ</a>
|
||||
<button id="theme-toggle" onclick="toggleDarkMode()" title="Toggle dark/light mode">🌙</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -43,12 +56,16 @@
|
||||
<td valign="top">
|
||||
<p class="quote">
|
||||
<a href="/quote?id={{ quote.id }}" title="Permanent link to this quote."><b>#{{ quote.id }}</b></a>
|
||||
<a href="/vote/{{ quote.id }}/upvote" class="qa">+</a>
|
||||
(<font color="green">{{ quote.votes }}</font>)
|
||||
<a href="/vote/{{ quote.id }}/downvote" class="qa">-</a>
|
||||
<a href="/flag/{{ quote.id }}" class="qa">[X]</a>
|
||||
|
||||
<a href="#" onclick="return vote({{ quote.id }}, 'upvote', this)" class="qa" id="up-{{ quote.id }}">+</a>
|
||||
<span id="votes-{{ quote.id }}"><font color="green">{{ quote.votes }}</font></span>
|
||||
<a href="#" onclick="return vote({{ quote.id }}, 'downvote', this)" class="qa" id="down-{{ quote.id }}">-</a>
|
||||
|
||||
<a href="#" onclick="return flag({{ quote.id }}, this)" class="qa">X</a>
|
||||
|
||||
<a href="#" onclick="return copyQuote({{ quote.id }}, this)" class="qa" title="Copy quote to clipboard">C</a>
|
||||
</p>
|
||||
<p class="qt">{{ quote.text }}</p>
|
||||
<p class="qt">{{ quote.text|e }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -77,6 +94,7 @@
|
||||
© ircquotes 2024, All Rights Reserved.
|
||||
</font>
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user