opportunity: count entries in JavaScript on load
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 21 Oct 2015 17:23:36 +0000 (13:23 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 21 Oct 2015 22:33:48 +0000 (18:33 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/opportunity/src/templates/meetup.nit

index 043c86b..ccb432a 100644 (file)
@@ -276,6 +276,8 @@ class OpportunityMeetupPage
                window.onload = function () {
                        var name_field = document.getElementById("new_name");
                        name_field.value = get_cookie("opportunity_participant_name");
+
+                       update_scores();
                }
                """
        end
@@ -387,13 +389,9 @@ redef class Meetup
 <tr id="total">
        <th>Total ({{{participants(db).length}}})</th>
                """
-               for i in answers(db) do
-                       t.add """<th id="total{{{i.id}}}"><center>{{{i.count(db)}}}"""
-                       if scores.has_key(i.id) and scores[i.id] >= maxsc then
-                               t.add """<br/><span style="color:blue">★</span>"""
-                       end
-                       t.add "</center></th>"
-               end
+               for i in answers(db) do t.add """
+               <th id="total{{{i.id}}}"><center></center></th>
+"""
                t.add "</th>"
                t.add """
                <th></th>