Skip to content

Commit

Permalink
Merge pull request #398 from jajodiaraghav/goyal-sidd-csscard
Browse files Browse the repository at this point in the history
Example links added
  • Loading branch information
sid22 authored Jul 20, 2017
2 parents 59f7d9b + 62c8d1c commit c8f7b9b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 13 deletions.
1 change: 0 additions & 1 deletion website/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ input[type='file'] {
#myFooter .fa-github:hover {
color: black;
}

.cardbox {
width: 20rem;
}
46 changes: 36 additions & 10 deletions website/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1 class="page-header">{% trans "Find Bugs, Win Points and Prizes" %}</h1>
</section>

<div class="container">
<center>
<center>
<div class="row">
<div class="col-sm-4">
<div class="card cardbox">
Expand All @@ -34,29 +34,41 @@ <h4 class="card-title">{% trans "Number Error" %}</h4>
<p class="card-text">{% trans "For pages where you see a number 404, 500." %}</p>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/search/?query=1&type=label">Examples</a>
</li>
</ul>
</div>

<div class="col-sm-4">
<div class="card cardbox">
<center><i class="fa fa-trophy fa-3x"></i></center>
<div class="card-block">
<h4 class="card-title">{% trans "Functional" %}</h4>
<p class="card-text">{% trans "Something doesn't work." %}</p>
<p class="card-text">{% trans "Something doesn't work as intended" %}</p>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/search/?query=2&type=label">Examples</a>
</li>
</ul>
</div>
<div class="col-sm-4">
<div class="card cardbox">
<center><i class="fa fa-flash fa-3x"></i></center>
<div class="card-block">
<h4 class="card-title">{% trans "Performance" %}</h4>
<p class="card-text">{% trans "Anything over 5 seconds." %}</p>
<p class="card-text">{% trans "Any process that takes over 5 seconds." %}</p>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/search/?query=3&type=label">Examples</a>
</li>
</ul>
</div>
</div>
<br>
<br>
<div class="row">
<div class="col-sm-4">
<div class="card cardbox">
Expand All @@ -66,6 +78,11 @@ <h4 class="card-title">{% trans "Security" %}</h4>
<p class="card-text">{% trans "Data leaks, exploits or anything smelly." %}</p>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/search/?query=4&type=label">Examples</a>
</li>
</ul>
</div>
<div class="col-sm-4">
<div class="card cardbox">
Expand All @@ -75,6 +92,11 @@ <h4 class="card-title">{% trans "Typo" %}</h4>
<p class="card-text">{% trans "Miss-spellings, miss-grammar and more." %}</p>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/search/?query=5&type=label">Examples</a>
</li>
</ul>
</div>
<div class="col-sm-4">
<div class="card cardbox">
Expand All @@ -84,11 +106,15 @@ <h4 class="card-title">{% trans "Design" %}</h4>
<p class="card-text">{% trans "Layout, responsiveness and improvements" %}</p>
</div>
</div>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<a href="/search/?query=6&type=label">Examples</a>
</li>
</ul>
</div>
</div>
</center>
</div>

</center>
</div>
<div class="row">
<div class="col-lg-9">
<div class="row">
Expand Down
4 changes: 2 additions & 2 deletions website/templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h3 class="text-center">Search for Bugs & Issues</h3><hr>
<form method="GET" action=".">
<div class="input-group">
<input type="text" class="form-control" name="query" value="{{query}}" placeholder="Search for issues...">
<input type="text" class="form-control" name="query" value="{% if type != 'label' %}{{query}}{% endif %}" placeholder="Search for issues...">
<span class="input-group-btn">
<select class="form-control" name="type" style="width:150%">
<option value="issue" selected="selected">Issue</option>
Expand Down Expand Up @@ -39,7 +39,7 @@ <h3 class="text-center">Search for Bugs & Issues</h3><hr>
</a>
</div>
{% endfor %}
</div>
</div>
{% elif users %}
<div class="list-group">
{% for user in users %}
Expand Down
6 changes: 6 additions & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,12 @@ def search(request, template="search.html"):
'type': stype,
'users': User.objects.filter(Q(username__icontains=query))[0:20]
}
elif stype == "label":
context = {
'query': query,
'type': stype,
'issues': Issue.objects.filter(Q(label__icontains=query))[0:20]
}
return render(request, template, context)


Expand Down

0 comments on commit c8f7b9b

Please sign in to comment.