Index: templates/product-home.tmpl |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/templates/product-home.tmpl |
@@ -0,0 +1,58 @@ |
+{% extends "templates/default" %} |
+ |
+{% block body %} |
+<main id="main" class="wrapper"> |
+ <h1 class="h1 section ta-center"> |
juliandoucette
2017/09/12 13:21:58
NIT: I think it's confusing to add a class named "
ire
2017/09/19 10:27:21
Okay, I like the .product-heading way. Done.
|
+ <img class="heading-icon" src="/img/png/logo-{{product_id}}.png" srcset="/img/svg/logo-{{product_id}}.svg 2x" alt="{{ products[product_id].full_name+" Logo" | translate( product_id+"-logo-alt", "Image alt text") }}"> |
juliandoucette
2017/09/12 13:21:59
NIT: I prefer string interpolation in python e.g.
ire
2017/09/19 10:27:22
I actually find it more confusing, particularly be
juliandoucette
2017/09/22 13:29:36
Acknowledged.
Please fix the spacing then.
|
+ |
+ {{ products[product_id].full_name + " Help Center" | translate(product_id+"-help-home-title", "Page title") }} |
juliandoucette
2017/09/12 13:21:58
NIT: I suggest you {% set product = products[produ
ire
2017/09/19 10:27:20
Good idea. Done.
|
+ </h1> |
+ |
+ {% set popular_topics = get_pages_metadata({ "product_id": product_id, "template": "article", "popular": "true" }) %} |
+ {% if popular_topics %} |
+ <section class="card {{product_id}}-card section"> |
+ <h2 class="h4 card-heading"> |
juliandoucette
2017/09/12 13:21:59
NIT: If all cards of the same type have the same f
ire
2017/09/19 10:27:22
Done.
|
+ <img class="heading-icon" src="/img/png/popular-icon.png" srcset="/img/svg/popular-icon.svg 2x" alt="{{ "Popular Icon" | translate("popular-icon-alt", "Image alt text") }}"> |
+ |
+ {{ "Popular Topics" | translate("popular-topics-title", "Section title") }} |
+ </h2> |
+ |
+ <ul class="underlined-list row"> |
juliandoucette
2017/09/12 13:21:59
Note: Clever use of row and columns here :)
ire
2017/09/19 10:27:20
Thanks :)
|
+ {% for article in popular_topics %} |
+ <li class="column one-half"> |
+ <a href="{{article["page"]}}"> |
juliandoucette
2017/09/12 13:21:59
NIT: Inconsistent use of space in {{ }}
|
+ {{ article.title | translate( get_page_slug( article["page"]) + "-title", "Article title") }} |
+ </a> |
+ </li> |
+ {% endfor %} |
+ </ul> |
+ </section> |
+ {% endif %} |
+ |
+ <div class="row"> |
+ {% for category in products[product_id].help_categories %} |
+ {% set articles = get_pages_metadata({ "product_id": product_id, "template": "article", "category": category.name }) %} |
juliandoucette
2017/09/12 13:21:58
NIT: I think that it's unnecessary to test against
ire
2017/09/19 10:27:22
Done.
|
+ {% if articles and category.name != 'Popular Topics' %} |
+ <section class="section column one-half"> |
juliandoucette
2017/09/12 13:21:58
Note: If you agree with my comment above about man
ire
2017/09/19 10:27:20
I agree about the font-size, but in the case it is
juliandoucette
2017/09/22 13:29:36
Acknowledged.
|
+ <h2 class="h4"> |
+ <img class="heading-icon" src="/img/png/{{category.icon}}.png" srcset="/img/svg/{{category.icon}}.svg 2x" alt="{{ category.name+" Icon" | translate(category.icon+"-alt", "Image alt text") }}"> |
+ |
+ {{category.name | translate( category.slug + "-category-title", "Category title")}} |
+ </h2> |
+ |
+ <ul class="underlined-list"> |
+ {% for article in articles %} |
+ <li> |
+ <a href="{{article["page"]}}"> |
+ {{ article.title | translate( get_page_slug( article["page"]) + "-title", "Article title") }} |
+ </a> |
+ </li> |
+ {% endfor %} |
+ </ul> |
+ </section> |
+ {% endif %} |
+ {% endfor %} |
+ </div> |
+ |
+</main> |
+{% endblock %} |