Skip to content

Commit

Permalink
makes surveys configurable from admin
Browse files Browse the repository at this point in the history
  • Loading branch information
actlikewill committed Aug 28, 2024
1 parent 1f3177e commit 6dda48b
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 142 deletions.
4 changes: 4 additions & 0 deletions liiweb/templates/liiweb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% block title %}
{% trans 'Home' %}
{% endblock %}
{% block survey-banner %}{% endblock %}
{% block page-content %}
{% block hero %}
<section class="hero">
Expand Down Expand Up @@ -39,6 +40,9 @@ <h4 class="mb-4">
{% endblock %}
{% endblock %}
{% block after-search %}{% endblock %}
{% if PEACHJAM_SETTINGS.survey_link %}
{% include "peachjam/_survey_banner_lg.html" %}
{% endif %}
{% block about %}
<section class="mt-2">
<div class="container">
Expand Down
7 changes: 7 additions & 0 deletions liiweb/templates/peachjam/layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
href="{% sass_src 'stylesheets/liiweb.scss' %}"
type="text/css"/>
{% endblock %}
{% block before-content %}
{% block survey-banner %}
{% if PEACHJAM_SETTINGS.survey_link %}
{% include "peachjam/_survey_banner_sm.html" %}
{% endif %}
{% endblock %}
{% endblock %}
25 changes: 0 additions & 25 deletions malawilii/templates/liiweb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,6 @@ <h4 class="mb-4">
{% endblocktrans %}
</h4>
{% endblock %}
{% block after-search %}
<div class="bg-primary py-4">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
<h1 class="text-white fw-bold pe-lg-8">{% trans 'Take the MalawiLII Survey' %}</h1>
{% blocktrans %}
<p class="text-white mb-4 h5 fw-bold">
Help us make Malawi legal information more freely accessible to everyone.
Take this short 5 minute survey on your usage of the platform and your general experience using the site.
All information shared is confidential.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-center pt-6">
<a target="_blank"
href="https://forms.gle/3KQZrVQZNvt7xJj78"
class="text-white btn btn-lg btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
{% endblock %}
{% block second-col-about %}
<p class="lead">
{% blocktrans trimmed %}
Expand Down
22 changes: 0 additions & 22 deletions malawilii/templates/peachjam/layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,3 @@
href="{% sass_src 'stylesheets/malawilii.scss' %}"
type="text/css"/>
{% endblock %}
{% block before-content %}
<div class="bg-primary py-3">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
{% blocktrans %}
<p class="text-white m-0 fw-bold">
Help us improve MalawiLII. Take this short 5 minute survey on your usage of the platform and your general experience using the site.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-center pt-6">
<a target="_blank"
href="https://forms.gle/3KQZrVQZNvt7xJj78"
class="text-white btn btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
{% endblock %}
5 changes: 5 additions & 0 deletions peachjam/models/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ class PeachJamSettings(SingletonModel):
blank=True,
help_text=_("Matomo site ID (e.g. 2)"),
)
survey_link = models.URLField(
_("survey link"),
null=True,
blank=True,
)

class Meta:
verbose_name = verbose_name_plural = _("site settings")
Expand Down
24 changes: 24 additions & 0 deletions peachjam/templates/peachjam/_survey_banner_lg.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% load i18n %}
<div class="bg-primary py-4">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
{% blocktrans %}
<h1 class="text-white fw-bold pe-lg-8">Take the {{ APP_NAME }} Survey</h1>
<p class="text-white mb-4 h5 fw-bold">
Help us make {{ APP_NAME }} better.
Take this short 5 minute survey and tell us about how you use {{ APP_NAME }} and how we can improve it.
All information shared is confidential.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-lg-center pt-6">
<a target="_blank"
href="{{ PEACHJAM_SETTINGS.survey_link }}"
class="text-white btn btn-lg btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
21 changes: 21 additions & 0 deletions peachjam/templates/peachjam/_survey_banner_sm.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% load i18n %}
<div class="bg-primary py-3">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
{% blocktrans %}
<p class="text-white m-lg-0 fw-bold">
Help us make {{ APP_NAME }} better. Take this short 5 minute survey and tell us about how you use {{ APP_NAME }} and how we can improve it. All information shared is confidential
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-lg-center pt-6">
<a target="_blank"
href="{{ PEACHJAM_SETTINGS.survey_link }}"
class="text-white btn btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
26 changes: 0 additions & 26 deletions tanzlii/templates/liiweb/home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "liiweb/home.html" %}
{% load static i18n %}
{% block before-content %}{% endblock %}
{% block hero-logos %}
<img src="{% static 'images/judiciary_of_tanzania.png' %}"
alt="judiciary-of-tanzania-logo"/>
Expand All @@ -24,28 +23,3 @@
We aim to support the rule of law by publishing the law of Tanzania for free online access.
{% endblocktrans %}
{% endblock %}
{% block after-search %}
<div class="bg-primary py-5">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
<h1 class="text-white fw-bold pe-lg-8">{% trans 'Take the TanzLII Survey' %}</h1>
{% blocktrans %}
<p class="text-white mb-4 h5 fw-bold">
Help us make Tanzanian legal information more freely accessible to everyone.
Take this short 5 minute survey on your usage of the platform and your general experience using the site.
All information shared is confidential.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-center pt-6">
<a target="_blank"
href="https://forms.gle/KdvJxkaM1otDBAsz8"
class="text-white btn btn-lg btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
{% endblock %}
22 changes: 0 additions & 22 deletions tanzlii/templates/peachjam/layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,3 @@
href="{% sass_src 'stylesheets/tanzlii.scss' %}"
type="text/css"/>
{% endblock %}
{% block before-content %}
<div class="bg-primary py-3">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
{% blocktrans %}
<p class="text-white m-0 fw-bold">
Help us improve TanzLII. Take this short 5 minute survey on your usage of the platform and your general experience using the site.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-center pt-6">
<a target="_blank"
href="https://forms.gle/KdvJxkaM1otDBAsz8"
class="text-white btn btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
{% endblock %}
25 changes: 0 additions & 25 deletions zambialii/templates/liiweb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,6 @@ <h4 class="mb-4">
{% endblocktrans %}
</h4>
{% endblock %}
{% block after-search %}
<div class="bg-primary py-5">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
<h1 class="text-white fw-bold pe-lg-8">{% trans 'Take the ZambiaLII Survey' %}</h1>
{% blocktrans %}
<p class="text-white mb-4 h5 fw-bold">
Help us make Zambian legal information more freely accessible to everyone.
Take this short 5 minute survey on your usage of the platform and your general experience using the site.
All information shared is confidential.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-center pt-6">
<a target="_blank"
href="https://forms.gle/dETZD858WR4hMuAR8"
class="text-white btn btn-lg btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
{% endblock %}
{% block second-col-about %}
<p class="lead">
{% blocktrans trimmed %}
Expand Down
22 changes: 0 additions & 22 deletions zambialii/templates/peachjam/layouts/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,3 @@
href="{% sass_src 'stylesheets/zambialii.scss' %}"
type="text/css"/>
{% endblock %}
{% block before-content %}
<div class="bg-primary py-3">
<div class="container">
<div class="row align-items-center g-0">
<div class="col-xl-6 col-lg-6 col-md-12">
<div>
{% blocktrans %}
<p class="text-white m-0 fw-bold">
Help us improve ZambiaLII. Take this short 5 minute survey on your usage of the platform and your general experience using the site.
</p>
{% endblocktrans %}
</div>
</div>
<div class=" col-xl-6 col-lg-6 col-md-12 text-center pt-6">
<a target="_blank"
href="https://forms.gle/dETZD858WR4hMuAR8"
class="text-white btn btn-danger"><span class="fw-bold">Take the survey</span></a>
</div>
</div>
</div>
</div>
{% endblock %}

0 comments on commit 6dda48b

Please sign in to comment.