Skip to content

Commit

Permalink
review grading on scale or 0-5
Browse files Browse the repository at this point in the history
  • Loading branch information
imkevinxu committed Jan 14, 2013
1 parent 311f6b1 commit 377c83e
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 75 deletions.
10 changes: 1 addition & 9 deletions cardinalwebdev_app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,4 @@ class ApplyForm(forms.Form):
attendance = forms.BooleanField(required=False)
interest = forms.CharField(required=True, widget=forms.Textarea)
background = forms.CharField(required=True, widget=forms.Textarea)
comments = forms.CharField(required=False, widget=forms.Textarea)

# class ReviewForm(forms.Form):
# charlie_comments = forms.CharField(required=False, widget=forms.Textarea)
# charlie_decision = forms.ChoiceField(choices=ApplicationReview.REVIEW_CHOICES)
# kevin_comments = forms.CharField(required=False, widget=forms.Textarea)
# kevin_decision = forms.ChoiceField(choices=ApplicationReview.REVIEW_CHOICES)
# kingston_comments = forms.CharField(required=False, widget=forms.Textarea)
# kingston_decision = forms.ChoiceField(choices=ApplicationReview.REVIEW_CHOICES)
comments = forms.CharField(required=False, widget=forms.Textarea)
7 changes: 0 additions & 7 deletions cardinalwebdev_app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ def __unicode__(self):
return u'%s\'s Application' % (self.name)

class ApplicationReview(Base):
REVIEW_CHOICES = (
(-2, 'Highly Reject'),
(-1, 'Reject'),
(0, 'Unsure'),
(1, 'Accept'),
(2, 'Highly Accept'),
)
application = models.ForeignKey(Application)
charlie_comments = models.TextField()
charlie_decision = models.IntegerField(default=0)
Expand Down
135 changes: 76 additions & 59 deletions templates/review.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,106 +147,121 @@ <h4>{{ app.application.name }}</h4>
</div>
</td>
<td class="charlie editor">
{% if app.charlie_decision == -2 %}
<span class="label round alert text-center">Highly Reject</span>
{% elif app.charlie_decision == -1 %}
<span class="label round alert text-center">Reject</span>
{% elif app.charlie_decision == 0 %}
<span class="label round secondary text-center">Unsure</span>
{% if app.charlie_decision == 0 %}
<span class="label round secondary text-center">0</span>
{% elif app.charlie_decision == 1 %}
<span class="label round success text-center">Accept</span>
<span class="label round alert text-center">1</span>
{% elif app.charlie_decision == 2 %}
<span class="label round success text-center">Highly Accept</span>
<span class="label round alert text-center">2</span>
{% elif app.charlie_decision == 3 %}
<span class="label round text-center">3</span>
{% elif app.charlie_decision == 4 %}
<span class="label round success text-center">4</span>
{% elif app.charlie_decision == 5 %}
<span class="label round success text-center">5</span>
{% endif %}

<form action="{% url submit_review %}" class="expanded hidden" method="POST"> {% csrf_token %}
<input type="hidden" name="application" value="{{ app.id }}" />
<input type="hidden" name="editor" value="charlie" />
<input type="radio" name="decision" value="-2" id="charlie_decision_-2_{{ app.id }}"
{% if app.charlie_decision == -2 %}checked{% endif %}>
<label for="charlie_decision_-2_{{ app.id }}">Highly Reject</label><br/>
<input type="radio" name="decision" value="-1" id="charlie_decision_-1_{{ app.id }}"
{% if app.charlie_decision == -1 %}checked{% endif %}>
<label for="charlie_decision_-1_{{ app.id }}">Reject</label><br/>
<input type="radio" name="decision" value="0" id="charlie_decision_0_{{ app.id }}"
{% if app.charlie_decision == 0 %}checked{% endif %}>
<label for="charlie_decision_0_{{ app.id }}">Unsure</label><br/>
<label for="charlie_decision_0_{{ app.id }}">0</label><br/>
<input type="radio" name="decision" value="1" id="charlie_decision_1_{{ app.id }}"
{% if app.charlie_decision == 1 %}checked{% endif %}>
<label for="charlie_decision_1_{{ app.id }}">Accept</label><br/>
<label for="charlie_decision_1_{{ app.id }}">1</label><br/>
<input type="radio" name="decision" value="2" id="charlie_decision_2_{{ app.id }}"
{% if app.charlie_decision == 2 %}checked{% endif %}>
<label for="charlie_decision_2_{{ app.id }}">Highly Accept</label>
<label for="charlie_decision_2_{{ app.id }}">2</label><br/>
<input type="radio" name="decision" value="3" id="charlie_decision_3_{{ app.id }}"
{% if app.charlie_decision == 3 %}checked{% endif %}>
<label for="charlie_decision_3_{{ app.id }}">3</label><br/>
<input type="radio" name="decision" value="4" id="charlie_decision_4_{{ app.id }}"
{% if app.charlie_decision == 4 %}checked{% endif %}>
<label for="charlie_decision_4_{{ app.id }}">4</label><br/>
<input type="radio" name="decision" value="5" id="charlie_decision_5_{{ app.id }}"
{% if app.charlie_decision == 5 %}checked{% endif %}>
<label for="charlie_decision_5_{{ app.id }}">5</label>
<textarea name="comments">{{ app.charlie_comments }}</textarea>
<p class="ajaxFired"></p>
</form>
</td>
<td class="kevin editor">
{% if app.kevin_decision == -2 %}
<span class="label round alert text-center">Highly Reject</span>
{% elif app.kevin_decision == -1 %}
<span class="label round alert text-center">Reject</span>
{% elif app.kevin_decision == 0 %}
<span class="label round secondary text-center">Unsure</span>
{% if app.kevin_decision == 0 %}
<span class="label round secondary text-center">0</span>
{% elif app.kevin_decision == 1 %}
<span class="label round success text-center">Accept</span>
<span class="label round alert text-center">1</span>
{% elif app.kevin_decision == 2 %}
<span class="label round success text-center">Highly Accept</span>
<span class="label round alert text-center">2</span>
{% elif app.kevin_decision == 3 %}
<span class="label round text-center">3</span>
{% elif app.kevin_decision == 4 %}
<span class="label round success text-center">4</span>
{% elif app.kevin_decision == 5 %}
<span class="label round success text-center">5</span>
{% endif %}

<form action="{% url submit_review %}" class="expanded hidden" method="POST"> {% csrf_token %}
<input type="hidden" name="application" value="{{ app.id }}" />
<input type="hidden" name="editor" value="kevin" />
<input type="radio" name="decision" value="-2" id="kevin_decision_-2_{{ app.id }}"
{% if app.kevin_decision == -2 %}checked{% endif %}>
<label for="kevin_decision_-2_{{ app.id }}">Highly Reject</label><br/>
<input type="radio" name="decision" value="-1" id="kevin_decision_-1_{{ app.id }}"
{% if app.kevin_decision == -1 %}checked{% endif %}>
<label for="kevin_decision_-1_{{ app.id }}">Reject</label><br/>
<input type="radio" name="decision" value="0" id="kevin_decision_0_{{ app.id }}"
{% if app.kevin_decision == 0 %}checked{% endif %}>
<label for="kevin_decision_0_{{ app.id }}">Unsure</label><br/>
<label for="kevin_decision_0_{{ app.id }}">0</label><br/>
<input type="radio" name="decision" value="1" id="kevin_decision_1_{{ app.id }}"
{% if app.kevin_decision == 1 %}checked{% endif %}>
<label for="kevin_decision_1_{{ app.id }}">Accept</label><br/>
<label for="kevin_decision_1_{{ app.id }}">1</label><br/>
<input type="radio" name="decision" value="2" id="kevin_decision_2_{{ app.id }}"
{% if app.kevin_decision == 2 %}checked{% endif %}>
<label for="kevin_decision_2_{{ app.id }}">Highly Accept</label>
<label for="kevin_decision_2_{{ app.id }}">2</label><br/>
<input type="radio" name="decision" value="3" id="kevin_decision_3_{{ app.id }}"
{% if app.kevin_decision == 3 %}checked{% endif %}>
<label for="kevin_decision_3_{{ app.id }}">3</label><br/>
<input type="radio" name="decision" value="4" id="kevin_decision_4_{{ app.id }}"
{% if app.kevin_decision == 4 %}checked{% endif %}>
<label for="kevin_decision_4_{{ app.id }}">4</label><br/>
<input type="radio" name="decision" value="5" id="kevin_decision_5_{{ app.id }}"
{% if app.kevin_decision == 5 %}checked{% endif %}>
<label for="kevin_decision_5_{{ app.id }}">5</label>
<textarea name="comments">{{ app.kevin_comments }}</textarea>
<p class="ajaxFired"></p>
</form>
</td>
<td class="kingston editor">
{% if app.kingston_decision == -2 %}
<span class="label round alert text-center">Highly Reject</span>
{% elif app.kingston_decision == -1 %}
<span class="label round alert text-center">Reject</span>
{% elif app.kingston_decision == 0 %}
<span class="label round secondary text-center">Unsure</span>
{% if app.kingston_decision == 0 %}
<span class="label round secondary text-center">0</span>
{% elif app.kingston_decision == 1 %}
<span class="label round success text-center">Accept</span>
<span class="label round alert text-center">1</span>
{% elif app.kingston_decision == 2 %}
<span class="label round success text-center">Highly Accept</span>
<span class="label round alert text-center">2</span>
{% elif app.kingston_decision == 3 %}
<span class="label round text-center">3</span>
{% elif app.kingston_decision == 4 %}
<span class="label round success text-center">4</span>
{% elif app.kingston_decision == 5 %}
<span class="label round success text-center">5</span>
{% endif %}

<form action="{% url submit_review %}" class="expanded hidden" method="POST"> {% csrf_token %}
<input type="hidden" name="application" value="{{ app.id }}" />
<input type="hidden" name="editor" value="kingston" />
<input type="radio" name="decision" value="-2" id="kingston_decision_-2_{{ app.id }}"
{% if app.kingston_decision == -2 %}checked{% endif %}>
<label for="kingston_decision_-2_{{ app.id }}">Highly Reject</label><br/>
<input type="radio" name="decision" value="-1" id="kingston_decision_-1_{{ app.id }}"
{% if app.kingston_decision == -1 %}checked{% endif %}>
<label for="kingston_decision_-1_{{ app.id }}">Reject</label><br/>
<input type="radio" name="decision" value="0" id="kingston_decision_0_{{ app.id }}"
{% if app.kingston_decision == 0 %}checked{% endif %}>
<label for="kingston_decision_0_{{ app.id }}">Unsure</label><br/>
<label for="kingston_decision_0_{{ app.id }}">0</label><br/>
<input type="radio" name="decision" value="1" id="kingston_decision_1_{{ app.id }}"
{% if app.kingston_decision == 1 %}checked{% endif %}>
<label for="kingston_decision_1_{{ app.id }}">Accept</label><br/>
<label for="kingston_decision_1_{{ app.id }}">1</label><br/>
<input type="radio" name="decision" value="2" id="kingston_decision_2_{{ app.id }}"
{% if app.kingston_decision == 2 %}checked{% endif %}>
<label for="kingston_decision_2_{{ app.id }}">Highly Accept</label>
<label for="kingston_decision_2_{{ app.id }}">2</label><br/>
<input type="radio" name="decision" value="3" id="kingston_decision_3_{{ app.id }}"
{% if app.kingston_decision == 3 %}checked{% endif %}>
<label for="kingston_decision_3_{{ app.id }}">3</label><br/>
<input type="radio" name="decision" value="4" id="kingston_decision_4_{{ app.id }}"
{% if app.kingston_decision == 4 %}checked{% endif %}>
<label for="kingston_decision_4_{{ app.id }}">4</label><br/>
<input type="radio" name="decision" value="5" id="kingston_decision_5_{{ app.id }}"
{% if app.kingston_decision == 5 %}checked{% endif %}>
<label for="kingston_decision_5_{{ app.id }}">5</label>
<textarea name="comments">{{ app.kingston_comments }}</textarea>
<p class="ajaxFired"></p>
</form>
Expand Down Expand Up @@ -331,16 +346,18 @@ <h4>{{ app.application.name }}</h4>
data: self.parent().serialize(),
success: function(data) {
span.removeClass('secondary alert success');
if (data['decision'] == -2) {
span.addClass('alert').text('Highly Reject');
} else if (data['decision'] == -1) {
span.addClass('alert').text('Reject');
} else if (data['decision'] == 0) {
span.addClass('secondary').text('Unsure');
if (data['decision'] == 0) {
span.addClass('secondary').text('0');
} else if (data['decision'] == 1) {
span.addClass('success').text('Accept');
span.addClass('alert').text('1');
} else if (data['decision'] == 2) {
span.addClass('success').text('Highly Accept');
span.addClass('alert').text('2');
} else if (data['decision'] == 3) {
span.text('3');
} else if (data['decision'] == 4) {
span.addClass('success').text('4');
} else if (data['decision'] == 5) {
span.addClass('success').text('5');
}
status.text('Saved');
total.text(data['total']);
Expand Down

0 comments on commit 377c83e

Please sign in to comment.