From a003cfc6fec753408d067cd1769d64ee44ea9613 Mon Sep 17 00:00:00 2001 From: "Ivan R. Judson" Date: Wed, 7 Aug 2013 17:09:53 -0700 Subject: [PATCH] Working on phases. --- .../templates/web/competitions/_results.html | 22 +++++++------- .../web/competitions/_submit_results.html | 30 ++++++++++--------- codalab/apps/web/templatetags/codalab.py | 9 ++++-- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/codalab/apps/web/templates/web/competitions/_results.html b/codalab/apps/web/templates/web/competitions/_results.html index 14cbc20a8..e43a8e42b 100644 --- a/codalab/apps/web/templates/web/competitions/_results.html +++ b/codalab/apps/web/templates/web/competitions/_results.html @@ -1,14 +1,13 @@ -
-
-
-
- Phase 1 -
-
- Phase 2 -
-
-
+
+
+ {% for phase in competition.phases.all %} + {% if not phase.is_active %} + + {% else %} + + {% endif %} + {% endfor %} +
@@ -25,6 +24,7 @@ + 1 guest2 diff --git a/codalab/apps/web/templates/web/competitions/_submit_results.html b/codalab/apps/web/templates/web/competitions/_submit_results.html index e0184b17f..9bc3e6192 100644 --- a/codalab/apps/web/templates/web/competitions/_submit_results.html +++ b/codalab/apps/web/templates/web/competitions/_submit_results.html @@ -1,23 +1,25 @@ {% load codalab %} -
-
-
-
- Phase 1 -
-
- Phase 2 -
-
-
-
- -

Submit a new result set or view your previous submissions.

+
+
+ {% for phase in competition.phases.all %} + {% if not phase.is_active %} + + {% else %} + + {% endif %} + {% endfor %} +
+
+
Submit a new result set or view your previous submissions.

+
+
+
diff --git a/codalab/apps/web/templatetags/codalab.py b/codalab/apps/web/templatetags/codalab.py index 64bbf5e7f..28515a5b4 100644 --- a/codalab/apps/web/templatetags/codalab.py +++ b/codalab/apps/web/templatetags/codalab.py @@ -1,10 +1,13 @@ import os - from django import template - register = template.Library() @register.filter def filename(value): - return os.path.basename(value.file.name) \ No newline at end of file + return os.path.basename(value.file.name) + +# by mikeivanov (on April 16, 2007) +@register.filter +def in_list(value,arg): + return value in arg \ No newline at end of file