Smarter feedback index
authorChris Ellis <chris@intrbiz.com>
Tue, 22 Oct 2024 11:42:47 +0000 (14:42 +0300)
committerChris Ellis <chris@intrbiz.com>
Tue, 22 Oct 2024 11:42:47 +0000 (14:42 +0300)
templates/confreg/feedback_index.html

index 624680a653780b895a69601a666d44f2886c0422..8927fa23c37d4ecf8a0237cc5d9a31e8fd9b6a76 100644 (file)
         {%endif%}
     </div>
 
+    {%set got_feedback = sessions | selectattr("has_given_feedback") %}
+    {%set need_feedback = sessions | selectattr("has_given_feedback", "false") %}
+
+    {% if got_feedback | length > 0 %}
     <div class="card">
-        <h4>Session Feedback</h4>
+        <h4>Session Needing Feedback</h4>
         <p>
             It really helps us and speakers if you provide feedback for the sessions you attended.
         </p>
-        {%for d, sessions in sessions|groupby('date') %}
+        {%for d, sessions in need_feedback|groupby('date') %}
           {%if loop.length > 1 %}<h3>{{d}}</h3>{%endif%}
           <ul class="feedback-sessions">
             {% for s in sessions %}
           </ul>
         {%endfor%}
     </div>
+    {% endif %}
+    
+    {% if got_feedback | length > 0 %}
+    <div class="card">
+        <h4>Session Having Feedback</h4>
+        <p>
+            You've given feedback on the following session, thank you very much.
+        </p>
+        {%for d, sessions in got_feedback|groupby('date') %}
+        {%if loop.length > 1 %}<h3>{{d}}</h3>{%endif%}
+        <ul class="feedback-sessions">
+            {% for s in sessions %}
+            <li class="{%if s.has_given_feedback%}feedback-left{%endif%}">
+                <a href="{{s.id}}/">{{s.title}} ({{s.speaker_list}}){%if s.has_given_feedback%}<strong> - Feedback Given</strong>{%endif%}</a>
+            </li>
+            {%endfor%}
+        </ul>
+        {%endfor%}
+    </div>
+    {% endif %}
     
 </div>
 {%endblock%}