Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Use django-cms for most pages #92

Merged
merged 11 commits into from
Jul 10, 2020
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Originally developed as [match4healthcare](https://github.com/match4everyone/mat

TODO

## Change pages
We use the content management system [django-cms](https://www.django-cms.org/) to enable quick edits & translations of most text areas in the application.
The admin interface is accessible at `http://localhost:8000/admin/` with a superuser account.

## Manual Install
### Development
- Build images and run containers
Expand Down
1 change: 1 addition & 0 deletions backend/cms_export.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions backend/match4everyone/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@
SITE_ID = 1
X_FRAME_OPTIONS = "SAMEORIGIN"
CMS_TEMPLATES = [
("home-without_content.html", "Empty page template"),
Baschdl marked this conversation as resolved.
Show resolved Hide resolved
("home.html", "Home page template"),
("about.html", "About page template"),
("impressum.html", "Imprint page template"),
("dataprotection.html", "Data protection page template"),
("terms-of-use.html", "Terms of use page template"),
]

# django-filler config
Expand Down
5 changes: 0 additions & 5 deletions backend/match4everyone/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
path("admin/", admin.site.urls),
path("404/", views.handler404),
path("500/", views.handler500),
path("", views.home),
path("about/", views.about),
path("impressum/", views.impressum),
path("dataprotection/", views.dataprotection),
path("legal-questions/", views.legal_questions),
path("terms-of-use/", views.terms_of_use),
re_path(r"^", include("cms.urls")),
]
5 changes: 3 additions & 2 deletions backend/templates/about.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% load cms_tags %}

{% block title %}
{% blocktrans %}About{% endblocktrans %}
Expand All @@ -9,9 +10,9 @@
{% block content %}
<div class="container">
<div style="height:40px"></div>
<h1 style="text-align:center; font-weight: 300;">{% blocktrans %}We are the team of match4everyone! Muhahaha{% endblocktrans %}</h1>
<h1 style="text-align:center; font-weight: 300;">{% placeholder "introduction" %}</h1>
<hr>
<p class="text-center">match4everyone is free4everyone</p>
<p class="text-center">{% placeholder "explanation" %}</p>
<div style="height:40px"></div>

<!-- dev team -->
Expand Down
18 changes: 3 additions & 15 deletions backend/templates/dataprotection.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% load cms_tags %}

{% block title %}
Datenschutzerklärung
Expand All @@ -21,23 +22,10 @@
<div class="container">
<div style="height:40px"></div>
<div class="impressum">
<h1>Datenschutzerklärung</h1>
<h1>{% placeholder "data protection title" %}</h1>
<div class="row" style="margin-bottom: 55px;">
<div class="col-md-12">
<h4><strong>Datenschutzinformationen</strong></h4>
<p>Vielen Dank f&uuml;r Ihr Interesse an unserer Internetseite. Der Schutz Ihrer personenbezogenen
Daten ist uns wichtig. </p>
<p>Sie finden nachfolgend Informationen dazu, welche personenbezogenen Daten bei dem Besuch und der
Nutzung der Angebote auf unserer Seite www.match4everyone.de erhoben und verarbeitet
werden</p>
<p><strong>Name und Kontaktdaten des Verantwortlichen<br>
</strong>Verantwortlicher i.S.d. Art. 4 Abs. 7 DSGVO:</p>
<p><strong>Name</strong><br>
Someone
<p><strong>Kontaktdaten des Datenschutzbeauftragten</strong><br>
Unser Datenschutzbeauftragter:<br>
Someone
</p>
{% placeholder "data protection text" %}
</div>
</div>
</div>
Expand Down
117 changes: 117 additions & 0 deletions backend/templates/home-without_content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% block title %}
Home
{% endblock %}

{% block header %}

<meta name="description"
content="Der Glaube daran Mitmenschen in Not helfen können, die Liebe zum Fach Medizin und der Zusammenhalt untereinander sind in den letzten Wochen und Monaten im Gesundheitswesen noch viel präsenter denn je.">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it is difficult to make these editable with the cms as it is not WYSIWYG. However, especially these will be edited by social media people, maybe even frequently when changing "campaign slogans" or stuff like that. Would that be possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would wanna use something like https://github.com/nephila/djangocms-page-meta or https://pypi.org/project/django-meta/. Feel free to open an issue for this

<meta name="robots" content="max-snippet:-1, max-image-preview:large, max-video-preview:-1">
<link rel="canonical" href="https://match4everyone.de/">
<meta property="og:title" content="match4everyone - Wir vernetzen Helfende mit Hilfesuchenden.">
<meta property="og:description"
content="Der Glaube daran Mitmenschen in Not helfen können, die Liebe zum Fach Medizin und der Zusammenhalt untereinander sind in den letzten Wochen und Monaten im Gesundheitswesen noch viel präsenter denn je.">
<meta property="og:url" content="https://match4everyone.de/">
<meta property="og:site_name" content="match4everyone">
<meta name="twitter:description"
content="Der Glaube daran Mitmenschen in Not helfen können, die Liebe zum Fach Medizin und der Zusammenhalt untereinander sind in den letzten Wochen und Monaten im Gesundheitswesen noch viel präsenter denn je.">
<meta name="twitter:title" content="match4everyone - Wir vernetzen Helfende mit Hilfesuchenden.">
<style>
body {
margin-top: 0px;
}

.navbar {
background-color: transparent !important;
}

@media only screen and (min-width: 768px) {
.navbar-brand {
display: none;
}

.home-title {

padding: 100px 0px 150px 0px;

}
}

@media only screen and (min-width: 992px) {
.home-title {
padding: 100px 0px 200px 0px;
}
}

@media only screen and (min-width: 1200px) {
.home-title {
padding: 180px 0px 200px 0px;
}
}


@media only screen and (max-width: 767px) {
.logo-header {
display: none;
}

.home-title {
background: #bdcbcc;
padding: 120px 0px 70px 0px;

}

.home-title h1 {
font-size: 2rem;
color: #000943 !important;
text-align: center;
}

.home-box > div > div > div {
padding: 30px 10px 30px 30px;
}

.home-box-description {
margin-bottom: 15px;
}

.navbar {
background-color: #bdcbcc !important;
}
}

.navbar {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}

.hide-home {
display: none;
}

.ml-auto {
margin-left: 0 !important;
margin-right: auto;
}

.navbar.fixed-top {
position: absolute;
}

@media only screen and (min-width: 768px) and (max-width: 991px) {

.navbar > .container {
width: 100%;
max-width: 720px !important;
padding-left: 15px;
padding-right: 0px;
}
}


</style>
{% endblock %}
32 changes: 17 additions & 15 deletions backend/templates/home.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% load cms_tags %}

{% block title %}
Home
{% endblock %}
Expand Down Expand Up @@ -124,7 +126,7 @@
<div class="col-md-8 col-xl-5"><img src="{% static 'img/match4everyone-logo-text.svg' %}" width="640px"
class="logo-header">
<h1 class="text-white font-weight-light">
{% blocktrans %}We match for everyone.{% endblocktrans %}</h1>
{% placeholder "slogan" %}</h1>
</div>
</div>
</div>
Expand All @@ -133,14 +135,13 @@ <h1 class="text-white font-weight-light">
<div class="row align-self-center">
<div class="col-md-6 text-white">
<div class="box-left">
<h2 class="text-white font-weight-light">{% blocktrans %}I am{% endblocktrans %}<br>
<b>{% blocktrans %}A{% endblocktrans %}</b></h2>
<p class="text-white home-box-description">{% blocktrans trimmed %}
I own an ice cream parlor.
{% endblocktrans %}</p>
<h2 class="text-white font-weight-light">
{% placeholder "introduction A" %}<br>
<b>{% placeholder "name A" %}</b></h2>
<p class="text-white home-box-description">{% placeholder "description A" %}</p>
<a href="{% url 'signup' 'A' %}">
<button type="button" class="btn blue text-white btn-lg">
{% blocktrans %}This is me{% endblocktrans %}
{% placeholder "text register button A" %}
<svg class="bi bi-person-plus" style="margin-left:3px;" width="1em" height="1em"
viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
Expand All @@ -155,14 +156,14 @@ <h2 class="text-white font-weight-light">{% blocktrans %}I am{% endblocktrans %}
</div>
<div class="col-md-6">
<div class="box-right">
<h2 class="text-white font-weight-light">{% blocktrans %}I am{% endblocktrans %}<br>
<b>{% blocktrans %}B{% endblocktrans %}</b></h2>
<p class="text-white home-box-description">{% blocktrans %}I feel hungry.{% endblocktrans %}</p>
<h2 class="text-white font-weight-light">
{% placeholder "introduction B" %}<br>
<b>{% placeholder "name B" %}</b></h2>
<p class="text-white home-box-description">{% placeholder "description B" %}</p>
{% if user.is_authenticated and user.is_hospital %}
{% url 'list_by_plz' user.hospital.countrycode user.hospital.plz 10 as filter_student_url %}
<a href="{{ filter_student_url }}"> {% else %} <a href="/matching/signup_b"> {% endif %}
<button type="button" class="btn text-white btn-lg pink">
{% blocktrans %}This is me{% endblocktrans %}
<button type="button" class="btn text-white btn-lg pink">{% placeholder "text register button B" %}
<svg class="bi bi-search" style="margin-left:3px;" width="1em" height="1em"
viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd"
Expand All @@ -183,14 +184,15 @@ <h2 class="text-white font-weight-light">{% blocktrans %}I am{% endblocktrans %}
<div class="col-md-12 col-lg-8" style="text-align: left; margin: 0 auto;">
{% static 'img/match4everyone-logo-text.svg' as static_m4h_svg_url %}
<h2 style="text-align:center; font-size: 1.5rem; font-weight:600; margin-bottom: 15px">
{% blocktrans %}How does this work?{% endblocktrans %}</h2>
{% placeholder "description heading" %}
<hr style="width:60%; margin: 0 auto; margin-bottom:25px; border-width: 2px; ">
<p style="text-align:center;">
{% blocktrans %}We match.{% endblocktrans %}</p>
{% placeholder "description website" %}
</div>
</div>
<div class="col-md-12" style="text-align: left; margin: 0 auto;">
<h2 style="text-align:center; font-size: 1.5rem; font-weight:600; margin-bottom: 55px">{% blocktrans %}another open-source project{% endblocktrans %}</h2>
<h2 style="text-align:center; font-size: 1.5rem; font-weight:600; margin-bottom: 55px">
{% placeholder "more content" %}</h2>
</div>
</main>
{% endblock %}
Loading