forked from OWASP-BLT/BLT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
195 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
website/migrations/0083_invitefriend_referral_code_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 5.0.2 on 2024-02-22 21:11 | ||
|
||
import uuid | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("website", "0082_issue_reporter_ip_address"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="invitefriend", | ||
name="referral_code", | ||
field=models.CharField(default=uuid.uuid4, editable=False, max_length=100), | ||
), | ||
migrations.AddField( | ||
model_name="invitefriend", | ||
name="signup_completed", | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
color: #000; | ||
background-color: #fff; | ||
} | ||
.container { | ||
padding: 20px; | ||
} | ||
.header { | ||
color: #fff; | ||
padding: 5px; | ||
text-align: center; | ||
} | ||
.content { | ||
margin-top: 20px; | ||
} | ||
.button { | ||
display: inline-block; | ||
padding: 10px 20px; | ||
margin-top: 20px; | ||
background-color: #e02424; | ||
color: #fff; | ||
text-decoration: none; | ||
font-weight: bold; | ||
} | ||
.footer { | ||
margin-top: 30px; | ||
text-align: center; | ||
padding: 10px; | ||
font-size: 0.8em; | ||
background-color: #f2f2f2; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="header"> | ||
<img src="https://blt.owasp.org/favicon.ico" alt="BLT Logo"> | ||
<h1>Welcome to {{ site_name }}</h1> | ||
</div> | ||
<div class="content"> | ||
<p>Hi there!</p> | ||
<p>You've been invited by <strong>{{ sender_username }}</strong> to join our community at <strong>{{ site_name }}</strong>.</p> | ||
<p>We're excited to have you onboard and explore the vast opportunities to find and submit bugs, earn rewards, and be part of our thriving community.</p> | ||
<a href="{{ referral_link }}" class="button">Join Now</a> | ||
</div> | ||
<div class="footer"> | ||
<p>© {{ site_name }}. All rights reserved.</p> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<form action="{% url 'invite_friend' %}" method="post" class="form-inline"> | ||
<form action="{% url 'invite_friend' %}" method="post" class="mx-auto max-w-lg mt-5"> | ||
{% csrf_token %} | ||
<div class="row"> | ||
{% for error in form.non_field_errors %} | ||
<div class="col-lg-6">{{ error }}</div> | ||
{% endfor %} | ||
</div> | ||
<div class="row"> | ||
<div class="col-lg-10"> | ||
{% if form.recipient.errors %} | ||
<div class="alert alert-danger">{{ form.recipient.errors }}</div> | ||
{% endif %} | ||
{% for error in form.non_field_errors %} | ||
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative" role="alert"> | ||
<strong class="font-bold">Oops!</strong> | ||
<span class="block sm:inline">{{ error }}</span> | ||
</div> | ||
{% endfor %} | ||
|
||
<div class="mb-4"> | ||
<label for="recipient" class="block text-gray-700 text-2xl font-bold mb-2">Friends mail:</label> | ||
{{ form.recipient }} | ||
{% if form.recipient.errors %} | ||
<p class="text-red-500 text-xs italic">{{ form.recipient.errors }}</p> | ||
{% endif %} | ||
</div> | ||
<div class="row"> | ||
<div class="col-lg-10"> | ||
<h3 class="page-header">Invite 2 friends and get 1 point!</h3> | ||
<label>Email:</label> | ||
{{ form.recipient }} | ||
<button type="submit" class="btn btn-danger text-black">Invite</button> | ||
</div> | ||
|
||
<div class="flex items-center justify-between"> | ||
<button type="submit" class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"> | ||
Invite | ||
</button> | ||
<p class="inline-block align-baseline font-bold text-base text-red-500 hover:text-red-800"> | ||
Invite a friend to join the site and earn 2 points! | ||
</p> | ||
</div> | ||
</form> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters