diff --git a/core/models.py b/core/models.py index 95ac9102..3961eee0 100755 --- a/core/models.py +++ b/core/models.py @@ -847,6 +847,10 @@ class Work(models.Model): def get_absolute_url(self): return reverse('work', args=[str(self.id)]) + def publishers(self): + # returns a set of publishers associated with this Work + return Publisher.objects.filter(name__editions__work=self).distinct() + class Author(models.Model): created = models.DateTimeField(auto_now_add=True) name = models.CharField(max_length=500) @@ -970,9 +974,9 @@ class Edition(models.Model): class Publisher(models.Model): created = models.DateTimeField(auto_now_add=True) name = models.ForeignKey('PublisherName', related_name='key_publisher') - url = models.URLField(max_length=1024, null=True) - logo_url = models.URLField(max_length=1024, null=True) - description = models.TextField(default='', null=True) + url = models.URLField(max_length=1024, null=True, blank=True) + logo_url = models.URLField(max_length=1024, null=True, blank=True) + description = models.TextField(default='', null=True, blank=True) def __unicode__(self): return self.name.name diff --git a/frontend/forms.py b/frontend/forms.py index 9ac48114..6318680c 100644 --- a/frontend/forms.py +++ b/frontend/forms.py @@ -303,10 +303,11 @@ def getManageCampaignForm ( instance, data=None, *args, **kwargs ): edition = forms.ModelChoiceField(get_queryset(), widget=RadioSelect(),empty_label='no edition selected',required = False,) minimum_target = settings.UNGLUEIT_MINIMUM_TARGET latest_ending = (timedelta(days=int(settings.UNGLUEIT_LONGEST_DEADLINE)) + now()).date + publisher = forms.ModelChoiceField(instance.work.publishers(), empty_label='no publisher selected', required = False,) class Meta: model = Campaign - fields = 'description', 'details', 'license', 'target', 'deadline', 'paypal_receiver', 'edition' + fields = 'description', 'details', 'license', 'target', 'deadline', 'paypal_receiver', 'edition', 'email', 'publisher' widgets = { 'deadline': SelectDateWidget, } diff --git a/frontend/templates/ask_rh.html b/frontend/templates/ask_rh.html new file mode 100644 index 00000000..2ce66338 --- /dev/null +++ b/frontend/templates/ask_rh.html @@ -0,0 +1,34 @@ +{% extends "basedocumentation.html" %} + +{% block title %}Campaign questions{% endblock %} + +{% block doccontent %} +{% if campaign.email %} +
Questions about {{campaign}}? Ask away!
+ + To: {{campaign}}Sorry, this campaign isn't set up to answer emails at this time.
+{% endif %} +{% endblock %} \ No newline at end of file diff --git a/frontend/templates/ask_rh.txt b/frontend/templates/ask_rh.txt new file mode 100644 index 00000000..fe9a1225 --- /dev/null +++ b/frontend/templates/ask_rh.txt @@ -0,0 +1,4 @@ +{{ sender }} has a question about {{campaign}} +_____________________________________ + +{{ message }} \ No newline at end of file diff --git a/frontend/templates/feedback.txt b/frontend/templates/feedback.txt new file mode 100644 index 00000000..ca1aed78 --- /dev/null +++ b/frontend/templates/feedback.txt @@ -0,0 +1,5 @@ +This feedback is about {{ page }} +From {{ sender }}, ungluer name {{ request.user.username }} +user agent {{ request.META.HTTP_USER_AGENT }} +_____________________________________ +{{ message }} \ No newline at end of file diff --git a/frontend/templates/manage_campaign.html b/frontend/templates/manage_campaign.html index d03c7ef2..9dac0f80 100644 --- a/frontend/templates/manage_campaign.html +++ b/frontend/templates/manage_campaign.html @@ -246,12 +246,17 @@ Please fix the following before launching your campaign: {{ form.deadline.errors }} {% endifnotequal %} -Enter the email address where notifications about this campaign should be sent. If your campaign succeeds, this email needs to work if you want to get paid!
- - +Enter the email address where notifications about this campaign should be sent. If your campaign succeeds, this email needs to work if you want to get paid! This address will not be exposed on the website.
{{ form.paypal_receiver.errors }}{{ form.paypal_receiver }}
- +(Optional, but highly recommended). Enter an email address where ungluers with questions about the book or the campaign can contact you or someone involved. This address will not be exposed on the website.
+{{ form.email.errors }}{{ form.email }}
+ + {% if work.publishers %} +If you are set up as an unglue.it publisher (send us a url, logo, description and list of ways your name might appear) you can link your campaign by selecting the publisher here: +
{{ form.publisher.errors }}{{ form.publisher }}
+ {% endif %} {% ifequal campaign_status 'ACTIVE' %}