Implement MVP: Anonymous feedback submission (User Story 1)
Complete implementation of Phase 1-3 (64 tasks): - Phase 1: Project setup with Flask, pytest, configuration - Phase 2: Core infrastructure (auth, models, services, testing) - Phase 3: Anonymous feedback submission with file uploads Features: - Anonymous feedback submission (text and/or up to 3 file attachments) - Multi-language support (any language accepted) - File validation (type, size) and virus scanning (ClamAV) - Product management with active/archived status - File-based storage with YAML metadata - User authentication system (Flask-Login) - CSRF protection and rate limiting - Test coverage: 10 passing tests (contract + integration) Security: - No IP address logging (FR-055 compliance) - File type whitelist and size limits (10MB max) - Virus scanning with graceful degradation - Filename sanitization and secure storage Test Results: - 8 contract tests passed - 2 integration tests passed - End-to-end workflow verified 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Login - Reklamator{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Login</h1>
|
||||
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label for="username">Username</label>
|
||||
<input type="text" id="username" name="username" required autofocus>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input type="password" id="password" name="password" required>
|
||||
</div>
|
||||
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
|
||||
<p style="margin-top: 20px;">
|
||||
<a href="{{ url_for('submission.form') }}">Return to feedback submission</a>
|
||||
</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,217 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Reklamator - Anonymous Feedback{% endblock %}</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #333;
|
||||
background-color: #f5f5f5;
|
||||
padding: 20px;
|
||||
}
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
}
|
||||
h1, h2, h3 {
|
||||
margin-bottom: 20px;
|
||||
color: #2c3e50;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
border-bottom: 3px solid #3498db;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.flash-messages {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.flash {
|
||||
padding: 12px 20px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 4px;
|
||||
border-left: 4px solid;
|
||||
}
|
||||
.flash.success {
|
||||
background-color: #d4edda;
|
||||
border-color: #28a745;
|
||||
color: #155724;
|
||||
}
|
||||
.flash.error {
|
||||
background-color: #f8d7da;
|
||||
border-color: #dc3545;
|
||||
color: #721c24;
|
||||
}
|
||||
.flash.info {
|
||||
background-color: #d1ecf1;
|
||||
border-color: #17a2b8;
|
||||
color: #0c5460;
|
||||
}
|
||||
.flash.warning {
|
||||
background-color: #fff3cd;
|
||||
border-color: #ffc107;
|
||||
color: #856404;
|
||||
}
|
||||
form {
|
||||
margin: 20px 0;
|
||||
}
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
label {
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
input[type="text"],
|
||||
input[type="email"],
|
||||
input[type="password"],
|
||||
textarea,
|
||||
select {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
font-size: 1em;
|
||||
font-family: inherit;
|
||||
}
|
||||
textarea {
|
||||
min-height: 150px;
|
||||
resize: vertical;
|
||||
}
|
||||
button,
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 10px 20px;
|
||||
background-color: #3498db;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 1em;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
button:hover,
|
||||
.btn:hover {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
button.secondary,
|
||||
.btn.secondary {
|
||||
background-color: #95a5a6;
|
||||
}
|
||||
button.secondary:hover,
|
||||
.btn.secondary:hover {
|
||||
background-color: #7f8c8d;
|
||||
}
|
||||
button.danger,
|
||||
.btn.danger {
|
||||
background-color: #e74c3c;
|
||||
}
|
||||
button.danger:hover,
|
||||
.btn.danger:hover {
|
||||
background-color: #c0392b;
|
||||
}
|
||||
.nav {
|
||||
margin-bottom: 30px;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.nav a {
|
||||
margin-right: 20px;
|
||||
color: #3498db;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
}
|
||||
.nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.error-text {
|
||||
color: #e74c3c;
|
||||
font-size: 0.9em;
|
||||
margin-top: 5px;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 20px 0;
|
||||
}
|
||||
th, td {
|
||||
padding: 12px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
th {
|
||||
background-color: #f8f9fa;
|
||||
font-weight: 600;
|
||||
color: #555;
|
||||
}
|
||||
tr:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 4px 8px;
|
||||
border-radius: 3px;
|
||||
font-size: 0.85em;
|
||||
font-weight: 600;
|
||||
}
|
||||
.badge.new {
|
||||
background-color: #3498db;
|
||||
color: white;
|
||||
}
|
||||
.badge.analyzed {
|
||||
background-color: #2ecc71;
|
||||
color: white;
|
||||
}
|
||||
.badge.archived {
|
||||
background-color: #95a5a6;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{% if current_user and current_user.is_authenticated %}
|
||||
<div class="nav">
|
||||
{% if current_user.role == 'product_owner' %}
|
||||
<a href="{{ url_for('dashboard.list') }}">Dashboard</a>
|
||||
<a href="{{ url_for('dashboard.products') }}">Products</a>
|
||||
{% elif current_user.role == 'administrator' %}
|
||||
<a href="{{ url_for('admin.dashboard') }}">Admin Dashboard</a>
|
||||
<a href="{{ url_for('admin.users') }}">Users</a>
|
||||
<a href="{{ url_for('admin.products') }}">Products</a>
|
||||
{% endif %}
|
||||
<a href="{{ url_for('auth.logout') }}" style="float: right;">Logout ({{ current_user.username }})</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<div class="flash-messages">
|
||||
{% for category, message in messages %}
|
||||
<div class="flash {{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Welcome - Reklamator{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div style="text-align: center; padding: 60px 20px;">
|
||||
<h1 style="font-size: 2.5em; margin-bottom: 20px;">Reklamator</h1>
|
||||
<p style="font-size: 1.3em; color: #666; margin-bottom: 40px;">
|
||||
Anonymous Feedback Platform
|
||||
</p>
|
||||
|
||||
<div style="max-width: 600px; margin: 0 auto; text-align: left;">
|
||||
<h2>Submit Feedback</h2>
|
||||
<p>If you have a product-specific submission link, use it to submit your feedback anonymously.</p>
|
||||
|
||||
<h2 style="margin-top: 40px;">Product Owners & Administrators</h2>
|
||||
<p>
|
||||
<a href="{{ url_for('auth.login') }}" class="btn">Login to Dashboard</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Error - {{ product.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div style="text-align: center; padding: 40px 20px;">
|
||||
<div style="font-size: 4em; color: #e74c3c; margin-bottom: 20px;">✗</div>
|
||||
|
||||
<h1>Oops! Something went wrong</h1>
|
||||
|
||||
<p style="font-size: 1.1em; margin: 20px 0; color: #555;">
|
||||
{{ error_message }}
|
||||
</p>
|
||||
|
||||
<div style="margin-top: 40px;">
|
||||
<a href="{{ url_for('submission.form', product_slug=product.submission_url_slug) }}" class="btn">
|
||||
Try Again
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,42 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Submit Feedback - {{ product.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Submit Feedback</h1>
|
||||
<h2>{{ product.name }}</h2>
|
||||
|
||||
<p>We value your feedback. Please share your thoughts, report issues, or suggest improvements below.</p>
|
||||
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="feedback_text">Your Feedback</label>
|
||||
<textarea id="feedback_text" name="feedback_text"
|
||||
placeholder="Describe your feedback in any language..."></textarea>
|
||||
<p style="font-size: 0.9em; color: #666; margin-top: 5px;">
|
||||
You can write in any language. Optional if you attach files.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="files">Attachments (Optional)</label>
|
||||
<input type="file" id="files" name="files" multiple>
|
||||
<p style="font-size: 0.9em; color: #666; margin-top: 5px;">
|
||||
You can attach up to 3 files (max 10MB each). Allowed types: images (PNG, JPG, GIF),
|
||||
documents (PDF, TXT, DOC, DOCX), spreadsheets (XLS, XLSX, CSV).
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style="background-color: #f8f9fa; padding: 15px; border-radius: 4px; margin: 20px 0;">
|
||||
<h3 style="margin-top: 0; font-size: 1.1em;">Privacy Notice</h3>
|
||||
<ul style="margin: 10px 0; padding-left: 20px; line-height: 1.8;">
|
||||
<li>Your feedback is submitted anonymously</li>
|
||||
<li>We do not collect or store your IP address</li>
|
||||
<li>All files are scanned for malware</li>
|
||||
<li>Please do not include personal information unless necessary</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<button type="submit">Submit Feedback</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Feedback Submitted - {{ product.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div style="text-align: center; padding: 40px 20px;">
|
||||
<div style="font-size: 4em; color: #2ecc71; margin-bottom: 20px;">✓</div>
|
||||
|
||||
<h1>Thank You!</h1>
|
||||
|
||||
<p style="font-size: 1.2em; margin: 20px 0;">
|
||||
Your feedback has been successfully submitted.
|
||||
</p>
|
||||
|
||||
<div style="background-color: #f8f9fa; padding: 20px; border-radius: 4px; margin: 30px 0; text-align: left;">
|
||||
<h3 style="margin-top: 0;">What happens next?</h3>
|
||||
<ul style="line-height: 2;">
|
||||
<li>Your feedback will be analyzed automatically</li>
|
||||
<li>The product team will review your submission</li>
|
||||
<li>They may use your feedback to improve {{ product.name }}</li>
|
||||
</ul>
|
||||
|
||||
<p style="margin: 20px 0 10px 0; font-size: 0.9em; color: #666;">
|
||||
<strong>Reference ID:</strong> {{ feedback_id }}
|
||||
</p>
|
||||
<p style="margin: 0; font-size: 0.9em; color: #666;">
|
||||
(This ID is for your reference only. We cannot track individual submissions.)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p style="margin-top: 40px;">
|
||||
<a href="{{ url_for('submission.form', product_slug=product.submission_url_slug) }}" class="btn">
|
||||
Submit More Feedback
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user