Permalink
Browse files

extra field to indicate test challenges, groups and courses

  • Loading branch information...
1 parent ce1019a commit 63e8a8bb61a9f66a08479b5e6a8a1166485a1de4 @dirkcuys dirkcuys committed May 14, 2012
@@ -52,7 +52,7 @@ def __init__(self, category, *args, **kwargs):
class Meta:
model = Project
- fields = ('name', 'category', 'other', 'other_description',
+ fields = ('test', 'name', 'category', 'other', 'other_description',
'short_description', 'long_description', 'language')
widgets = {
'category': forms.RadioSelect,
@@ -95,6 +95,7 @@ class Project(ModelBase):
created_on = models.DateTimeField(
auto_now_add=True, default=datetime.datetime.now)
+ test = models.BooleanField(default=False)
under_development = models.BooleanField(default=True)
not_listed = models.BooleanField(default=False)
archived = models.BooleanField(default=False)
@@ -199,7 +199,7 @@ def create(request, category=None):
msg = _("Problem creating the study group, course, ...")
messages.error(request, msg)
else:
- form = project_forms.ProjectForm(category)
+ form = project_forms.ProjectForm(category, initial={'test':True})
image_form = project_forms.ProjectImageForm()
context = {
'form': form,
@@ -9,6 +9,12 @@
<fieldset id="project_edit_summary" class="project edit summary tabpane">
<form id="project-edit-summary-form" action="{% if project %}{% locale_url projects_edit slug=project.slug %}{% else %}{% if is_challenge %}{% locale_url projects_create_challenge %}{% else %}{% locale_url projects_create %}{% endif %}{% if school %}?school={{ school.slug }}{% endif %}{% endif %}" method="post" {% if category and not project %}enctype="multipart/form-data"{% endif %}>
{% csrf_token %}
+ <div class="field{% if form.name.errors %} error{% endif %}">
+ <label for="id_test">{{ _('Test') }}</label>
+ <span class="hint block">{{ _('Please check this if you are just testing out P2PU.') }}</span>
+ {{ form.test }}
+ {{ form.test.errors }}
+ </div>
<div class="field{% if form.name.errors %} error{% endif %}">
{% if is_challenge %}
<label for="id_name">{{ _('Title') }}</label>

0 comments on commit 63e8a8b

Please sign in to comment.