Skip to content

Commit

Permalink
Merge pull request codalab#2740 from codalab/fix_lri_merge
Browse files Browse the repository at this point in the history
revert lri merge commit
  • Loading branch information
jimmykodes authored Jan 22, 2020
2 parents c1e6e48 + 27e5e80 commit ac7bad8
Show file tree
Hide file tree
Showing 12 changed files with 266 additions and 380 deletions.
1 change: 0 additions & 1 deletion .env_production_sample
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ WEB_CONCURRENCY=16
#SOCIAL_AUTH_CHAHUB_BASE_URL=https://chahub.org



# ----------------------------------------------------------------------------
# Logging
# ----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
!certs/.gitkeep
certs/
var/*
var_*/
docker-compose.override.yml
*_old/
.pytest_cache
Expand Down
21 changes: 1 addition & 20 deletions codalab/apps/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,10 @@ class Meta:

class PhaseSerial(serializers.ModelSerializer):
start_date = serializers.DateField(format='%Y-%m-%d')
is_active = serializers.Field()

class Meta:
model = webmodels.CompetitionPhase
fields = (
'competition',
'description',
'phasenumber',
'label',
'start_date',
'max_submissions',
'max_submissions_per_day',
'is_scoring_only',
'id',
'is_migrated',
'is_active',
'phase_never_ends',
)
extra_kwargs = {
'datasets': {'read_only': True},
'is_active': {'read_only': True},
'id': {'read_only': True},
}
read_only_fields = ['datasets']

class CompetitionPhaseSerial(serializers.ModelSerializer):
end_date = serializers.DateField(format='%Y-%m-%d')
Expand Down
15 changes: 0 additions & 15 deletions codalab/apps/web/static/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -329,21 +329,6 @@ starting_kit_table {
border: 1px solid #000000;
}

#chahub_embed {
width: 100%;
height: 100%;
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
border: 0;

// Doing padding instead of top: 50px makes body not have a scrollbar
padding-top: 50px;
padding-bottom: 25px;
}

.finished-submission {
background-color: rgba(0, 255, 0, 0.1) !important;
}
Expand Down
96 changes: 91 additions & 5 deletions codalab/apps/web/templates/web/competitions/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,96 @@
{% extends 'base.html' %}
{% block head_title %}Competitions{% endblock head_title %}
{% block page_title %}Competitions{% endblock page_title %}
{% block content %}

{% load static %}
<div class="row">
<div class="col-md-6">
{% comment commenting out until we have sorting %}
<div class="sort margin-bottom">
Sort by:
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default btn-sm active">
<input type="radio" name="sortby" id="recent"> Most Recent
</label>
<label class="btn btn-default btn-sm">
<input type="radio" name="sortby" id="active"> Most Active
</label>
</div>
</div>
{% endcomment %}
<form id="search_form" action="." method="GET">
<div class="input-group margin-bottom">
<input id="search_query_input" class="form-control" type="search" name="q" placeholder="Search...">
<span class="input-group-btn">
<input class="btn btn-primary" type="submit" value="Search">
</span>
</div>
<!--
<div class="checkbox-inline">
<label>
<input name="is_active" type="checkbox"> Is active
</label>
</div>
<div class="checkbox-inline">
<label>
<input name="is_finished" type="checkbox"> Is finished
</label>
</div>
<div class="checkbox-inline">
<label>
<input name="medical_image_viewer" type="checkbox"> Medical image viewer
</label>
</div>
-->
</form>
</div>
</div>

{% block head_title %}Competitions search{% endblock head_title %}
{% block nosubheader %}{% endblock %} {# don't show header #}
<div class="row pad-top">
<div class="col-md-12 competition-list">
{% if not competitions %}
<p><em>There are no competitions.</em></p>
{% else %}
{% for competition in competitions %}
{% include "web/my/_competition_tile.html" with competition=competition %}
{% endfor %}
{% endif %}
</div>
</div>
<a href="https://github.com/codalab/codalab/wiki/User_Competition-Roadmap">Learn how to create your own competition.</a>
{% endblock content%}

{% block content_wrapper %}
<iframe id="chahub_embed" src="{{ CHAHUB_URL }}?producer={{ CHAHUB_PRODUCER_ID }}&embedded=1" frameborder="no"></iframe>
{% endblock %}
{% block js %}
function populate(frm, data) {
$.each(data, function(key, value){
var $ctrl = $('[name='+key+']', frm);
switch($ctrl.attr("type"))
{
case "text":
case "hidden":
$ctrl.val(value);
break;
case "radio":
case "checkbox":
$ctrl.each(function(){
if(value=='on') {
$(this).attr("checked",value);
}
});
break;
default:
$ctrl.val(value);
}
});
}
$('.competition-tile').on('click',function(){
var competitionID = $(this).find('#competitionID').val();
window.location.href = '/competitions/' + competitionID;
});

var params = {}
location.search.substr(1).split("&").forEach(function(item) {params[item.split("=")[0]] = item.split("=")[1]})

populate('#search_form', params);
{% endblock js %}
Loading

0 comments on commit ac7bad8

Please sign in to comment.