Skip to content

Commit

Permalink
Revamped homepage from mockup #181. (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
souravbadami authored Sep 6, 2017
1 parent ad7f9ab commit fb00125
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
51 changes: 49 additions & 2 deletions website/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,54 @@ <h1 class="page-sub-header">{% trans "Featured Websites" %}</h1>
</div>
</div>

<div class="row" data-intro="View latest activities here." data-step="3">
<div class="row" style="margin-left: 10px;">
<div class="col-lg-3 col-md-3">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="row">
<div class="col-xs-9 text-right">
<h4><i class="fa fa-bug"></i> {{bug_count}} Bugs</h4>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="panel panel-green">
<div class="panel-heading">
<div class="row">
<div class="col-xs-9 text-right">
<h4><i class="fa fa-user"></i> {{user_count}} Users</h4>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="panel panel-yellow">
<div class="panel-heading">
<div class="row">
<div class="col-xs-9 text-right">
<h4><i class="fa fa-bullseye"></i> {{hunt_count}} Hunts</h4>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-3">
<div class="panel panel-red">
<div class="panel-heading">
<div class="row">
<div class="col-xs-9 text-right">
<h4><i class="fa fa-support"></i> {{domain_count}} Domains</h4>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="row" data-intro="View latest activities here." data-step="3" style="margin-left: 10px;">
<div class="col-md-8">
<h1 class="page-sub-header">Latest activity</h1>
<div class="list-group">
Expand Down Expand Up @@ -212,7 +259,7 @@ <h1 class="page-sub-header">Latest activity</h1>
<div class="list-group">
{% if leaderboard %}
{% for leader in leaderboard %}
<div class="list-group-item">
<div class="list-group-item activity-strip" style="height: 80px; border: 1px solid #DDDDDD">
{% if leader.socialaccount_set.all.0.get_avatar_url %}
<img src="{{leader.socialaccount_set.all.0.get_avatar_url}}" width="50" height="50">
{% else %}
Expand Down
8 changes: 8 additions & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ def index(request, template="index.html"):
show_message = ''
open_issue_owasp = Domain.objects.get(name='owasp.org').open_issues.count()
closed_issue_owasp = Domain.objects.get(name='owasp.org').closed_issues.count()
bug_count = Issue.objects.all().count()
user_count = User.objects.all().count()
hunt_count = Hunt.objects.all().count()
domain_count = Domain.objects.all().count()
context = {
'activities': Issue.objects.all()[0:10],
'domains': domains,
Expand All @@ -67,6 +71,10 @@ def index(request, template="index.html"):
'not_verified': show_message,
'open_issue_owasp': open_issue_owasp,
'closed_issue_owasp': closed_issue_owasp,
'bug_count': bug_count,
'user_count': user_count,
'hunt_count': hunt_count,
'domain_count': domain_count
}
return render(request, template, context)

Expand Down

0 comments on commit fb00125

Please sign in to comment.