diff --git a/partners/admin.py b/partners/admin.py index ccb1ffbd115c8115883e9213827520e3ddb2d89c..1508d75da0d10c6a31588b95dd69f5beb1522260 100644 --- a/partners/admin.py +++ b/partners/admin.py @@ -1,10 +1,17 @@ from django.contrib import admin -from .models import Contact, Partner, Consortium, Institution,\ +from .models import Petition, Contact, Partner, Consortium, Institution,\ ProspectivePartner, ProspectiveContact, ProspectivePartnerEvent,\ MembershipAgreement, ContactRequest, PartnersAttachment +class PetitionAdmin(admin.ModelAdmin): + prepopulated_fields = {'slug': ('title',)} + + +admin.site.register(Petition, PetitionAdmin) + + class AttachmentInline(admin.TabularInline): model = PartnersAttachment diff --git a/partners/migrations/0033_auto_20171003_2058.py b/partners/migrations/0033_auto_20171003_2058.py new file mode 100644 index 0000000000000000000000000000000000000000..d0b5cc876783e68c29bafa319e7e5810d5a0172b --- /dev/null +++ b/partners/migrations/0033_auto_20171003_2058.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-10-03 18:58 +from __future__ import unicode_literals + +from django.db import migrations, models +import partners.storage + + +class Migration(migrations.Migration): + + dependencies = [ + ('scipost', '0065_authorshipclaim_publication'), + ('partners', '0032_auto_20170829_0727'), + ] + + operations = [ + migrations.CreateModel( + name='Petition', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=256)), + ('slug', models.SlugField()), + ('headline', models.CharField(max_length=256)), + ('statement', models.TextField()), + ('signatories', models.ManyToManyField(related_name='petitions', to='scipost.Contributor')), + ], + ), + migrations.AlterField( + model_name='partnersattachment', + name='attachment', + field=models.FileField(storage=partners.storage.SecureFileStorage(), upload_to='UPLOADS/PARTNERS/ATTACHMENTS'), + ), + ] diff --git a/partners/models.py b/partners/models.py index ff95d07990170d04286329cc4d70a0c625203715..e17708d907d3265d8b83767358d47a0e9d080e7b 100644 --- a/partners/models.py +++ b/partners/models.py @@ -33,6 +33,21 @@ from scipost.fields import ChoiceArrayField from scipost.models import get_sentinel_user, Contributor + +############# +# Petitions # +############# + + +class Petition(models.Model): + title = models.CharField(max_length=256) + slug = models.SlugField() + headline = models.CharField(max_length=256) + statement = models.TextField() + signatories = models.ManyToManyField('scipost.Contributor', related_name='petitions') + + + ######################## # Prospective Partners # ######################## diff --git a/partners/templates/partners/petition.html b/partners/templates/partners/petition.html new file mode 100644 index 0000000000000000000000000000000000000000..fe00c9e01421d85894d4c045348ef2b094c29731 --- /dev/null +++ b/partners/templates/partners/petition.html @@ -0,0 +1,60 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: Supporting Partners: Petition{% endblock pagetitle %} + +{% load bootstrap %} + +{% load staticfiles %} + +{% load scipost_extras %} + +{% block content %} + +<div class="row"> + <div class="col-12"> + <h1 class="highlight">SciPost Supporting Partners</h1> + <h2>{{ petition.headline }}</h2> + {{ petition.statement }} + {% if request.user not in petition.signatories %} + <h3><a href="{% url 'partners:sign_petition' slug=petition.slug contributor_id=contributor.id %}">Sign this petition</a></h3> + {% else %} + <h3>Thanks for signing this petition.</h3> + {% endif %} + </div> +</div> + +<div class="row"> + <div class="col-12"> + <h2>Signatories</h2> + <table class="table"> + {% for signatory in petition.signatories %} + <tr> + <td>{{ signatory.last_name }}</td> + <td>{{ signatory.first_name }}</td> + <td>{{ signatory.institution }}</td> + </tr> + {% endfor %} + </table> + </div> +</div> + +{% if current_agreements %} +<div class="row"> + <div class="col-12"> + <h1 class="highlight">Partners</h1> + <ul class="list-unstyled mb-5"> + {% for agreement in current_agreements %} + <li class="media mb-2"> + <img class="d-flex mr-3" width="192" src="{% if agreement.partner.institution.logo %}{{agreement.partner.institution.logo.url}}{% endif %}" alt="Partner Logo"> + <div class="media-body"> + <p> + <strong>{{agreement.partner.institution.name}}</strong><br> + {{agreement.partner.institution.get_country_display}} + </p> + </div> + </li> + {% endfor %} + </ul> + </div> +</div> +{% endif %} diff --git a/partners/templates/partners/petition_email.html b/partners/templates/partners/petition_email.html new file mode 100644 index 0000000000000000000000000000000000000000..a91a32ab08fe5315d2d4e254b335cea8228d917c --- /dev/null +++ b/partners/templates/partners/petition_email.html @@ -0,0 +1,14 @@ +Dear ...%0D%0A +%0D%0A +I am writing to draw your attention to SciPost, a publishing initiative that is currently helping to transform the academic publishing industry.%0D%0A +%0D%0A +SciPost (https://scipost.org) is a top-quality next-generation Open Access publication portal managed by professional scientists. Its principles, ideals and implementation can be found at https://scipost.org/about and https://scipost.org/FAQ.%0D%0A +%0D%0A +SciPost follows a different funding model than most traditional publishers. It operates on an entirely not-for-profit basis, and charges neither subscription fees nor article processing charges; instead, its activities are financed through a cost-slashing consortial model.%0D%0A +%0D%0A +By making a small financial commitment, the institutions and organizations that benefit from SciPost’s activities can become Supporting Partners. This enables SciPost to perform all of its publication-related activities, maintain its online portal and implement its long-term development plan. Details of the consortial funding scheme and how to join can be found at https://scipost.org/partners or by emailing partners@scipost.org.%0D%0A +%0D%0A +My work as an active professional scientist greatly benefits from SciPost's activities, and I recommend that you give this initiative your concrete backing by becoming one of its Supporting Partners.%0D%0A +%0D%0A +Many thanks for your consideration,%0D%0A +[your signature] diff --git a/partners/templates/partners/supporting_partners.html b/partners/templates/partners/supporting_partners.html index 92d8bcb60a2d8c2176d65473ca3e0dd2638a497b..d202db1de06a95a7780059cad7fd7df17e1f454d 100644 --- a/partners/templates/partners/supporting_partners.html +++ b/partners/templates/partners/supporting_partners.html @@ -17,6 +17,28 @@ </div> </div> +<div class="row"> + <div class="col-12"> + <ul> + <li> + <p> + Are you a scientist?<br/> + Is your institution of funding body not listed below as one of our current Supporting Partners?<br/> + Please petition them to join by sending a librarian/director/... an email, starting from this <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'partners/petition_email.html' %}{% endautoescape %}&cc=partners@scipost.org">template</a>. + </p> + </li> + <li> + <p> + Are you a librarian, funding agency representative or other potential supporter?<br/> + Have a quick look at our <a href="{% static 'scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf' %}">one-page Prospectus</a>.<br/> + Read detailed information in the draft <a href="{% static 'scipost/SPB/SciPost_Supporting_Partner_Agreement.pdf' %}">Partner Agreement</a>, and <a href="mailto:partners@scipost.org">contact us</a> to get further details. + </p> + </li> + </ul> + </div> +</div> + + <div class="row"> <div class="col-12"> <h3>Openness at strictly minimal cost: the role of professional academics</h3> diff --git a/partners/urls.py b/partners/urls.py index f376c8de27594f1f53fa970b3d4b201c62518d90..073f5fdb7cfe49e3f3eb7c33b1961c12c9808ac5 100644 --- a/partners/urls.py +++ b/partners/urls.py @@ -4,6 +4,7 @@ from . import views urlpatterns = [ url(r'^$', views.supporting_partners, name='partners'), + url(r'^$', views.petition, name='petition'), url(r'^dashboard$', views.dashboard, name='dashboard'), url(r'^membership_request$', views.membership_request, name='membership_request'), url(r'^process_contact_requests$', views.process_contact_requests, name='process_contact_requests'), diff --git a/partners/views.py b/partners/views.py index 1a94818df5390b13a87b613425656fcfd2f2b4be..4f963202d53c30557d839593ad3f265444e041cf 100644 --- a/partners/views.py +++ b/partners/views.py @@ -13,7 +13,7 @@ from guardian.decorators import permission_required from .constants import PROSPECTIVE_PARTNER_REQUESTED,\ PROSPECTIVE_PARTNER_APPROACHED, PROSPECTIVE_PARTNER_ADDED,\ PROSPECTIVE_PARTNER_EVENT_REQUESTED, PROSPECTIVE_PARTNER_EVENT_EMAIL_SENT -from .models import Partner, ProspectivePartner, ProspectiveContact, ContactRequest,\ +from .models import Petition, Partner, ProspectivePartner, ProspectiveContact, ContactRequest,\ ProspectivePartnerEvent, MembershipAgreement, Contact, Institution,\ PartnersAttachment from .forms import ProspectivePartnerForm, ProspectiveContactForm,\ @@ -39,6 +39,14 @@ def supporting_partners(request): return render(request, 'partners/supporting_partners.html', context) +def petition(request, slug): + petition = get_object_or_404(Petition, slug=slug) + context = { + 'petition', petition + } + return render(request, 'partners/petition.html', context) + + @login_required @permission_required('scipost.can_read_partner_page', return_403=True) def dashboard(request): diff --git a/scipost/static/scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf b/scipost/static/scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fda1b2d26f95987463dd35c19f108a11a713a93b Binary files /dev/null and b/scipost/static/scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf differ diff --git a/scipost/templates/scipost/index.html b/scipost/templates/scipost/index.html index f3ac59a3f7e27a01cabc8d02b0552bba89113761..cdb58d6052ed77e4c55777df1a3448a559b77c4e 100644 --- a/scipost/templates/scipost/index.html +++ b/scipost/templates/scipost/index.html @@ -123,8 +123,11 @@ SciPost guarantees free online access to all publications in all its Journals and does not charge any article processing fees for publishing. Supporting Partners provide operating funds to SciPost. </p> <p> - Institutions: consider joining our <a href="{% url 'partners:partners' %}">Supporting Partners Board</a>. SciPost cannot exist without your support. + Institutions: consider joining our <a href="{% url 'partners:partners' %}">Supporting Partners Board</a>. SciPost cannot exist without your support. Look at our <a href="{% static 'scipost/SPB/SciPost_Supporting_Partners_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'scipost/SPB/SciPost_Supporting_Partner_Agreement.pdf' %}">Partner Agreement</a>. </p> + <p> + Scientists: if it is not listed on our <a href="{% url 'partners:partners' %}">Partners page</a>, please petition your institution (through a librarian, director, ...) to join, using this <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'partners/petition_email.html' %}{% endautoescape %}&cc=partners@scipost.org">email template</a>. + </p> </div> </div> </div><!-- End Partners -->