# HG changeset patch # User Madhusudan.C.S # Date 1249846232 -19800 # Node ID 97bd3c28c9579a14fecdcd960372394640da8439 # Parent a6a5e45f68c8bc2ee59213789bd84cfe1a7b01d1 Renamed Comments to Reviews. diff -r a6a5e45f68c8 -r 97bd3c28c957 app/projrev/models.py --- a/app/projrev/models.py Mon Aug 10 00:40:47 2009 +0530 +++ b/app/projrev/models.py Mon Aug 10 01:00:32 2009 +0530 @@ -849,7 +849,7 @@ reviewer = models.ForeignKey(User, null=True) #: Field containing the date and time of review of the proposal. - reviewed_on = models.DateTimeField(auto_now_add=True) + reviewed_on = models.DateTimeField(auto_now=True) #: Field containing the review value for this attribute. attribute1 = models.PositiveSmallIntegerField( diff -r a6a5e45f68c8 -r 97bd3c28c957 app/projrev/views/helpers/forms.py --- a/app/projrev/views/helpers/forms.py Mon Aug 10 00:40:47 2009 +0530 +++ b/app/projrev/views/helpers/forms.py Mon Aug 10 01:00:32 2009 +0530 @@ -8,6 +8,7 @@ from django import forms +from django.contrib.auth.models import User from projrev.models import Project from projrev.models import Review @@ -36,9 +37,10 @@ project = forms.ModelChoiceField(queryset=Project.objects.all(), widget=forms.HiddenInput(), required=False) + reviewer = forms.ModelChoiceField(queryset=User.objects.all(), + widget=forms.HiddenInput(), + required=False) class Meta: # Create a form from Review data model. model = Review - - exclude = ('reviewer') diff -r a6a5e45f68c8 -r 97bd3c28c957 app/projrev/views/helpers/templatetags/comments_helpers.py --- a/app/projrev/views/helpers/templatetags/comments_helpers.py Mon Aug 10 00:40:47 2009 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -"""A Django template tag library containing forms helpers. -""" - -__authors__ = [ - '"Madhusudan.C.S" ', -] - - -from django import template - -register = template.Library() - - -@register.inclusion_tag('projrev/templatetags/_as_comment.html') -def as_comment(user): - """Prints a user as a hyperlinked link_id. - """ - - return {'user': user} diff -r a6a5e45f68c8 -r 97bd3c28c957 app/projrev/views/helpers/templatetags/review_helpers.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/helpers/templatetags/review_helpers.py Mon Aug 10 01:00:32 2009 +0530 @@ -0,0 +1,19 @@ +"""A Django template tag library containing forms helpers. +""" + +__authors__ = [ + '"Madhusudan.C.S" ', +] + + +from django import template + +register = template.Library() + + +@register.inclusion_tag('projrev/templatetags/_as_comment.html') +def as_comment(review): + """Returns the comment contexts for the template tag. + """ + + return {'comment_entity': review} diff -r a6a5e45f68c8 -r 97bd3c28c957 app/projrev/views/proposal.py --- a/app/projrev/views/proposal.py Mon Aug 10 00:40:47 2009 +0530 +++ b/app/projrev/views/proposal.py Mon Aug 10 01:00:32 2009 +0530 @@ -245,6 +245,7 @@ cleaned_data = rev_form.cleaned_data cleaned_data['project'] = Project.objects.get(micr_code=micr_code) + cleaned_data['reviewer'] = request.user # If the form is valid create a new project or update the project # if it already exists from the form. diff -r a6a5e45f68c8 -r 97bd3c28c957 app/templates/projrev/proposal/review.html --- a/app/templates/projrev/proposal/review.html Mon Aug 10 00:40:47 2009 +0530 +++ b/app/templates/projrev/proposal/review.html Mon Aug 10 01:00:32 2009 +0530 @@ -81,6 +81,10 @@ {% endif %}

- + {% if reviews %} + {% for review in reviews %} + {% as_review review %} + {% endfor %} + {% endif %} {% endblock content %} \ No newline at end of file diff -r a6a5e45f68c8 -r 97bd3c28c957 app/templates/projrev/templatetags/_as_comment.html --- a/app/templates/projrev/templatetags/_as_comment.html Mon Aug 10 00:40:47 2009 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -
-
- On {{ comment.created_on|date:"jS F Y H:i" }}, - by - {% if comment.created_by %} - {{ comment.created_by.name }}: - {% else %} - {{ site_name }} Automatic Updater: - {% endif %} - - - -
-
-

- {% if comment.content %} - {{ comment.content|safe }}

- {% else %} - (No Comment was entered for this change.) - {% endif %} -
- {% if comment.changes %} -
-
- Changes: - {{ comment.changes|join:"; " }} -
-
- {% endif %} -
-
\ No newline at end of file diff -r a6a5e45f68c8 -r 97bd3c28c957 app/templates/projrev/templatetags/_as_review.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/templatetags/_as_review.html Mon Aug 10 01:00:32 2009 +0530 @@ -0,0 +1,31 @@ +
+
+ On {{ comment.created_on|date:"jS F Y H:i" }}, + by + {% if comment.created_by %} + {{ comment.created_by.name }}: + {% else %} + {{ site_name }} Automatic Updater: + {% endif %} + + + +
+
+

+ {% if comment.content %} + {{ comment.content|safe }}

+ {% else %} + (No Comment was entered for this change.) + {% endif %} +
+ {% if comment.changes %} +
+
+ Changes: + {{ comment.changes|join:"; " }} +
+
+ {% endif %} +
+
\ No newline at end of file