Skip to content

Commit

Permalink
Fix Report-bug form (#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
jajodiaraghav authored Aug 24, 2017
1 parent e1b5cc9 commit b1e8765
Showing 1 changed file with 54 additions and 57 deletions.
111 changes: 54 additions & 57 deletions website/templates/report.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,50 @@
{% providers_media_js %}

{% block style %}
.duplicates {
border-radius: 0px;
}
.message {

}
.duplicates {
border-radius: 0px;
}
{% endblock %}

{% block content %}
<script src="{% static "js/jquery.validate.js" %}"></script>
<script src="{% static 'js/activity.js' %}"></script>

<form action="/issue/" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="row main">
<div class="panel-heading">
<div class="panel-title text-center">
<h1 class="title">Report a bug</h1>
<hr />
</div>
</div>
<div class="main-issue-form main-center">
<form class="form-horizontal" method="post" action="#">
<div class="form-group{% if form.url.errors %} has-error{% endif %}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-external-link" aria-hidden="true"></i></span>
{% if request.GET.url %}
<input class="form-control required" data-intro="Enter the website's complete url where you found the bug." data-step="1" placeholder="www.testsite.com/bug-found" name="url" value="{{request.GET.url}}">
{% else %}
<input class="form-control required" data-intro="Enter the website's complete url where you found the bug." data-step="1" placeholder="www.testsite.com/bug-found" name="url" value="{{form.url.value|default:""}}">
{% endif %}
<a class="btn btn-info form-control duplicates">Check for Duplicates</a>
</div>
<span class="message"></span>
<span class="help-block">{{ form.url.errors }}</span>
<div class="row main">
<div class="panel-heading">
<div class="panel-title text-center">
<h1 class="title">Report a bug</h1>
<hr />
</div>
<div class="form-group{% if form.description.errors %} has-error{% endif %}">
</div>
<div class="main-issue-form main-center">
<form class="form-horizontal" method="post" action="#">
<div class="form-group{% if form.url.errors %} has-error{% endif %}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>
<textarea data-required="true" name="description" id="description" data-intro="Describe the nature of bug." data-step="2" class="form-control required" rows="3" placeholder="Describe bug issue">{{form.description.value|default:""}}</textarea>
<span class="help-block">{{ form.description.errors }}</span>
</div>
<span class="input-group-addon"><i class="fa fa-external-link" aria-hidden="true"></i></span>
{% if request.GET.url %}
<input class="form-control required" data-intro="Enter the website's complete url where you found the bug." data-step="1" placeholder="www.testsite.com/bug-found" name="url" value="{{request.GET.url}}">
{% else %}
<input class="form-control required" data-intro="Enter the website's complete url where you found the bug." data-step="1" placeholder="www.testsite.com/bug-found" name="url" value="{{form.url.value|default:""}}">
{% endif %}
<a class="btn btn-info form-control duplicates">Check for Duplicates</a>
</div>
<span class="message"></span>
<span class="help-block">{{ form.url.errors }}</span>
</div>
<div class="form-group{% if form.description.errors %} has-error{% endif %}">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-list" aria-hidden="true"></i></span>
<span class="input-group-addon"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></span>
<textarea data-required="true" name="description" id="description" data-intro="Describe the nature of bug." data-step="2" class="form-control required" rows="3" placeholder="Describe bug issue">{{form.description.value|default:""}}</textarea>
</div>
<span class="help-block">{{ form.description.errors }}</span>
</div>
<div class="input-group">
<span class="input-group-addon">
<i class="fa fa-list" aria-hidden="true"></i>
</span>
<select required data-intro="Categorize the bug." data-step="3" name="label" class="form-control">
<option value="0" selected="selected">General</option>
<option value="1">Number error</option>
Expand All @@ -59,30 +59,27 @@ <h1 class="title">Report a bug</h1>
<option value="5">Typo</option>
<option value="6">Design</option>
</select>
</div>
<div class="form-group{% if form.screenshot.errors %} has-error{% endif %}">
{% if request.GET.hash %}</br>
<img src="{{ MEDIA_URL }}uploads/{{request.GET.hash}}.png" class="img-responsive img-thumbnail screenshot-hash">
<input type="hidden" class="required" name="screenshot-hash" value="{{request.GET.hash}}">
{% else %}
<br>
<span>
<input type="file" class="required" id='${multipartFilePath}' name="screenshot"/>
<button class="btn btn-primary btn-block" data-intro="Upload a screenshot of the concerned page." data-step="4" name="test_files" type="button">
<i class="fa fa-upload" aria-hidden="true"></i> Upload Screenshot
</button>
<br>
<center><span class="badge badge-important"></span></center>
</span>
{% endif %}
<span class="help-block{% if form.screenshot.errors %} has-error{% endif %}">{{ form.screenshot.errors }}</span>
</div>
<button type="submit" name="reportbug_button" id="btn" class="btn btn-default btn-block" data-intro="Click here to report the bug to BugHeist." data-step="5">
Report Bug <i class="fa fa-trophy" aria-hidden="true">+3</i>
</button>
</form>
</div>
</div>
<div class="form-group{% if form.screenshot.errors %} has-error{% endif %}">
{% if request.GET.hash %}</br>
<img src="{{ MEDIA_URL }}uploads/{{request.GET.hash}}.png" class="img-responsive img-thumbnail screenshot-hash">
<input type="hidden" class="required" name="screenshot-hash" value="{{request.GET.hash}}">
{% else %}
<br>
<span>
<input type="file" class="required" id='${multipartFilePath}' name="screenshot"/>
<button class="btn btn-primary btn-block" data-intro="Upload a screenshot of the concerned page." data-step="4" name="test_files" type="button">
<i class="fa fa-upload" aria-hidden="true"></i> Upload Screenshot
</button>
<span class="help-block{% if form.screenshot.errors %} has-error{% endif %}">{{ form.screenshot.errors }}</span>
<span class="badge badge-important"></span>
</span>
{% endif %}
</div>
<button type="submit" name="reportbug_button" id="btn" class="btn btn-default btn-block" data-intro="Click here to report the bug to BugHeist." data-step="5">
Report Bug <i class="fa fa-trophy" aria-hidden="true">+3</i>
</button>
</div>
</form>
<script type="text/javascript">
$(function() {
Expand All @@ -91,7 +88,7 @@ <h1 class="title">Report a bug</h1>
});
$('input[name="screenshot"]').on('change', function() {
var file = $(this).val().replace('C:\\fakepath\\', '');
$(this).parent().find('span').html(file);
$(this).parent().find('.badge').html(file);
});

$(".duplicates").click(function(){
Expand Down

0 comments on commit b1e8765

Please sign in to comment.