File tree Expand file tree Collapse file tree 6 files changed +15
-7
lines changed
Expand file tree Collapse file tree 6 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -458,6 +458,7 @@ class CompetitionSerializerSimple(serializers.ModelSerializer):
458458 created_by = serializers .CharField (source = 'created_by.username' , read_only = True )
459459 owner_display_name = serializers .SerializerMethodField ()
460460 participants_count = serializers .IntegerField (read_only = True )
461+ first_phase_start = serializers .DateTimeField (read_only = True )
461462
462463 class Meta :
463464 model = Competition
@@ -467,6 +468,7 @@ class Meta:
467468 'created_by' ,
468469 'owner_display_name' ,
469470 'created_when' ,
471+ 'first_phase_start' ,
470472 'published' ,
471473 'participants_count' ,
472474 'logo' ,
@@ -477,8 +479,7 @@ class Meta:
477479 'contact_email' ,
478480 'report' ,
479481 'is_featured' ,
480- 'submissions_count' ,
481- 'participants_count'
482+ 'submissions_count'
482483 )
483484
484485 def get_created_by (self , obj ):
Original file line number Diff line number Diff line change @@ -102,6 +102,13 @@ def bundle_dataset(self):
102102 def all_organizers (self ):
103103 return [self .created_by ] + list (self .collaborators .all ())
104104
105+ @property
106+ def first_phase_start (self ):
107+ first_phase = self .phases .filter (index = 0 ).first ()
108+ if first_phase and first_phase .start :
109+ return first_phase .start
110+ return self .created_when
111+
105112 def user_has_admin_permission (self , user ):
106113 if isinstance (user , int ):
107114 try :
Original file line number Diff line number Diff line change 1818 <tr>
1919 <th>Name</th>
2020 <th width="100">Type</th>
21- <th width="125">Uploaded... </th>
21+ <th width="125">Uploaded</th>
2222 <th width="50px">Publish</th>
2323 <th width="50px">Edit</th>
2424 <th width="50px">Delete</th>
6161 <thead>
6262 <tr>
6363 <th>Name</th>
64- <th width="125px">Uploaded... </th>
64+ <th width="125px">Uploaded</th>
6565 </tr>
6666 </thead>
6767 <tbody>
Original file line number Diff line number Diff line change 7575 </div>
7676 </a>
7777 <div class="comp-stats">
78- {pretty_date(competition.created_when )}
78+ {pretty_date(competition.first_phase_start )}
7979 <div if="{!competition.reward && ! competition.report}" class="ui divider"></div>
8080 <div>
8181 <span if="{competition.reward}"><img width="30" height="30" src="/static/img/trophy.png"></span>
Original file line number Diff line number Diff line change 1919 </div>
2020 </a>
2121 <div class="comp-stats" id="compStats">
22- {pretty_date(created_when )}
22+ {pretty_date(first_phase_start )}
2323 <div if="{!reward && !report}" class="ui divider"></div>
2424 <div>
2525 <span if="{reward}"><img width="30" height="30" src="/static/img/trophy.png"></span>
Original file line number Diff line number Diff line change 5151 </div>
5252 </a>
5353 <div class="comp-stats">
54- {pretty_date(competition.created_when )}
54+ {pretty_date(competition.first_phase_start )}
5555 <div if="{!competition.reward && ! competition.report}" class="ui divider"></div>
5656 <div>
5757 <span if="{competition.reward}"><img width="30" height="30" src="/static/img/trophy.png"></span>
You can’t perform that action at this time.
0 commit comments