diff --git a/qiita_pet/handlers/study_handlers/prep_template.py b/qiita_pet/handlers/study_handlers/prep_template.py index 78bc6dade..401c72986 100644 --- a/qiita_pet/handlers/study_handlers/prep_template.py +++ b/qiita_pet/handlers/study_handlers/prep_template.py @@ -48,7 +48,8 @@ def get(self): res = prep_template_summary_get_req(prep_id, self.current_user.id) self.render('study_ajax/prep_summary_table.html', pid=prep_id, - stats=res['summary'], editable=res['editable']) + stats=res['summary'], editable=res['editable'], + num_samples=res['num_samples']) class PrepTemplateAJAX(BaseHandler): diff --git a/qiita_pet/templates/study_ajax/prep_summary_table.html b/qiita_pet/templates/study_ajax/prep_summary_table.html index 024dafb57..cb8c19ee6 100644 --- a/qiita_pet/templates/study_ajax/prep_summary_table.html +++ b/qiita_pet/templates/study_ajax/prep_summary_table.html @@ -4,39 +4,45 @@ }); - -{% from future.utils import viewitems %}
Information summary
+ {% for i, (category, summary) in enumerate(stats, -1) %} - {% if len(summary) == 1 %} - - {% elif len(set([row[1] for row in summary])) == 1 %} - {% else %} - - {% for row in summary %} - - - - - + {% if len(summary) == 1 %} + {{category}}: {{summary[0][0]}} is repeated in all rows. + + {% elif len(summary) == num_samples %} + {{category}}: All the values in this category are different. + + {% else %} + {{category}} +      + + + {% for row in summary %} + + + + + + {% end %} {% end %} - {% end %} {% end %}
- - - {{category}}: {{summary[0][0]}} is repeated in all rows. + {% if editable %} + + {% else %} +   + {% end %} - {{category}}: All the values in this category are different. - {{category}}
 {{row[0]}}{{row[1]}}
 {{row[0]}}{{row[1]}}
+