diff --git a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_AI.py b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_AI.py index 29a495bd..916380fe 100644 --- a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_AI.py +++ b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_AI.py @@ -71,6 +71,7 @@ def html_letter(self): stamp = self.stamp content = { + "resultTitle": "ALL ISLAND RESULT", "election": { "electionName": self.submission.election.get_official_name(), }, @@ -100,7 +101,7 @@ def html_letter(self): content["logo"] = convert_image_to_data_uri("static/Emblem_of_Sri_Lanka.png") html = render_template( - 'PRE-34-AI-LETTER.html', + 'PRE_34_ALL_ISLAND_RESULTS.html', content=content ) diff --git a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_ED.py b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_ED.py index 9a3bfd87..0f7ef72d 100644 --- a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_ED.py +++ b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_ED.py @@ -70,7 +70,9 @@ def content(self): def html_letter(self): stamp = self.stamp + electoralDistrict = self.submission.area content = { + "resultTitle": "Results of Electoral District %s" % electoralDistrict.areaName, "election": { "electionName": self.submission.election.get_official_name() }, @@ -98,7 +100,7 @@ def html_letter(self): content["logo"] = convert_image_to_data_uri("static/Emblem_of_Sri_Lanka.png") html = render_template( - 'PRE-34-ED-LETTER.html', + 'PRE_34_ALL_ISLAND_RESULTS.html', content=content ) diff --git a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_PD.py b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_PD.py index e611f657..c5b46275 100644 --- a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_PD.py +++ b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_34_PD.py @@ -73,8 +73,11 @@ def html_letter(self): stamp = self.stamp total_registered_voters = get_polling_division_total_registered_voters(tallySheetVersion=self) + electoral_district = Area.get_associated_areas(self.submission.area, AreaTypeEnum.ElectoralDistrict)[0] + polling_division = self.submission.area content = { + "resultTitle": "Results of PD", "election": { "electionName": self.submission.election.get_official_name(), "isPostal": self.submission.election.voteType == VoteTypeEnum.Postal @@ -100,12 +103,23 @@ def html_letter(self): "pollingDivision": self.submission.area.areaName } + if self.submission.election.voteType == VoteTypeEnum.Postal: + content["tallySheetCode"] = "PRE/34/PV" + content["pollingDivision"] = "Postal" + content["resultTitle"] = "Results of Electoral District %s (Postal)" % electoral_district.areaName + else: + content["pollingDivision"] = self.submission.area.areaName + content["resultTitle"] = "Results of Electoral District %s - Polling Division %s" % ( + electoral_district.areaName, + polling_division.areaName + ) + content["data"], total_valid_vote_count = TallySheetVersion.create_candidate_preference_struct(self.content) content["logo"] = convert_image_to_data_uri("static/Emblem_of_Sri_Lanka.png") html = render_template( - 'PRE-34-PD-LETTER.html', + 'PRE_34_ALL_ISLAND_RESULTS.html', content=content ) diff --git a/templates/PRE_34_ALL_ISLAND_RESULTS.html b/templates/PRE_34_ALL_ISLAND_RESULTS.html new file mode 100644 index 00000000..45f906b4 --- /dev/null +++ b/templates/PRE_34_ALL_ISLAND_RESULTS.html @@ -0,0 +1,255 @@ +{% extends 'base.html' %} + +{% block container %} +{% for pageNumber in [1,2,3,4] %} + +
OFFICIAL RESULTS | ++ DEPARTMENT OF ELECTIONS + + {{content.election.electionName}} + + {{content.resultTitle}} + VOTES RECEIVED BY EACH CANDIDATE + | ++ |
+ + | +
# | +Name of the Candidate | +Vote Count | +Second Preference Count | +Third Preference Count | +Grand Total | +
---|---|---|---|---|---|
{{loop.index}} | +{{row.name}} | +{{row.firstPreferenceCount}} | +{{row.secondPreferenceCount}} | +{{row.thirdPreferenceCount}} | +{{ row.total }} | +
+ | |||||
+ | + | + | Total Valid Votes | ++ {{content.validVoteCounts[0]}} + | ++ {{content.validVoteCounts[1]}} + | +
+ | + | + | Rejected Votes | ++ {{content.rejectedVoteCounts[0]}} + | ++ {{content.rejectedVoteCounts[1]}} + | +
+ | + | + | Total Polled | ++ {{content.totalVoteCounts[0]}} + | ++ {{content.totalVoteCounts[1]}} + | +
+ | + | + | Registered No. of Electors | +{{content.registeredVoters[0]}} | ++ |
+ | + | + | Time | +{{content.time}} | +|
+ | + | + | Date | +{{content.date}} | +
+ .................................... + MAHINDA DESHAPRIYA + Chairman + Election Commission + | + {% endif %} + {% if pageNumber in [1,2] %} ++ .................................... + N. J. ABEYESEKERE + Member + Election Commission + | + {% endif %} + {% if pageNumber in [1,3] %} ++ .................................... + S. RATNAJEEVAN H. HOOLE + Member + Election Commission + | + {% endif %} +
+ +{% endfor %} +{% endblock %} diff --git a/templates/PRE_ALL_ISLAND_RESULTS.html b/templates/PRE_ALL_ISLAND_RESULTS.html index ece9ae4c..449d435f 100644 --- a/templates/PRE_ALL_ISLAND_RESULTS.html +++ b/templates/PRE_ALL_ISLAND_RESULTS.html @@ -241,5 +241,6 @@ Election Secretariat, Sarana Mawatha, Rajagiriya. +
{% endfor %} {% endblock %}