equal
deleted
inserted
replaced
50 review_context['district'] = project.district |
50 review_context['district'] = project.district |
51 review_context['line_item'] = project.line_item |
51 review_context['line_item'] = project.line_item |
52 |
52 |
53 return review_context |
53 return review_context |
54 |
54 |
|
55 @register.inclusion_tag('projrev/templatetags/_as_star_for_score.html', |
|
56 takes_context=True) |
|
57 def as_star_for_score(context, name): |
|
58 """ |
|
59 """ |
|
60 context['name'] = name |
|
61 if 'prev_data' in context and name in context['prev_data']: |
|
62 context['value'] = context['prev_data'][name] |
|
63 else: |
|
64 context['value'] = 0 |
|
65 |
|
66 return context |
|
67 |
55 @register.filter() |
68 @register.filter() |
56 def serial_no(project, arg): |
69 def serial_no(project, arg): |
57 """Returns the latest serial number of the project's proposal |
70 """Returns the latest serial number of the project's proposal |
58 """ |
71 """ |
59 |
72 |
60 proposals = project.proposal_set.all().order_by('-submitted_on') |
73 proposals = project.proposal_set.all().order_by('-submitted_on') |
61 import logging |
74 |
62 logging.error(proposals) |
|
63 if proposals: |
75 if proposals: |
64 if arg == 'new': |
76 if arg == 'new': |
65 proposal = proposals[0] |
77 proposal = proposals[0] |
66 elif arg == 'old': |
78 elif arg == 'old': |
67 if len(proposals) > 1: |
79 if len(proposals) > 1: |