Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nutrition Facts Table templatization #3631

Merged
merged 16 commits into from
Jun 25, 2020
Merged

Conversation

areeshatariq
Copy link
Contributor

Description:

HTML Template has been created for Nutrition Facts Table using Template::Toolkit

Related issues and discussion: #2416

@stephanegigandet stephanegigandet changed the title Nutrition Facts Table Nutrition Facts Table templatization Jun 15, 2020
@stephanegigandet
Copy link
Contributor

@Ban3 @CharlesNepote @hangy @VaiTon : @areeshatariq has templatized the nutrition facts table, it would be great to have your feedback. Thank you!


[% FOREACH comparison IN comparisons %]
<label style="display:inline;font-size:1rem;">
<input type="checkbox" id="[% comparison.col_id %]" name="[% comparison.col_id %]" value="on" [% IF comparison.checked %]checked="checked"[% END %] class="show_comparison"> [% comparison.name %]</label>
Copy link
Member

@CharlesNepote CharlesNepote Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is not consistent: sometimes <space>, sometimes <tab>.
Also, here <label></label> is not correctly indented and "balanced".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VaiTon @CharlesNepote what's the recommended way? Making all these suggested changes in a single commit OR directly clicking 'Commit suggestion' for every suggested change?

Personally, I'd batch them and add them in one commit. Especially with some simple whitespace changes, I don't see a huge value in having separate commits.

Copy link
Member

@VaiTon VaiTon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

lib/ProductOpener/Display.pm Outdated Show resolved Hide resolved
lib/ProductOpener/Display.pm Outdated Show resolved Hide resolved
lib/ProductOpener/Display.pm Outdated Show resolved Hide resolved
templates/nutrition_facts_table.tt.html Show resolved Hide resolved
templates/nutrition_facts_table.tt.html Outdated Show resolved Hide resolved
Comment on lines 18 to 24
<br>
<input type="radio" id="nutrition_data_compare_percent" value="compare_percent" name="nutrition_data_compare_type" checked>
<label for="nutrition_data_compare_percent">[% lang('nutrition_data_compare_percent') %]</label>
<input type="radio" id="nutrition_data_compare_value" value="compare_value" name="nutrition_data_compare_type">
<label for="nutrition_data_compare_value">[% lang('nutrition_data_compare_value') %]</label>

<p class="note">&rarr; [% lang('nutrition_data_comparison_with_categories_note') %]</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<br>
<input type="radio" id="nutrition_data_compare_percent" value="compare_percent" name="nutrition_data_compare_type" checked>
<label for="nutrition_data_compare_percent">[% lang('nutrition_data_compare_percent') %]</label>
<input type="radio" id="nutrition_data_compare_value" value="compare_value" name="nutrition_data_compare_type">
<label for="nutrition_data_compare_value">[% lang('nutrition_data_compare_value') %]</label>
<p class="note">&rarr; [% lang('nutrition_data_comparison_with_categories_note') %]</p>
<br>
<input type="radio" id="nutrition_data_compare_percent" value="compare_percent" name="nutrition_data_compare_type" checked>
<label for="nutrition_data_compare_percent">[% lang('nutrition_data_compare_percent') %]</label>
<input type="radio" id="nutrition_data_compare_value" value="compare_value" name="nutrition_data_compare_type">
<label for="nutrition_data_compare_value">[% lang('nutrition_data_compare_value') %]</label>
<p class="note">&rarr; [% lang('nutrition_data_comparison_with_categories_note') %]</p>

lib/ProductOpener/Display.pm Outdated Show resolved Hide resolved

[% FOREACH comparison IN comparisons %]
<label style="display:inline;font-size:1rem;">
<input type="checkbox" id="[% comparison.col_id %]" name="[% comparison.col_id %]" value="on" [% IF comparison.checked %]checked="checked"[% END %] class="show_comparison"> [% comparison.name %]</label>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VaiTon @CharlesNepote what's the recommended way? Making all these suggested changes in a single commit OR directly clicking 'Commit suggestion' for every suggested change?

Personally, I'd batch them and add them in one commit. Especially with some simple whitespace changes, I don't see a huge value in having separate commits.

@teolemon teolemon added the Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. label Jun 19, 2020
@VaiTon VaiTon requested a review from hangy June 22, 2020 12:41
Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!

@stephanegigandet stephanegigandet merged commit e031c8d into master Jun 25, 2020
@stephanegigandet stephanegigandet deleted the nutrition-table-wip branch June 25, 2020 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants