class Meta:
model = Conference
fields = ['active', 'callforpapersopen', 'callforsponsorsopen', 'feedbackopen',
- 'conferencefeedbackopen', 'scheduleactive', 'sessionsactive',
+ 'conferencefeedbackopen', 'scheduleactive', 'sessionsactive', 'allowedit',
'schedulewidth', 'pixelsperminute',
'testers', 'talkvoters', 'staff', 'volunteers',
'asktshirt', 'askfood', 'asknick', 'asktwitter', 'askshareemail', 'askphotoconsent',
'fields': [self['vouchercode'],],
}
+class RegistrationChangeForm(forms.ModelForm):
+ def __init__(self, *args, **kwargs):
+ super(RegistrationChangeForm, self).__init__(*args, **kwargs)
+ self.fields['photoconsent'].required = True
+ for f in self.instance.conference.remove_fields:
+ del self.fields[f]
+
+ class Meta:
+ model = ConferenceRegistration
+ fields = ('shirtsize', 'dietary', 'twittername', 'nick', 'shareemail', 'photoconsent', )
+ widgets = {
+ 'photoconsent': forms.Select(choices=((None, ''), (True, 'I consent to having my photo taken'), (False, "I don't want my photo taken"))),
+ }
+
+
rating_choices = (
(1, '1 (Worst)'),
(2, '2'),
--- /dev/null
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('confreg', '0024_photoconsent'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='conference',
+ name='allowedit',
+ field=models.BooleanField(default=True, verbose_name=b'Allow editing registrations'),
+ ),
+ ]
callforsponsorsopen = models.BooleanField(blank=False,null=False,default=False, verbose_name="Call for sponsors open")
feedbackopen = models.BooleanField(blank=False,null=False,default=False, verbose_name="Session feedback open")
conferencefeedbackopen = models.BooleanField(blank=False,null=False,default=False, verbose_name="Conference feedback open")
+ allowedit = models.BooleanField(blank=False,null=False,default=True, verbose_name="Allow editing registrations")
scheduleactive = models.BooleanField(blank=False,null=False,default=False,verbose_name="Schedule publishing active")
sessionsactive = models.BooleanField(blank=False,null=False,default=False,verbose_name="Session list publishing active")
schedulewidth = models.IntegerField(blank=False, default=600, null=False, verbose_name="Width of HTML schedule")
return "Payment details not available"
+ def get_field_string(self, field):
+ r = getattr(self, field)
+ if isinstance(r, bool):
+ return r and 'Yes' or 'No'
+ return getattr(self, field)
+
# For the admin interface (mainly)
def __unicode__(self):
return "%s: %s %s <%s>" % (self.conference, self.firstname, self.lastname, self.email)
from models import PendingAdditionalOrder
from models import RegistrationWaitlistEntry, RegistrationWaitlistHistory
from models import STATUS_CHOICES
-from forms import ConferenceRegistrationForm, ConferenceSessionFeedbackForm
+from forms import ConferenceRegistrationForm, RegistrationChangeForm, ConferenceSessionFeedbackForm
from forms import ConferenceFeedbackForm, SpeakerProfileForm
from forms import CallForPapersForm, CallForPapersSpeakerForm, CallForPapersSubmissionForm
from forms import CallForPapersCopyForm, PrepaidCreateForm, BulkRegistrationForm
for pao in PendingAdditionalOrder.objects.filter(reg=reg, invoice__isnull=False):
invoices.append(('Additional options invoice and receipt', InvoicePresentationWrapper(pao.invoice, '.')))
+ if conference.allowedit:
+ # Form for changeable fields
+ if request.method == 'POST':
+ changeform = RegistrationChangeForm(instance=reg, data=request.POST)
+ if changeform.is_valid():
+ changeform.save()
+ messages.info(request, "Registration updated.")
+ return HttpResponseRedirect("../")
+ else:
+ changeform = RegistrationChangeForm(instance=reg)
+ else:
+ changeform = None
+
+ fields = ['shirtsize', 'dietary', 'nick', 'twittername', 'shareemail', 'photoconsent']
+ for f in conference.remove_fields:
+ fields.remove(f)
+ displayfields = [(reg._meta.get_field(k).verbose_name.capitalize(), reg.get_field_string(k)) for k in fields]
+
return render_conference_response(request, conference, 'reg', 'confreg/registration_dashboard.html', {
'redir_root': redir_root,
'reg': reg,
'pendingadditional': pendingadditional,
'pendingadditionalinvoice': pendingadditionalinvoice,
'invoices': invoices,
+ 'changeform': changeform,
+ 'displayfields': displayfields,
})
def confhome(request, confname):
'costamount': reg.regtype and reg.regtype.cost or 0,
})
+@login_required
+@transaction.atomic
+def changereg(request, confname):
+ # Change certain allowed fields on a registration.
+ conference = get_object_or_404(Conference, urlname=confname)
+ reg = get_object_or_404(ConferenceRegistration, conference=conference, attendee=request.user)
+
+ if not conference.allowedit:
+ return HttpResponseRedirect('../')
+
+ return _registration_dashboard(request, conference, reg, False, '../')
+
@login_required
@transaction.atomic
def multireg(request, confname, regid=None):
url(r'^events/(?P<confname>[^/]+)/register/other/newinvoice/$', postgresqleu.confreg.views.multireg_newinvoice),
url(r'^events/(?P<confname>[^/]+)/register/other/b(?P<bulkid>(\d+))/$', postgresqleu.confreg.views.multireg_bulkview),
url(r'^events/(?P<confname>[^/]+)/register/other/z/$', postgresqleu.confreg.views.multireg_zeropay),
+ url(r'^events/(?P<confname>[^/]+)/register/change/$', postgresqleu.confreg.views.changereg),
url(r'^events/register/attach/([a-z0-9]{64})/$', postgresqleu.confreg.views.multireg_attach),
url(r'^events/([^/]+)/bulkpay/$', postgresqleu.confreg.views.bulkpay),
url(r'^events/([^/]+)/bulkpay/(\d+)/$', postgresqleu.confreg.views.bulkpay_view),
overflow: hidden;
}
div.regleft {
- width: 350px;
+ width: 450px;
float: left;
}
div.regright {
ul.dash_pagelinks li {
display: inline;
}
+
+div.regwrap {
+ width: 100%;
+ overflow: hidden;
+}
+div.regleft {
+ width: 450px;
+ float: left;
+}
+div.regright {
+ width: 200px;
+ float: right;
+}
+div.regright ul {
+ padding: 0px;
+}
+div.regright ul li {
+ margin-top: 0px;
+}
+div.regwrap.errfld {
+ background-color: rgb(255,255,204);
+ border: 1px solid red;
+}
+div.regwrap.errfld ul.errorlist li {
+ font-weight: normal !important;
+}
+form input[type=submit] {
+ width: 200px !important;
+}
</style>
{%endblock%}
{%block content%}
This registration type gives you access to the conference on {{reg.regtype.available_days}}.
{%endif%}
</dd>
+ <dt>Registration details</dt>
+ <dd>
+ <p>
+ This registration is made for <i>{{reg.firstname}} {{reg.lastname}}</i> with email address <i>{{reg.email}}</i>.
+ </p>
+ <ul>
+{%for k,v in displayfields%}
+ <li>{{k}}: {{v}}</li>
+{%endfor%}
+ </ul>
+ </dd>
{%if reg.additionaloptions.all()%}
<dt>Additional options</dt>
</dl>
+{%if changeform%}
+<h2>Change your registration</h2>
+<p>
+A limited number of fields on your registration can be changed. If you need
+to change anything other than this, please contact the conference organizers.
+</p>
+{%if changeform.non_field_errors()%}{{changeform.non_field_errors()}}{%endif%}
+<form method="post" action="{{redir_root}}change/">{{ csrf_input }}
+ {%for f in changeform %}
+ <div class="regwrap{%if f.errors%} errfld{%endif%}">
+ <div class="regleft">
+ {{f.label_tag()}} <br/>
+ {{f}}
+ </div>
+ <div class="regright">
+ {% if f.errors %}{{ f.errors}}{% endif %}
+ </div>
+ </div>
+ {%endfor%}
+<input type="submit" value="Update registration">
+</form>
+{%endif%}
{%if availableoptions%}
<a name="options"></a>
overflow: hidden;
}
div.regleft {
- width: 350px;
+ width: 450px;
float: left;
}
div.regright {