From 7b3c1d5ab90038860f9b8aa71efc600b07e2c53a Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sat, 2 Dec 2023 00:41:36 +0100 Subject: [PATCH] streamline index.html --- deploy-chatmail/src/deploy_chatmail/genqr.py | 17 +---------------- .../src/deploy_chatmail/nginx/index.html.j2 | 15 +++++++++++---- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/deploy-chatmail/src/deploy_chatmail/genqr.py b/deploy-chatmail/src/deploy_chatmail/genqr.py index 605c14ec..cd360f55 100644 --- a/deploy-chatmail/src/deploy_chatmail/genqr.py +++ b/deploy-chatmail/src/deploy_chatmail/genqr.py @@ -17,13 +17,6 @@ def gen_qr_png_data(maildomain): def gen_qr(maildomain, url): info = f"{maildomain} invite code" - steps = ( - "1. Install https://get.delta.chat\n" - "2. On setup screen scan above invite QR code\n" - "3. Choose nickname & avatar\n" - "+ chat with any e-mail address ...\n" - ) - # load QR code qr = qrcode.QRCode( version=1, @@ -47,11 +40,10 @@ def gen_qr(maildomain, url): font_size = 16 font = ImageFont.truetype(font=ttf_path, size=font_size) - num_lines = (info + steps).count("\n") + 3 + num_lines = (info).count("\n") + 1 size = width = 384 qr_padding = 6 - text_margin_right = 12 text_height = font_size * num_lines height = size + text_height + qr_padding * 2 @@ -70,13 +62,6 @@ def gen_qr(maildomain, url): draw.multiline_text( (info_pos, size - qr_padding // 2), info, font=font, fill="black", align="right" ) - draw.multiline_text( - (text_margin_right, height - text_height + font_size * 1.0), - steps, - font=font, - fill="black", - align="left", - ) # paste QR code image.paste( diff --git a/deploy-chatmail/src/deploy_chatmail/nginx/index.html.j2 b/deploy-chatmail/src/deploy_chatmail/nginx/index.html.j2 index 3bd998d6..d9687431 100644 --- a/deploy-chatmail/src/deploy_chatmail/nginx/index.html.j2 +++ b/deploy-chatmail/src/deploy_chatmail/nginx/index.html.j2 @@ -4,17 +4,24 @@ chatmail instance -

Welcome to {{ config.mail_domain }}!

-

Tap or Scan this invite code to setup an account for Delta Chat app

+

Getting started

+
    +
  1. Install https://get.delta.chat
  2. +
  3. Scan or Tap on the invite QR code
  4. +
  5. Choose Nickname and Avatar
  6. +
  7. Use QR code invites and scans to setup end-to-end encrypted communication + with any e-mail address
  8. +
-

Properties / Constraints

+ +

Constraints