Skip to content

Commit

Permalink
style: add padding to the attributes of inner tags of table (#4343)
Browse files Browse the repository at this point in the history
* style: add padding to the attributes of inner attrbute of table

* test: add testcases related to changes

* style: add paddings to header section as well

* feat: update template
  • Loading branch information
AfaqShuaib09 authored Apr 30, 2024
1 parent a9fc13e commit 8c36f85
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,51 +50,51 @@ <h3>New Products</h3>
{% if product_type != "DEGREES" %}
<table border="2" style="padding: 5px;">
<tr>
<th>
<th style="padding: 5px;">
Course UUID
</th>
<th>
<th style="padding: 5px;">
URL Slug
</th>
<th>
<th style="padding: 5px;">
External Course Marketing Type
</th>
<th>
<th style="padding: 5px;">
Variant ID
</th>
<th>
<th style="padding: 5px;">
Restriction Type
</th>
<th>
<th style="padding: 5px;">
Rerun
</th>
</tr>
{% endif %}
{% for new_product in created_products %}
{% if product_type != "DEGREES" %}
<tr>
<td>
<td style="padding: 5px;">
<a href='{{publisher_url}}courses/{{new_product.uuid}}'>{{ new_product.uuid }}</a>
</td>
<td>
<td style="padding: 5px;">
{{ new_product.url_slug}}
</td>
<td>
<td style="padding: 5px;">
{% if new_product.external_course_marketing_type %}
{{ new_product.external_course_marketing_type }}
{% endif %}
</td>
<td>
<td style="padding: 5px;">
{% if new_product.course_run_variant_id %}
{{ new_product.course_run_variant_id }}
{% endif %}
</td>
<td>
<td style="padding: 5px;">
{% if new_product.restriction_type %}
{{ new_product.restriction_type }}
{% endif %}
</td>
<td>
<td style="padding: 5px;">
{% if new_product.rerun %}
Yes
{% else %}
Expand Down
12 changes: 6 additions & 6 deletions course_discovery/apps/course_metadata/tests/test_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ def test_email_new_products(self):
"<tr><th>New Products</th><td> 1 </td></tr>",
"<tr><th>Updated Products</th><td> 0 </td></tr>",
"<h3>New Products</h3>",
"<tr><th>Course UUID</th><th>URL Slug</th><th>External Course Marketing Type</th><th>Variant ID</th><th>Restriction Type</th><th>Rerun</th></tr>",
f"<tr><td><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td>{url_slug}</td><td></td><td>{variant_id}</td><td>None</td><td>Yes</td></tr>",
"<tr><th style='padding: 5px;'>Course UUID</th><th style='padding: 5px;'>URL Slug</th><th style='padding: 5px;'>External Course Marketing Type</th><th style='padding: 5px;'>Variant ID</th><th style='padding: 5px;'>Restriction Type</th><th style='padding: 5px;'>Rerun</th></tr>",
f"<tr><td style='padding: 5px;'><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td style='padding: 5px;'>{url_slug}</td><td style='padding: 5px;'></td><td style='padding: 5px;'>{variant_id}</td><td style='padding: 5px;'>None</td><td style='padding: 5px;'>Yes</td></tr>",
]
)
# pylint: enable=line-too-long
Expand Down Expand Up @@ -639,10 +639,10 @@ def test_email_new_exec_ed_products(self):
"<tr><th>New Products</th><td> 3 </td></tr>",
"<tr><th>Updated Products</th><td> 0 </td></tr>",
"<h3>New Products</h3>",
"<tr><th>Course UUID</th><th>URL Slug</th><th>External Course Marketing Type</th><th>Variant ID</th><th>Restriction Type</th><th>Rerun</th></tr>",
f"<tr><td><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td>{url_slug}</td><td>sprint</td><td></td><td></td><td>Yes</td></tr>",
f"<tr><td><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td>{url_slug}</td><td>course_stack</td><td></td><td></td><td>Yes</td></tr>",
f"<tr><td><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td>{url_slug}</td><td>short_course</td><td></td><td></td><td>Yes</td></tr>",
"<tr><th style='padding: 5px;'>Course UUID</th><th style='padding: 5px;'>URL Slug</th><th style='padding: 5px;'>External Course Marketing Type</th><th style='padding: 5px;'>Variant ID</th><th style='padding: 5px;'>Restriction Type</th><th style='padding: 5px;'>Rerun</th></tr>",
f"<tr><td style='padding: 5px;'><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td style='padding: 5px;'>{url_slug}</td><td style='padding: 5px;'>sprint</td><td style='padding: 5px;'></td><td style='padding: 5px;'></td><td style='padding: 5px;'>Yes</td></tr>",
f"<tr><td style='padding: 5px;'><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td style='padding: 5px;'>{url_slug}</td><td style='padding: 5px;'>course_stack</td><td style='padding: 5px;'></td><td style='padding: 5px;'></td><td style='padding: 5px;'>Yes</td></tr>",
f"<tr><td style='padding: 5px;'><a href='{self.partner.publisher_url}courses/{uuid}'>{uuid}</a></td><td style='padding: 5px;'>{url_slug}</td><td style='padding: 5px;'>short_course</td><td style='padding: 5px;'></td><td style='padding: 5px;'></td><td style='padding: 5px;'>Yes</td></tr>",
]
)
# pylint: enable=line-too-long
Expand Down

0 comments on commit 8c36f85

Please sign in to comment.