Skip to content

Commit 55eb0f4

Browse files
committed
changed file structure to include new home page
new home page can now be accessed on <parent_url>/newhome/
1 parent b6a0e60 commit 55eb0f4

File tree

6 files changed

+222
-0
lines changed

6 files changed

+222
-0
lines changed

blt/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
r"^redoc/$", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"
163163
),
164164
re_path(r"^$", website.views.index, name="index"),
165+
re_path(r"^newhome/$", website.views.newhome, name="newhome"),
165166
re_path(
166167
r"^dashboard/company/$",
167168
website.views.company_dashboard,

website/templates/base_new.html

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{% load static %}
2+
{% load custom_tags %}
3+
{% load gravatar %}
4+
{% load socialaccount %}
5+
{% load user_score %}
6+
{% providers_media_js %}
7+
{% load i18n %}
8+
<!DOCTYPE html>
9+
<html lang="en">
10+
11+
<head>
12+
<title>{% block title %}{% env 'PROJECT_NAME' %}{% endblock %}</title>
13+
<meta charset="utf-8">
14+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
15+
<meta name="viewport" content="width=device-width, initial-scale=1">
16+
<meta name="description"
17+
content="{% block description %}{% env 'PROJECT_NAME' %} allows anyone to submit an issue from any website. For example if you saw a broken button on Amazon.com you can report the issue on {% env 'PROJECT_NAME' %} and then get a point! The more bugs you find the more points you get. Bugs can be verified for extra points and companies can get involved and help out.{% endblock %}">
18+
<meta name="author" content="">
19+
<meta property="og:title" content="{% block og_title %}{% env 'PROJECT_NAME' %}{% endblock %}" />
20+
<meta property="og:image" content="{% block og_image %}{% static 'img/screenshot.png' %}{% endblock %}" />
21+
<meta property="og:description"
22+
content="{% block og_description %}{% env 'PROJECT_NAME' %} allows anyone to submit an issue from any website. For example if you saw a broken button on Amazon.com you can report the issue on {% env 'PROJECT_NAME' %} and then get a point! The more bugs you find the more points you get. Bugs can be verified for extra points and companies can get involved and help out.{% endblock %}" />
23+
<meta property="og:type" content="website" />
24+
25+
<link href="{% static 'vendor/bootstrap/css/bootstrap.css' %}" rel="stylesheet">
26+
<link href="{% static 'css/style.css' %}" rel="stylesheet">
27+
<link href="{% static 'css/lightbox.min.css' %}" rel="stylesheet">
28+
<link href="{% static 'vendor/font-awesome/css/font-awesome.min.css' %}" rel="stylesheet" type="text/css">
29+
<link href="{% static 'css/animate.css' %}" rel="stylesheet" type="text/css">
30+
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet">
31+
<link href="{% static 'css/main.css' %}" rel="stylesheet" type="text/css">
32+
<link href="{% static 'css/text-slider.css' %}" rel="stylesheet" type="text/css">
33+
<link href="{% static 'css/activity.css' %}" rel="stylesheet" type="text/css">
34+
<link href="{% static 'css/navbar.css' %}" rel="stylesheet" type="text/css">
35+
<link
36+
rel="stylesheet"
37+
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.2/css/all.min.css"
38+
integrity="sha512-1sCRPdkRXhBV2PBLUdRb4tMg1w2YPf37qatUFeS7zlBy7jJI8Lf4VHwWfZZfpXtYSLy85pkm9GaYVYMfw5BC1A=="
39+
crossorigin="anonymous"
40+
referrerpolicy="no-referrer"
41+
/>
42+
43+
<script src="{% static 'vendor/jquery/jquery.min.js' %}"></script>
44+
<script src="{% static 'js/notify.js' %}"></script>
45+
<script src="{% static 'js/text-slider.js' %}"></script>
46+
<script src="https://cdn.tailwindcss.com"></script>
47+
48+
{% block head %}
49+
{% endblock %}
50+
51+
{% block style %}
52+
{% endblock %}
53+
54+
</head>
55+
56+
<body class="relative min-h-[100vh] flex flex-col">
57+
58+
{% comment %} navigation {% endcomment %}
59+
{% include "includes/header.html" %}
60+
{% include "includes/sidenav.html" %}
61+
{% comment %} navigation {% endcomment %}
62+
63+
<div id="wrapper" class="grow bg-[#F7F7F7]">
64+
<div id="page-wrapper" class="relative">
65+
<div id="base-container" class="container">
66+
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>hello<br>
67+
{% block content %}
68+
{% endblock %}
69+
</div>
70+
</div>
71+
</div>
72+
{% comment %} block with no bootstrap wrappers {% endcomment %}
73+
{% block natural_content %}
74+
{% endblock %}
75+
76+
</body>
77+
78+
<script src="{% static 'vendor/bootstrap/js/bootstrap.min.js' %}"></script>
79+
<script src="{% static 'js/ui.js' %}"></script>
80+
{% block after_js %}
81+
{% endblock %}
82+
83+
<script>
84+
$("#report-bug-btn").click(function () {
85+
$("#spinner").show()
86+
});
87+
</script>
88+
<script>
89+
(function (i, s, o, g, r, a, m) {
90+
i['GoogleAnalyticsObject'] = r;
91+
i[r] = i[r] || function () {
92+
(i[r].q = i[r].q || []).push(arguments)
93+
}, i[r].l = 1 * new Date();
94+
a = s.createElement(o),
95+
m = s.getElementsByTagName(o)[0];
96+
a.async = 1;
97+
a.src = g;
98+
m.parentNode.insertBefore(a, m)
99+
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
100+
ga('create', 'UA-66634107-1', 'auto');
101+
ga('send', 'pageview');
102+
</script>
103+
<script type="text/javascript">
104+
$(".mbug").click(function () {
105+
$(this).addClass("hidden-xs");
106+
$(this).addClass("hidden-sm");
107+
$(".mnav").removeClass("hidden-xs");
108+
$(".mnav").removeClass("hidden-sm");
109+
});
110+
$(function () {
111+
$('button[name="test_files"]').on('click', function () {
112+
$(this).parent().find('input[type=file]').click();
113+
});
114+
$('input[name="screenshot"]').on('change', function () {
115+
var file = $(this).val().replace('C:\\fakepath\\', '');
116+
$(this).parent().find('span').html(file);
117+
});
118+
119+
120+
{% if messages %}
121+
{% for message in messages %}
122+
$.notify("{{ message }}", {
123+
style: "custom",
124+
className: "{{message.level_tag }}"
125+
});
126+
{% endfor %}
127+
{% endif %}
128+
});
129+
</script>
130+
131+
<script type="text/javascript">
132+
window._mfq = window._mfq || [];
133+
(function () {
134+
var mf = document.createElement("script");
135+
mf.type = "text/javascript";
136+
mf.async = true;
137+
mf.src = "//cdn.mouseflow.com/projects/efbbebea-436f-4b6f-9290-14ab36c8f636.js";
138+
document.getElementsByTagName("head")[0].appendChild(mf);
139+
})();
140+
</script>
141+
142+
</html>

website/templates/includes/header.html

Whitespace-only changes.

website/templates/includes/sidenav.html

Whitespace-only changes.

website/templates/new_home.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% extends "base_new.html" %}
2+
3+
{% block content %}
4+
5+
{% endblock %}

website/views.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,80 @@ def index(request, template="index.html"):
179179
}
180180
return render(request, template, context)
181181

182+
#@cache_page(60 * 60 * 24)
183+
def newhome(request, template="new_home.html"):
184+
185+
try:
186+
if not EmailAddress.objects.get(email=request.user.email).verified:
187+
messages.error(request, "Please verify your email address")
188+
except:
189+
pass
190+
191+
# latest_hunts_filter = request.GET.get("latest_hunts",None)
192+
193+
# bug_count = Issue.objects.all().count()
194+
# user_count = User.objects.all().count()
195+
# hunt_count = Hunt.objects.all().count()
196+
# domain_count = Domain.objects.all().count()
197+
198+
# captcha_form = CaptchaForm()
199+
200+
# wallet = None
201+
# if request.user.is_authenticated:
202+
# wallet, created = Wallet.objects.get_or_create(user=request.user)
203+
204+
# activity_screenshots = {}
205+
# for activity in Issue.objects.all():
206+
# activity_screenshots[activity] = IssueScreenshot.objects.filter(issue=activity).first()
207+
208+
# top_companies = Issue.objects.values("domain__name").annotate(count=Count('domain__name')).order_by("-count")[:10]
209+
# top_testers = Issue.objects.values("user__id","user__username").filter(user__isnull=False).annotate(count=Count('user__username')).order_by("-count")[:10]
210+
# activities = Issue.objects.exclude(Q(is_hidden=True) & ~Q(user_id=request.user.id))[0:10]
211+
212+
# top_hunts = Hunt.objects.values(
213+
# 'id',
214+
# 'name',
215+
# 'url',
216+
# 'logo',
217+
# 'starts_on',
218+
# 'starts_on__day',
219+
# 'starts_on__month',
220+
# 'starts_on__year',
221+
# 'end_on',
222+
# 'end_on__day',
223+
# 'end_on__month',
224+
# 'end_on__year',
225+
# ).annotate(total_prize=Sum("huntprize__value"))
226+
227+
# if latest_hunts_filter != None:
228+
# top_hunts = top_hunts.filter(result_published=True).order_by("-created")[:3]
229+
# else:
230+
# top_hunts = top_hunts.filter(is_published=True,result_published=False).order_by("-created")[:3]
231+
232+
233+
context = {
234+
# "server_url": request.build_absolute_uri('/'),
235+
# "activities": activities,
236+
# "hunts": Hunt.objects.exclude(txn_id__isnull=True)[:4],
237+
# "leaderboard": User.objects.filter(
238+
# points__created__month=datetime.now().month,
239+
# points__created__year=datetime.now().year,
240+
# )
241+
# .annotate(total_score=Sum("points__score"))
242+
# .order_by("-total_score")[:10],
243+
# "bug_count": bug_count,
244+
# "user_count": user_count,
245+
# "hunt_count": hunt_count,
246+
# "domain_count": domain_count,
247+
# "wallet": wallet,
248+
# "captcha_form": captcha_form,
249+
# "activity_screenshots":activity_screenshots,
250+
# "top_companies":top_companies,
251+
# "top_testers":top_testers,
252+
# "top_hunts": top_hunts,
253+
# "ended_hunts": False if latest_hunts_filter == None else True
254+
}
255+
return render(request, template, context)
182256

183257
def github_callback(request):
184258
ALLOWED_HOSTS = ['github.com']

0 commit comments

Comments
 (0)