EMAIL_HOST = 'smtp.ircam.fr'
EMAIL_PORT = '25'
-DEFAULT_FROM_EMAIL = 'www@ircam.fr'
-DEFAULT_TO_EMAIL = 'drh@ircam.fr'
-EMAIL_SUBJECT_PREFIX = "[IRCAM WWW]"
+DEFAULT_FROM_EMAIL = 'vertigo@iuk.fraunhofer.de'
+DEFAULT_TO_EMAIL = 'vertigo@iuk.fraunhofer.de'
+EMAIL_SUBJECT_PREFIX = '[Vertigo]'
SITE_TITLE = 'IRCAM'
SITE_TAGLINE = 'Institut de Recherche et de Coordination Acoustique et Musique'
--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2017-03-22 17:46
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organization-network', '0092_auto_20170314_1918'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='person',
+ name='organization_name',
+ field=models.CharField(blank=True, max_length=128, null=True, verbose_name='organization_name'),
+ ),
+ migrations.AddField(
+ model_name='person',
+ name='position',
+ field=models.CharField(blank=True, max_length=128, null=True, verbose_name='position'),
+ ),
+ ]
bio = RichTextField(_('biography'), blank=True)
role = models.CharField(_('role'), max_length=256, blank=True, null=True)
external_id = models.CharField(_('external ID'), blank=True, null=True, max_length=128)
+ organization_name = models.CharField(_('organization name'), blank=True, null=True, max_length=128)
+ position = models.CharField(_('position'), blank=True, null=True, max_length=128)
class Meta:
verbose_name = _('person')
super(ProjectForm, self).__init__(*args, **kwargs)
self.fields['title'].label = "Project name"
self.fields['keywords'].help_text = "5 comma separated keywords"
+ self.fields['keywords'].required = True
class Meta:
model = Project
fields = ['file', 'credits']
+class ProjectLinkInline(InlineFormSet):
+
+ extra = 3
+ model = ProjectLink
+ prefix = 'Public link'
+ text = "To be published only for ICT-Projects selected by the consortium"
+ can_delete = False
+ fields = ['url', 'type']
+
+
+
+class ProjectContactForm(ModelForm):
+
+ def __init__(self, *args, **kwargs):
+ super(ProjectContactForm, self).__init__(*args, **kwargs)
+ self.fields['organization_name'].help_text = "The organization related to the contact"
+ self.fields['position'].help_text = "The position of the contact in the organization"
+ for field in self._meta.fields:
+ self.fields[field].required = True
+
+ class Meta:
+ model = ProjectContact
+ fields = ('first_name', 'last_name', 'email', 'organization_name',
+ 'position', 'address', 'telephone', 'address', 'postal_code',
+ 'city', 'country')
+
+
class ProjectContactInline(InlineFormSet):
max_num = 1
model = ProjectContact
+ form_class = ProjectContactForm
prefix = 'Private project contact'
can_delete = False
- fields = ['first_name', 'last_name', 'address', 'email',
- 'telephone', 'address', 'postal_code', 'city', 'country']
class OrganizationContactInline(InlineFormSet):
resources_description = models.TextField(_('resource description'), help_text="Resources available to the artist -- e.g. office facility, studio facility, technical equipment, internet connection, laboratory, and periods of availability for artistic production, staff possibly allocated to the project, available budget for travel, consumables and equipment, etc... (50 – 100 words).")
period = models.CharField(_('period of implementation'), max_length=128, help_text="Possible period of implementation (must be part of the project implementation workplan)")
image = models.FileField(_("Image"), max_length=1024, upload_to="user/images/%Y/%m/%d/", help_text="Representing the project")
- image_credits = models.CharField(_('Image credits'), max_length=256, blank=True, null=True)
+ image_credits = models.CharField(_('Image credits'), max_length=256)
class Meta:
verbose_name = 'Project public data'
from django.shortcuts import render
from django.views.generic.detail import SingleObjectMixin
+from django.template.loader import render_to_string, get_template
+from django.core.mail import EmailMessage
+from django.template import Context
from dal import autocomplete
from dal_select2_queryset_sequence.views import Select2QuerySetSequenceView
from mezzanine_agenda.models import Event
model = Project
template_name='projects/project_ict_submission.html'
-
-
+
class ProjectICTCreateView(ProjectCallMixin, CreateWithInlinesView):
model = Project
form_class = ProjectForm
template_name='projects/project_ict_create.html'
- inlines = [ProjectPublicDataInline, ProjectPrivateDataInline, ProjectUserImageInline, ProjectContactInline,]
+ inlines = [ProjectPublicDataInline, ProjectPrivateDataInline, ProjectUserImageInline,
+ ProjectContactInline]
topic = 'ICT'
-
def forms_valid(self, form, inlines):
self.object = form.save()
self.call = ProjectCall.objects.get(slug=self.kwargs['slug'])
self.object.call = self.call
self.object.topic, c = ProjectTopic.objects.get_or_create(name='ICT')
self.object.save()
+
+ for formset in inlines:
+ print(formset.prefix)
+ if 'contact' in formset.prefix:
+ for f in formset:
+ contact_data = f.cleaned_data
+ contact_email = contact_data.get("email")
+
+ from_email = settings.DEFAULT_FROM_EMAIL
+ to_email = [contact_email, settings.DEFAULT_TO_EMAIL]
+ subject = settings.EMAIL_SUBJECT_PREFIX + ' ' + self.call.title
+ ctx = {
+ 'first_name': contact_data['first_name'],
+ 'last_name': contact_data['last_name'],
+ 'project_title': self.object.title,
+ }
+
+ message = get_template('projects/project_ict_create_notification.html').render(Context(ctx))
+ msg = EmailMessage(subject, message, to=to_email, from_email=from_email)
+ msg.content_subtype = 'html'
+ msg.send()
+
return super(ProjectICTCreateView, self).forms_valid(form, inlines)
def get_success_url(self):
--- /dev/null
+<p>Thank you for applying for the Vertigo Call for Projects and your interest in hosting an artist.</p>
+<p>With the submission of data and documents about your project, you declare, that you are allowed to establish a cooperation with an artist funded by the Vertigo project.</p>
+<p>We will keep you informed about the further project selection process.</p>
+
+{# You submitted the following data:#}
+
+<p>If you wish to change the information or would like to add further information, please send an email containing the new information to <a href="mailto:vertigo@iuk.fraunhofer.de">vertigo@iuk.fraunhofer.de</a>.</p>
{% editable object.title %}
<h1 class="dotted">{% trans "Project submission form" %}</h1>
{% endeditable %}
- <h3>All fields are required</h3>
+ <h3>All fields are mandatory / required</h3>
{% endblock %}
{% block page_content %}
{% elif "Public data" in formset.prefix %}
<h5>To be published only for ICT-Projects selected by the consortium</h5>
{% elif "Private images" in formset.prefix %}
- <h5>3 key images for inspiring artist + any video content available</h5>
+ <h5>3 key images for inspiring artist</h5>
{% endif %}
{% for form in formset %}
{% fields_for form %}
{% endfor %}
{% endfor %}
<div class="form-actions">
+ <h3>All fields are mandatory / required</h3>
+ <p>With the submission of data and documents about your project, you declare, that you are allowed to establish a cooperation with an artist funded by the Vertigo project.</p>
+ <br>
<input class="btn btn-primary btn-lg" type="submit"
value="{% if page.form.button_text %}{{ page.form.button_text }}{% else %}{% trans "Submit" %}{% endif %}">
</div>
--- /dev/null
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+</head>
+
+<body>
+ <p>Dear {{ first_name }} {{ last_name }},</p>
+ {% include 'projects/inc/project_validation.html' %}
+</body>
+</html>
{% block page_content %}
<div class="row">
- <p>Thank you for having submitted your project. It will evaluated in the next few days by the evaluation board and you will then receive an email notification for the result.</p>
- <p>For the first call of 2017, you cannot update your project data on your own, so please <a href="mailto:vertigo@iuk.fraunhofer.de">send an email</a> to the board if you need any modification.</p>
- <p>See you soon!</p>
+ <p>Dear Submitter,</p>
+ {% include 'projects/inc/project_validation.html' %}
</div>
{% endblock %}