Skip to content

Commit

Permalink
make mailchimp a site setting
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Jul 20, 2023
1 parent d805eb6 commit 844ed8c
Show file tree
Hide file tree
Showing 19 changed files with 169 additions and 449 deletions.
23 changes: 0 additions & 23 deletions ghalii/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{% extends "peachjam/_footer.html" %}
{% load i18n static %}
{% block newsletter-form-code %}
<form action=""
method="post"
name="mc-embedded-subscribe-form"
target="_blank">
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<input type="text" name="" tabindex="-1" value=""/>
</div>
<div class="input-group">
<input type="email"
value=""
name="EMAIL"
class="form-control"
placeholder="email address"
required=""/>
<input type="submit"
value="Subscribe"
name="subscribe"
class="btn btn-secondary"/>
</div>
</form>
{% endblock %}
{% block about %}
<p>
{% blocktrans trimmed %}
Expand Down
29 changes: 0 additions & 29 deletions lawlibrary/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,5 @@
{% extends 'peachjam/_footer.html' %}
{% load static i18n %}
{% block newsletter-blurb %}
{% trans 'Subscribe to the LawLibrary newsletter for updates and news on South African legal information.' %}
{% endblock %}
{% block newsletter-form-code %}
<form action="https://lawlibrary.us10.list-manage.com/subscribe/post?u=4f4bdccc4d82422fd556af74f&amp;id=da4493f83c&amp;f_id=00a23be2f0"
method="post"
name="mc-embedded-subscribe-form"
target="_blank">
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<input type="text"
name="b_4f4bdccc4d82422fd556af74f_da4493f83c"
tabindex="-1"
value=""/>
</div>
<div class="input-group">
<input type="email"
value=""
name="EMAIL"
class="form-control"
placeholder="email address"
required=""/>
<input type="submit"
value="Subscribe"
name="subscribe"
class="btn btn-secondary"/>
</div>
</form>
{% endblock %}
{% block about %}
<p>
{% blocktrans trimmed %}
Expand Down
23 changes: 0 additions & 23 deletions lesotholii/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{% extends "peachjam/_footer.html" %}
{% load static i18n %}
{% block newsletter-form-code %}
<form action=""
method="post"
name="mc-embedded-subscribe-form"
target="_blank">
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<input type="text" name="" tabindex="-1" value=""/>
</div>
<div class="input-group">
<input type="email"
value=""
name="EMAIL"
class="form-control"
placeholder="email address"
required=""/>
<input type="submit"
value="Subscribe"
name="subscribe"
class="btn btn-secondary"/>
</div>
</form>
{% endblock %}
{% block about %}
<p>
The Lesotho Legal Information Institute (LesLII) was set up in 2012. LesLII's mission is to publish the laws of Lesotho for free access to everyone. LesLII is supported by the Judiciary of Lesotho, the Law Office, the Law Society and other justice sector stakeholders. AfricanLII and Laws.Africa provide technical support to LesLII.
Expand Down
25 changes: 0 additions & 25 deletions liiweb/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
{% extends 'peachjam/_footer.html' %}
{% load static i18n %}
{% block newsletter-form %}
<h2 class="mb-2">{% trans 'Subscribe' %}</h2>
<div class="row">
<div class="col-12 col-md-6 mb-2">
<p class="lead mb-0">
{% block newsletter-blurb %}
{% trans 'Subscribe to our newsletter for updates and news.' %}
{% endblock %}
</p>
</div>
<div class="col-12 col-md-6 mb-2">
{% block newsletter-form-code %}{% endblock %}
</div>
</div>
<div class="row">
<div class="col-12 col-md-12 mb-2">
{% if PEACHJAM_SETTINGS.facebook_link or PEACHJAM_SETTINGS.twitter_link %}
{% block social-media %}
{% include 'peachjam/_social_media.html' %}
{% endblock %}
{% endif %}
</div>
</div>
<hr/>
{% endblock %}
{% block first-content-column %}
<h5>{% trans 'About' %} {{ APP_NAME }}</h5>
{% block about %}{% endblock %}
Expand Down
23 changes: 0 additions & 23 deletions nigerialii/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{% extends "peachjam/_footer.html" %}
{% load static i18n %}
{% block newsletter-form-code %}
<form action=""
method="post"
name="mc-embedded-subscribe-form"
target="_blank">
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<input type="text" name="" tabindex="-1" value=""/>
</div>
<div class="input-group">
<input type="email"
value=""
name="EMAIL"
class="form-control"
placeholder="email address"
required=""/>
<input type="submit"
value="Subscribe"
name="subscribe"
class="btn btn-secondary"/>
</div>
</form>
{% endblock %}
{% block second-content-column %}
<h5>{% trans 'Our partners' %}</h5>
<div>
Expand Down
33 changes: 0 additions & 33 deletions open_by_laws/templates/open_by_laws/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,6 @@ <h3>{{ municipality.name }}</h3>
</div>
</div>
</section>
<section class="about py-5">
<div class="container">
<h3>Anyone can help to make the law freely available</h3>
<div class="row">
<div class="col-md-8">
<p class="lead">
Open By-laws is maintained by the <a href="https://laws.africa">Laws.Africa</a> contributor community. Anyone can join the community and help to make African law freely available. You can help by adding new by-laws or keeping them up to date. Laws.Africa offers training and support.
</p>
<p>
<a href="https://laws.africa/faq">About the Laws.Africa Contributor Community →</a>
</p>
</div>
</div>
</div>
</section>
<section class="my-5">
<div class="container">
<div class="row">
Expand All @@ -108,23 +93,5 @@ <h3>Powered by Laws.Africa</h3>
</div>
</div>
</section>
<section class="my-5">
<div class="container">
<div class="row">
<div class="col-md-8">
<h3>Use the by-laws in your app or website</h3>
<p class="lead">
Include the by-laws in your research, website, or app and build powerful interactive solutions for your users.
</p>
<p class="lead">
The by-laws are available as structured, machine-friendly Akoma Ntoso XML through the Laws.Africa Content API. Access rich content in HTML, PDF and ePub, and detailed metadata including publication and amendment information.
</p>
<p>
<a href="https://laws.africa/api/">About the Laws.Africa Content API →</a>
</p>
</div>
</div>
</div>
</section>
</div>
{% endblock %}
25 changes: 0 additions & 25 deletions open_by_laws/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
{% extends 'peachjam/_footer.html' %}
{% load static i18n %}
{% block newsletter-form %}
<h2 class="mb-2">{% trans 'Subscribe' %}</h2>
<div class="row">
<div class="col-12 col-md-6 mb-2">
<p class="lead mb-0">
{% block newsletter-blurb %}
{% trans 'Subscribe to our newsletter for updates and news.' %}
{% endblock %}
</p>
</div>
<div class="col-12 col-md-6 mb-2">
{% block newsletter-form-code %}{% endblock %}
</div>
</div>
<div class="row">
<div class="col-12 col-md-12 mb-2">
{% if PEACHJAM_SETTINGS.facebook_link or PEACHJAM_SETTINGS.twitter_link %}
{% block social-media %}
{% include 'peachjam/_social_media.html' %}
{% endblock %}
{% endif %}
</div>
</div>
<hr/>
{% endblock %}
{% block first-content-column %}
<h5>{% trans 'About' %} {{ APP_NAME }}</h5>
{% block about %}
Expand Down
20 changes: 20 additions & 0 deletions peachjam/migrations/0091_peachjamsettings_mailchimp_form_url.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.16 on 2023-07-20 09:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("peachjam", "0090_alter_citationlink_url"),
]

operations = [
migrations.AddField(
model_name="peachjamsettings",
name="mailchimp_form_url",
field=models.URLField(
blank=True, null=True, verbose_name="mailchimp form url"
),
),
]
3 changes: 3 additions & 0 deletions peachjam/models/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class PeachJamSettings(SingletonModel):
verbose_name=_("metabase dashboard link"), null=True, blank=True
)

mailchimp_form_url = models.URLField(
verbose_name=_("mailchimp form url"), null=True, blank=True
)
twitter_link = models.URLField(
verbose_name=_("twitter link"), null=True, blank=True
)
Expand Down
12 changes: 11 additions & 1 deletion peachjam/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
<footer class="pt-4 pb-4">
<div class="container">
<a href="{% url 'pocketlaw_resources' %}" style="display: none"></a>
{% block newsletter-form %}{% endblock %}
{% block newsletter-form %}
{% if PEACHJAM_SETTINGS.mailchimp_form_url %}
{% include 'peachjam/_mailchimp_form.html' %}
{% endif %}
{% endblock %}
{% block social-media %}
{% if PEACHJAM_SETTINGS.facebook_link or PEACHJAM_SETTINGS.twitter_link %}
{% include 'peachjam/_social_media.html' %}
{% endif %}
{% endblock %}
<hr/>
<div class="row">
<div class="col-lg-4">
{% block first-content-column %}
Expand Down
43 changes: 43 additions & 0 deletions peachjam/templates/peachjam/_mailchimp_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% load i18n %}
<h5 class="mb-2">
{% block newsletter-title %}
{% trans 'Subscribe' %}
{% endblock %}
</h5>
<div class="row">
<div class="col-12 col-md-6 mb-3">
<p class="lead mb-0">
{% block newsletter-blurb %}
{% trans 'Subscribe to our newsletter for updates and news.' %}
{% endblock %}
</p>
</div>
<div class="col-12 col-md-6 mb-3">
{% block newsletter-form-code %}
<form action="{{ PEACHJAM_SETTINGS.mailchimp_form_url }}"
method="post"
name="mc-embedded-subscribe-form"
target="_blank">
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<input type="text"
name="b_4f4bdccc4d82422fd556af74f_da4493f83c"
tabindex="-1"
value=""/>
</div>
<div class="input-group">
<input type="email"
value=""
name="EMAIL"
class="form-control"
placeholder="email address"
required=""/>
<input type="submit"
value="Subscribe"
name="subscribe"
class="btn btn-secondary"/>
</div>
</form>
{% endblock %}
</div>
</div>
23 changes: 0 additions & 23 deletions sierralii/templates/peachjam/_footer.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
{% extends "peachjam/_footer.html" %}
{% load static i18n %}
{% block newsletter-form-code %}
<form action=""
method="post"
name="mc-embedded-subscribe-form"
target="_blank">
<div style="position: absolute; left: -5000px;" aria-hidden="true">
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<input type="text" name="" tabindex="-1" value=""/>
</div>
<div class="input-group">
<input type="email"
value=""
name="EMAIL"
class="form-control"
placeholder="email address"
required=""/>
<input type="submit"
value="Subscribe"
name="subscribe"
class="btn btn-secondary"/>
</div>
</form>
{% endblock %}
{% block about %}
<p>
SierraLII provides free, unrestricted access to the primary and secondary legal materials of Sierra Leone. Free Access to Law supports the rule of law, access to justice and transparency.
Expand Down
Loading

0 comments on commit 844ed8c

Please sign in to comment.