✨(project) Django boilerplate
This commit introduces a boilerplate inspired by https://github.com/numerique-gouv/impress. The code has been cleaned to remove unnecessary Impress logic and dependencies. Changes made: - Removed Minio, WebRTC, and create bucket from the stack. - Removed the Next.js frontend (it will be replaced by Vite). - Cleaned up impress-specific backend logics. The whole stack remains functional: - All tests pass. - Linter checks pass. - Agent Connexion sources are already set-up. Why clear out the code? To adhere to the KISS principle, we aim to maintain a minimalist codebase. Cloning Impress allowed us to quickly inherit its code quality tools and deployment configurations for staging, pre-production, and production environments. What’s broken? - The tsclient is not functional anymore. - Some make commands need to be fixed. - Helm sources are outdated. - Naming across the project sources are inconsistent (impress, visio, etc.) - CI is not configured properly. This list might be incomplete. Let's grind it.
This commit is contained in:
committed by
lebaudantoine
parent
2d81979b0a
commit
5b1a2b20de
22
src/mail/bin/html-to-plain-text
Executable file
22
src/mail/bin/html-to-plain-text
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
# Run html-to-text to convert all html files to text files
|
||||
DIR_MAILS="../backend/core/templates/mail/"
|
||||
|
||||
if [ ! -d "${DIR_MAILS}" ]; then
|
||||
mkdir -p "${DIR_MAILS}";
|
||||
fi
|
||||
|
||||
if [ ! -d "${DIR_MAILS}"html/ ]; then
|
||||
mkdir -p "${DIR_MAILS}"html/;
|
||||
exit;
|
||||
fi
|
||||
|
||||
for file in "${DIR_MAILS}"html/*.html;
|
||||
do html-to-text -j ./html-to-text.config.json < "$file" > "${file%.html}".txt; done;
|
||||
|
||||
if [ ! -d "${DIR_MAILS}"text/ ]; then
|
||||
mkdir -p "${DIR_MAILS}"text/;
|
||||
fi
|
||||
|
||||
mv "${DIR_MAILS}"html/*.txt "${DIR_MAILS}"text/;
|
||||
9
src/mail/bin/mjml-to-html
Executable file
9
src/mail/bin/mjml-to-html
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Run mjml command to convert all mjml templates to html files
|
||||
DIR_MAILS="../backend/core/templates/mail/html/"
|
||||
|
||||
if [ ! -d "${DIR_MAILS}" ]; then
|
||||
mkdir -p "${DIR_MAILS}";
|
||||
fi
|
||||
mjml mjml/*.mjml -o "${DIR_MAILS}";
|
||||
11
src/mail/html-to-text.config.json
Normal file
11
src/mail/html-to-text.config.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"wordwrap": 600,
|
||||
"selectors": [
|
||||
{
|
||||
"selector": "h1",
|
||||
"options": {
|
||||
"uppercase": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
54
src/mail/mjml/invitation.mjml
Normal file
54
src/mail/mjml/invitation.mjml
Normal file
@@ -0,0 +1,54 @@
|
||||
<mjml>
|
||||
<mj-include path="./partial/header.mjml" />
|
||||
|
||||
<mj-body mj-class="bg--blue-100">
|
||||
<mj-wrapper css-class="wrapper" padding="0 40px 40px 40px">
|
||||
<mj-section background-url="{% base64_static 'images/mail-header-background.png' %}" background-size="cover" background-repeat="no-repeat" background-position="0 -30px">
|
||||
<mj-column>
|
||||
<mj-image align="center" src="{% base64_static 'images/logo-suite-numerique.png' %}" width="250px" align="left" alt="{%trans 'La Suite Numérique' %}" />
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
<mj-section mj-class="bg--white-100" padding="30px 20px 60px 20px">
|
||||
<mj-column>
|
||||
<mj-text font-size="14px">
|
||||
<p>{% trans "Invitation to join a team" %}</p>
|
||||
</mj-text>
|
||||
|
||||
<!-- Welcome Message -->
|
||||
<mj-text>
|
||||
<h1>{% blocktrans %}Welcome to <strong>Impress</strong>{% endblocktrans %}</h1>
|
||||
</mj-text>
|
||||
<mj-divider border-width="1px" border-style="solid" border-color="#DDDDDD" width="30%" align="left"/>
|
||||
|
||||
<mj-image src="{% base64_static 'images/logo.svg' %}" width="157px" align="left" alt="{%trans 'Logo' %}" />
|
||||
|
||||
<!-- Main Message -->
|
||||
<mj-text>{% trans "We are delighted to welcome you to our community on Impress, your new companion to collaborate on documents efficiently, intuitively, and securely." %}</mj-text>
|
||||
<mj-text>{% trans "Our application is designed to help you organize, collaborate, and manage permissions." %}</mj-text>
|
||||
<mj-text>
|
||||
{% trans "With Impress, you will be able to:" %}
|
||||
<ul>
|
||||
<li>{% trans "Create documents."%}</li>
|
||||
<li>{% trans "Invite members of your document or community in just a few clicks."%}</li>
|
||||
</ul>
|
||||
</mj-text>
|
||||
<mj-button href="//{{site.domain}}" background-color="#000091" color="white" padding-bottom="30px">
|
||||
{% trans "Visit Impress"%}
|
||||
</mj-button>
|
||||
<mj-text>{% trans "We are confident that Impress will help you increase efficiency and productivity while strengthening the bond among members." %}</mj-text>
|
||||
<mj-text>{% trans "Feel free to explore all the features of the application and share your feedback and suggestions with us. Your feedback is valuable to us and will enable us to continually improve our service." %}</mj-text>
|
||||
<mj-text>{% trans "Once again, welcome aboard! We are eager to accompany you on you collaboration adventure." %}</mj-text>
|
||||
|
||||
<!-- Signature -->
|
||||
<mj-text>
|
||||
<p>{% trans "Sincerely," %}</p>
|
||||
<p>{% trans "The La Suite Numérique Team" %}</p>
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
</mj-wrapper>
|
||||
</mj-body>
|
||||
|
||||
<mj-include path="./partial/footer.mjml" />
|
||||
</mjml>
|
||||
|
||||
9
src/mail/mjml/partial/footer.mjml
Normal file
9
src/mail/mjml/partial/footer.mjml
Normal file
@@ -0,0 +1,9 @@
|
||||
<mj-section padding="0">
|
||||
<mj-column>
|
||||
<mj-text mj-class="text--small" align="center" padding="20px 20px">
|
||||
{% blocktranslate with href=site.url name=site.name trimmed %}
|
||||
This mail has been sent to {{email}} by <a href="{{href}}">{{name}}</a>
|
||||
{% endblocktranslate %}
|
||||
</mj-text>
|
||||
</mj-column>
|
||||
</mj-section>
|
||||
46
src/mail/mjml/partial/header.mjml
Normal file
46
src/mail/mjml/partial/header.mjml
Normal file
@@ -0,0 +1,46 @@
|
||||
<mj-head>
|
||||
<mj-title>{{ title }}</mj-title>
|
||||
<mj-preview>
|
||||
<!--
|
||||
We load django tags here, in this way there are put within the body in html output
|
||||
so the html-to-text command includes it within its output
|
||||
-->
|
||||
{% load i18n static extra_tags %}
|
||||
{{ title }}
|
||||
</mj-preview>
|
||||
<mj-attributes>
|
||||
<mj-font name="Roboto" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap" />
|
||||
<mj-all
|
||||
font-family="Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif"
|
||||
font-size="16px"
|
||||
line-height="1.5em"
|
||||
color="#3A3A3A"
|
||||
/>
|
||||
</mj-attributes>
|
||||
<mj-style>
|
||||
/* Reset */
|
||||
h1, h2, h3, h4, h5, h6, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
</mj-style>
|
||||
<mj-style>
|
||||
/* Global styles */
|
||||
h1 {
|
||||
color: #161616;
|
||||
font-size: 2rem;
|
||||
line-height: 1em;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
background: #FFFFFF;
|
||||
border-radius: 0 0 6px 6px;
|
||||
box-shadow: 0 0 6px rgba(2 117 180 / 0.3);
|
||||
}
|
||||
</mj-style>
|
||||
</mj-head>
|
||||
22
src/mail/package.json
Normal file
22
src/mail/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "mail_mjml",
|
||||
"version": "0.1.0",
|
||||
"description": "An util to generate html and text django's templates from mjml templates",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@html-to/text-cli": "0.5.4",
|
||||
"mjml": "4.15.3"
|
||||
},
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build-mjml-to-html": "bash ./bin/mjml-to-html",
|
||||
"build-html-to-plain-text": "bash ./bin/html-to-plain-text",
|
||||
"build": "yarn build-mjml-to-html && yarn build-html-to-plain-text"
|
||||
},
|
||||
"volta": {
|
||||
"node": "16.15.1"
|
||||
},
|
||||
"repository": "https://github.com/numerique-gouv/impress",
|
||||
"author": "DINUM",
|
||||
"license": "MIT"
|
||||
}
|
||||
1292
src/mail/yarn.lock
Normal file
1292
src/mail/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user