Commit 4458e506 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers 🐦

add paper field and link in agent description

parent d436f0cb
Pipeline #2449 failed with stages
in 3 minutes and 21 seconds
......@@ -18,7 +18,7 @@ class RegisterForm(forms.ModelForm):
raise ValidationError("registrations are not currently open")
class Meta:
fields = ["name", "description", "track", "allow_download", "is_student"]
fields = ["name", "description", "paper", "track", "allow_download", "is_student"]
widgets = {'track': forms.HiddenInput()}
model = Submission
......
# Generated by Django 2.2.6 on 2019-10-24 16:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fg_competitions', '0017_auto_20190319_1148'),
]
operations = [
migrations.AddField(
model_name='submission',
name='paper',
field=models.URLField(blank=True, help_text='Provide a link to your research paper', null=True),
),
]
......@@ -136,6 +136,7 @@ class Submission(models.Model):
submission_type = models.CharField(max_length=1, default="U", choices=SUBMISSION_TYPES)
# Extras
paper = models.URLField(blank=True, null=True, help_text="Provide a link to your research paper")
allow_download = models.BooleanField(default=True, verbose_name="Make public", help_text="Allow public distribution after results publication")
is_student = models.CharField(max_length=1, choices=YES_OR_NO, verbose_name="Student Submission", help_text="Is this submission by a student?")
sample = models.BooleanField(default=False)
......
......@@ -147,24 +147,36 @@ loading...
{% block content_sidebar %}
<nav class="nav flex-column">
<a class="nav-link btn btn-primary mt-md-2" href="{{submission.track.get_absolute_url}}">View Track</a>
{% if submission.track.allow_download and submission.current_upload %}
{% if submission.is_public or user.is_staff %}
<a class="nav-link btn btn-primary mt-md-2" href="{% url 'submission_download' pk=submission.current_upload.pk %}">Download</a>
{% else %}
<span class="d-inline-block" data-toggle="tooltip" title="Submission does not allow public download">
<a class="nav-link btn btn-primary disabled mt-md-2" href="#">Download</a> </span>
<a class="nav-link btn btn-outline-primary mt-md-2" href="{{submission.track.get_absolute_url}}">View Track</a>
{% if submission.paper %}
<a class="nav-link btn btn-outline-primary mt-md-2" href="{{submission.paper}}">View Paper</a>
{% endif %}
{% if submission.current_upload and submission.track.allow_download %}
{% if submission.is_public %}
<a class="nav-link btn btn-outline-primary mt-md-2" href="{% url 'submission_download' pk=submission.current_upload.pk %}">Download</a>
{% else %}
<span class="d-inline-block" data-toggle="tooltip" title="Submission does not allow public download">
<a class="nav-link btn btn-outline-primary disabled mt-md-2" href="#">Download</a> </span>
{% endif %}
{% endif %}
</nav>
{% if submission.owner == user %}
<hr />
<nav class="nav flex-column mt-3">
{% if submission.owner == user and submission.track.allow_update %}
<a class="nav-link btn btn-primary mt-md-2" href="{% url 'submission_update' pk=submission.pk %}">Edit Details</a>
{% if submission.track.allow_sub_uploads %}
<a class="nav-link btn btn-primary mt-md-2" href="{% url 'submission_upload' submission=submission.pk %}">Upload new Version</a>
{% elif submission.track.allow_sub_text %}
<a class="nav-link btn btn-primary mt-md-2" href="{% url 'submission_text' submission=submission.pk %}">Upload new Version</a>
{% endif %}
<a class="nav-link btn btn-primary mt-md-2" href="{% url 'submission_update' pk=submission.pk %}">Update Details</a>
{% endif %}
</nav>
{% endif %}
{% if submission.track.owner == user %}
<hr />
<nav class="nav flex-column mt-3">
<a class="nav-link btn btn-outline-secondary mt-md-2" href="{% url 'submission_download' pk=submission.current_upload.pk %}">Download (admin)</a>
<a class="nav-link btn btn-outline-secondary mt-md-2" href="{% url 'submission_update' pk=submission.current_upload.pk %}">Edit (admin)</a>
</nav>
{% endif %}
{% endblock %}
......@@ -217,7 +217,7 @@ class SubmissionCreate(CreateView):
@method_decorator(login_required, name='dispatch')
class SubmissionUpdate(UpdateView):
model = Submission
fields = ['name', 'description', 'allow_download']
fields = ['name', 'description', 'paper', 'allow_download', 'is_student']
def get_context_data(self, **kwargs):
context = super(SubmissionUpdate, self).get_context_data(**kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment