-
-
Notifications
You must be signed in to change notification settings - Fork 313
Fix #91: Add labels/badges on issues. #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # Generated by Django 1.9.2 on 2017-06-09 12:43 | ||
| from __future__ import unicode_literals | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('website', '0026_auto_20170606_2049'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='issue', | ||
| name='label', | ||
| field=models.PositiveSmallIntegerField(choices=[(1, b'Number Error'), (2, b'Functional'), (3, b'Performance'), (4, b'Security'), (5, b'Typo'), (6, b'Design'), (0, b'Unspecified')], default=0), | ||
| ), | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,15 @@ | |
| <label id="description-error" class="error" for="description">{{form.description.errors}}</label> | ||
| {% endif %} | ||
| </div> | ||
| <select name="label" class="form-control"> | ||
| <option value="0" selected="selected">Bug Type</option> | ||
| <option value="1">Number error</option> | ||
| <option value="2">Functional</option> | ||
| <option value="3">Performance</option> | ||
| <option value="4">Security</option> | ||
| <option value="5">Typo</option> | ||
| <option value="6">Design</option> | ||
| </select> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be rendered from the backend instead of hard coding the properties here. It'll guarantee a safe submission of our attribute integrity on both the sides.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I have rendered the form element in the edit page from the backend, I couldn't do it in base.html. I am new to Django and would love to see how to do this. Could you please change this part on top of my commit?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jajodiaraghav -- What issue are you facing while using it in base.html ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. {{form.label}} does not render anything in base.html. I did it in a way similar to the one in issue_edit.html. It took me a lot of time trying to debug, but all in vain. Can we merge this and fix the base.html in a different commit. I want to work on issue_edit.html page but couldn't, as it would result in conflicts unless this gets merged. Or else, please help me fix this. Thanks :)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have a look at |
||
| <div class="form-group"> | ||
| <!-- <label>Attach Screenshot</label> --> | ||
| {% if request.GET.hash %}</br> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a required element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get this part. Could be a bit more explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set the attributes of the form in the backend. So, if we declare a required clause within the form definition in the backend -- It'll make sure that it is required when it is rendered and thus form submission is declined if it is not filled. It also solves the problem that you asked on Slack.
https://docs.djangoproject.com/en/1.11/ref/forms/fields/#django.forms.Field.required