Skip to content

Commit bca4fe6

Browse files
committed
add invite pages
1 parent 511b60f commit bca4fe6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2312
-270
lines changed

erlang_ls.config

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#otp_path: "/usr/lib/erlang"
22
#plt_path: "_build/default/rebar3_24.3.3_plt"
3-
#code_reload:
4-
# node: ejabberd@localhost
5-
apps_dirs:
6-
- "_build/default/lib/*"
3+
code_reload:
4+
node: ejabberd@localhost
5+
#apps_dirs:
6+
# - "_build/default/lib/*"
77
deps_dirs:
8+
- "_checkouts/xmpp"
89
- "_build/default/lib/*"
910
include_dirs:
11+
- "_checkouts/xmpp/include"
1012
- "_build/default/lib"
1113
- "_build/default/lib/*/include"
1214
- "include"

include/mod_invites.hrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}).
99

1010
-define(INVITE_TOKEN_EXPIRE_SECONDS_DEFAULT, 5*86400).
11-
-define(INVITE_TOKEN_LENGTH_DEFAULT, 16).
11+
-define(INVITE_TOKEN_LENGTH_DEFAULT, 24).
1212

1313
-define(NS_INVITE_INVITE, <<"urn:xmpp:invite#invite">>).
1414
-define(NS_INVITE_CREATE_ACCOUNT, <<"urn:xmpp:invite#create-account">>).

priv/mod_invites/apps.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<div class="container">
2+
<div class="row">
3+
{% for item in apps %}
4+
<div class="card m-3 client-card {% for platform in item.platforms %}app-platform-{{ platform|lower }} {% endfor %} flex-wrap col-sm-12 col-md-8 col-lg-5">
5+
<div class="row no-gutters h-100">
6+
<div class="col-md-4">
7+
<img src="{{ static }}/{{ item.image }}" class="p-2 img-fluid" alt="{{ item.imagetext }}">
8+
</div>
9+
<div class="col-md-8">
10+
<div class="card-body d-flex flex-column h-100">
11+
<h5 class="card-title text-nowrap mb-1">{{ item.name }}</h5>
12+
<div>
13+
{% for platform in item.platforms %}<span class="badge badge-info client-platform-badge client-platform-badge-{{ platform|lower }} mr-1 mb-3">{{ platform }}</span>{% endfor %}
14+
</div>
15+
<p class="card-text">{{ item.text }}</p>
16+
<a href="{{ item.proceed_url }}" class="btn btn-primary mt-md-auto">{% if item.select_text %}{{ item.select_text }}{% else %}{% trans "Select" %}{% endif %}</a>
17+
</div>
18+
</div>
19+
</div>
20+
</div>
21+
{% endfor %}
22+
</div>
23+
</div>
24+
<div id="show-all-clients-button-container" class="d-none alert alert-info">
25+
{% trans "Showing apps for <span class='platform-name'>your current platform</span> only. You may also <a href='#' id='show-all-clients-button'>view all apps.</a>" %}
26+
</div>

priv/mod_invites/apps.json

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
[
2+
{
3+
"download": {
4+
"buttons": [
5+
{
6+
"image": "https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",
7+
"url": "https://play.google.com/store/apps/details?id=eu.siacs.conversations",
8+
"magic_link_format": "https://play.google.com/store/apps/details?id=eu.siacs.conversations&referrer={{ uri }}"
9+
}
10+
]
11+
},
12+
"image": "logos/conversations.svg",
13+
"link": "https://play.google.com/store/apps/details?id=eu.siacs.conversations",
14+
"magic_link_format": "https://play.google.com/store/apps/details?id=eu.siacs.conversations&referrer={{ uri }}",
15+
"name": "Conversations",
16+
"platforms": [
17+
"Android"
18+
],
19+
"supports_preauth_uri": true,
20+
"text": "{% trans "Conversations is a Jabber/XMPP client for Android 6.0+ smartphones that has been optimized to provide a unique mobile experience." %}"
21+
},
22+
{
23+
"download": {
24+
"buttons": [
25+
{
26+
"image": "https://toolbox.marketingtools.apple.com/api/v2/badges/download-on-the-app-store/black/en-us?releaseDate=1245024000",
27+
"target": "_blank",
28+
"url": "https://apps.apple.com/app/id317711500"
29+
}
30+
]
31+
},
32+
"image": "logos/monal-tmp.svg",
33+
"link": "https://monal-im.org/",
34+
"name": "Monal",
35+
"platforms": [
36+
"iOS", "iPadOS"
37+
],
38+
"supports_preauth_uri": true,
39+
"text": "{% trans "A modern open-source chat client for iPhone and iPad. It is easy to use and has a clean user interface." %}"
40+
},
41+
{
42+
"download": {
43+
"buttons": [
44+
{
45+
"image": "https://toolbox.marketingtools.apple.com/api/v2/badges/download-on-the-app-store/black/en-us?releaseDate=1245024000",
46+
"target": "_blank",
47+
"url": "https://apps.apple.com/app/id1637078500"
48+
}
49+
]
50+
},
51+
"image": "logos/monal-tmp.svg",
52+
"link": "https://monal-im.org/",
53+
"name": "Monal (macOS)",
54+
"platforms": [
55+
"macOS"
56+
],
57+
"supports_preauth_uri": true,
58+
"text": "{% trans "A modern open-source chat client for Mac. It is easy to use and has a clean user interface." %}"
59+
},
60+
{
61+
"download": {
62+
"buttons": [
63+
{
64+
"image": "https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png",
65+
"url": "https://play.google.com/store/apps/details?id=org.yaxim.androidclient",
66+
"magic_link_format": "https://play.google.com/store/apps/details?id=org.yaxim.androidclient&referrer={{ invite.uri }}"
67+
}
68+
]
69+
},
70+
"image": "logos/yaxim.svg",
71+
"link": "https://play.google.com/store/apps/details?id=org.yaxim.androidclient",
72+
"magic_link_format": "https://play.google.com/store/apps/details?id=org.yaxim.androidclient&referrer={{ invite.uri }}",
73+
"name": "yaxim",
74+
"platforms": [
75+
"Android"
76+
],
77+
"supports_preauth_uri": true,
78+
"text": "{% trans "A lean Jabber/XMPP client for Android. It aims at usability, low overhead and security, and works on low-end Android devices starting with Android 4.0." %}"
79+
},
80+
{
81+
"download": {
82+
"buttons": [
83+
{
84+
"image": "https://toolbox.marketingtools.apple.com/api/v2/badges/download-on-the-app-store/black/en-us?releaseDate=1245024000",
85+
"target": "_blank",
86+
"url": "https://apps.apple.com/us/app/siskin-im/id1153516838"
87+
}
88+
]
89+
},
90+
"image": "logos/siskin-im.png",
91+
"link": "https://apps.apple.com/us/app/siskin-im/id1153516838",
92+
"name": "Siskin IM",
93+
"platforms": [
94+
"iOS", "iPadOS"
95+
],
96+
"supports_preauth_uri": true,
97+
"text": "{% trans "A lightweight and powerful XMPP client for iPhone and iPad. It provides an easy way to talk and share moments with your friends." %}"
98+
},
99+
{
100+
"download": {
101+
"buttons": [
102+
{
103+
"target": "_blank",
104+
"text": "{% trans "Download from Mac App Store" %}",
105+
"url": "https://apps.apple.com/us/app/beagle-im/id1445349494"
106+
}
107+
]
108+
},
109+
"image": "logos/beagle-im.png",
110+
"link": "https://apps.apple.com/us/app/beagle-im/id1445349494",
111+
"name": "Beagle IM",
112+
"platforms": [
113+
"macOS"
114+
],
115+
"setup": {
116+
"text": "{% trans "Launch Beagle IM, and select 'Yes' to add a new account. Click the '+' button under the empty account list and then enter your credentials." %}"
117+
},
118+
"text": "{% trans "Beagle IM by Tigase, Inc. is a lightweight and powerful XMPP client for macOS." %}"
119+
},
120+
{
121+
"download": {
122+
"buttons": [
123+
{
124+
"target": "_blank",
125+
"text": "{% trans "Download Dino for Linux" %}",
126+
"url": "https://dino.im/#download"
127+
}
128+
],
129+
"text": "{% trans "Click the button to open the Dino website where you can download and install it on your PC." %}"
130+
},
131+
"image": "logos/dino.svg",
132+
"link": "https://dino.im/",
133+
"name": "Dino",
134+
"platforms": [
135+
"Linux"
136+
],
137+
"text": "{% trans "A modern open-source chat client for the desktop. It focuses on providing a clean and reliable Jabber/XMPP experience while having your privacy in mind." %}"
138+
},
139+
{
140+
"download": {
141+
"buttons": [
142+
{
143+
"target": "_blank",
144+
"text": "{% trans "Download Gajim" %}",
145+
"url": "https://gajim.org/download/"
146+
}
147+
]
148+
},
149+
"image": "logos/gajim.svg",
150+
"link": "https://gajim.org/",
151+
"name": "Gajim",
152+
"platforms": [
153+
"Windows",
154+
"Linux"
155+
],
156+
"text": "{% trans "A fully-featured desktop chat client for Windows and Linux." %}"
157+
},
158+
{
159+
"download": {
160+
"buttons": [
161+
{
162+
"target": "_blank",
163+
"text": "{% trans "Download Renga for Haiku" %}",
164+
"url": "https://depot.haiku-os.org/#!/pkg/renga?bcguid=bc233-PQIA"
165+
}
166+
]
167+
},
168+
"image": "logos/renga.svg",
169+
"link": "https://pulkomandy.tk/projects/renga",
170+
"name": "Renga",
171+
"platforms": [
172+
"Haiku"
173+
],
174+
"text": "{% trans "XMPP client for Haiku" %}"
175+
}
176+
]

priv/mod_invites/base.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{% extends "base_min.html" %}
2+
3+
{% block rel_alternate %}
4+
<link rel="alternate" href="{{ uri }}">
5+
{% endblock %}
6+
7+
{% block qr_button %}
8+
<div id="qr-button-container" class="float-right w-25 border border-info p-3 d-none">
9+
{% trans "<strong>Tip:</strong> You can open this invite on your mobile device by scanning a barcode with your camera." %}
10+
<button id="qr-modal-show" class="mt-2 d-block btn btn-info" title="{% trans "Send this invite to your device" %}"
11+
data-toggle="modal" data-target="#qr-modal">
12+
<img src="{{ static }}/qr-logo.png" alt="{% trans "QR code icon" %}" class="align-middle h-50 mt-1" style="display:inline" >
13+
{% trans "Scan with mobile device" %}
14+
</button>
15+
</div>
16+
{% endblock %}
17+
18+
{% block qr_code %}
19+
<div class="modal" tabindex="-1" role="dialog" id="qr-modal">
20+
<div class="modal-dialog" role="document">
21+
<div class="modal-content">
22+
<div class="modal-header">
23+
<h5 class="modal-title">{% trans "Scan invite code" %}</h5>
24+
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
25+
<span aria-hidden="true">&times;</span>
26+
</button>
27+
</div>
28+
<div class="modal-body">
29+
<p>{% trans "You can transfer this invite to your mobile device by scanning a code with your camera." %}</p>
30+
<div id="qr-info-url" class="tab-pane show active">
31+
<p>{% trans "Use a <em>QR code</em> scanner on your mobile device to scan the code below:" %}</p>
32+
<div id="qr-invite-page" style="width: 304px;" class="bg-white p-4 mx-auto"></div>
33+
</div>
34+
</div>
35+
<div class="modal-footer">
36+
<button type="button" class="btn btn-primary" data-dismiss="modal">{% trans "Close" %}</button>
37+
</div>
38+
</div>
39+
</div>
40+
</div>
41+
{% endblock %}
42+
43+
{% block extra_scripts %}
44+
<script src="{{ static }}/qrcode.min.js"></script>
45+
<script src="{{ static }}/platform.min.js"></script>
46+
<script src="{{ static }}/invite.js"></script>
47+
{% endblock %}

priv/mod_invites/base_min.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>{% block title %}{% blocktrans %}Invite to {{ site_name }}{% endblocktrans %}{% endblock %}</title>
7+
{% block rel_alternate %}{% endblock %}
8+
<link rel="stylesheet" href="/share/bootstrap4/css/bootstrap.min.css">
9+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
10+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
11+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
12+
<link rel="manifest" href="/site.webmanifest">
13+
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
14+
<meta name="msapplication-TileColor" content="#fbd308">
15+
<meta name="theme-color" content="#fbd308">
16+
</head>
17+
<body>
18+
<div id="background" class="fixed-top overflow-hidden"></div>
19+
<div id="form" class="{% block form_class %}container col-md-10 col-md-offset-1 col-sm-8 col-sm-offset-2 col-lg-10 col-lg-offset-1 mt-2 mt-md-5{% endblock %}">
20+
<div class="card rounded-lg shadow">
21+
<h1 class="card-header rounded-lg rounded-lg">
22+
{%block h1 %}{% blocktrans %}Invite to {{ site_name }}{% endblocktrans %}{% endblock %}<br/>
23+
</h1>
24+
<div class="card-body">
25+
{% block qr_button %}{% endblock %}
26+
{% block content %}{% endblock %}
27+
</div>
28+
</div>
29+
</div>
30+
{% block qr_code %}{% endblock %}
31+
{% block extra_scripts %}{% endblock %}
32+
<script src="/share/jquery/jquery.min.js"></script>
33+
<script src="/share/bootstrap4/js/bootstrap.min.js"></script>
34+
</body>
35+
</html>

priv/mod_invites/client.html

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{% extends "base.html" %}
2+
3+
{% block h1 %}
4+
{% blocktrans with app_name=app.name %}Join {{ site_name }} with {{ app_name }}{% endblocktrans %}
5+
{% endblock %}
6+
7+
{% block content %}
8+
<p>{% if invite.inviter|user %}
9+
{% blocktrans with inviter=invite.inviter|user %}You have been invited to chat with <strong>{{ inviter }}</strong> on {{ site_name }}, part of the XMPP secure and decentralized messaging network.{% endblocktrans %}
10+
{% else %}
11+
{% blocktrans %}You have been invited to chat on {{ site_name }}, part of the XMPP secure and decentralized messaging network.{% endblocktrans %}
12+
{% endif %}
13+
</p>
14+
15+
<p>{% blocktrans with app_name=app.name %}You can start chatting right away with {{ app_name }}. Let's get started!{% endblocktrans %}</p>
16+
17+
<div class="card m-3 client-card {% for item in app.platforms %}app-platform-{{ item|lower }} {% endfor %} flex-wrap col-sm-12 col-md-8 col-lg-5">
18+
<div class="row no-gutters h-100">
19+
<div class="col-md-4">
20+
<img src="{{ static }}/{{ app.image }}" class="p-2 img-fluid" alt="{{ app.imagetext }}">
21+
</div>
22+
<div class="col-md-8 h-100">
23+
<div class="card-body d-flex flex-column h-100">
24+
<h5 class="card-title text-nowrap mb-1">{{ app.name }}</h5>
25+
<div>
26+
{% for item in app.platforms %}<span class="badge badge-info client-platform-badge client-platform-badge-{{ item|lower }} mr-1 mb-3">{{ item }}</span> {% endfor %}
27+
</div>
28+
<p class="card-text">{{ app.text }}</p>
29+
</div>
30+
</div>
31+
</div>
32+
</div>
33+
34+
<h3 style="clear:both">{% blocktrans with app_name=app.name %}Step 1: Install {{ app_name }}{% endblocktrans %}</h3>
35+
36+
<p>{% if app.download.text %}{{ app.download.text }}{% else %}{% blocktrans with app_name=app.name %}Download and install {{ app_name }} below:{% endblocktrans %}{% endif %}</p>
37+
38+
<div class="ml-5">
39+
{% for button in app.download.buttons %}
40+
{% if button.image %}
41+
<a href="{% if button.magic_link %}{{ button.magic_link }}{% else %}{{ button.url }}{% endif %}" {% if button.target %}target="{{ button.target }}"{% endif %} rel="noopener">
42+
<img src="{{ button.image }}" {% if button.alttext %}alt="{{ button.alttext }}"{% endif %} style="max-width: 160px;">
43+
</a>
44+
{% endif %}
45+
{% if button.text %}
46+
<a href="{{ button.url }}" {% if button.target %}target="{{ button.target }}"{% endif %} class="btn btn-primary" rel="noopener">
47+
{{ button.text }}
48+
</a>
49+
{% endif %}
50+
{% endfor %}
51+
</div>
52+
53+
<p class="mt-3">{% blocktrans with app_name=app.name %}After successfully installing {{ app_name }}, come back to this page and <strong>continue with Step 2</strong>.{% endblocktrans %}</p>
54+
55+
<h3>{% trans "Step 2: Activate your account" %}</h3>
56+
57+
<p>{% trans "Installed ok? Great! <strong>Click or tap the button below</strong> to accept your invite and continue with your account setup:" %}</p>
58+
59+
<div>
60+
<a href="{{ uri }}" id="uri-cta" class="btn btn-primary ml-5 mt-1 mb-3">{% blocktrans with app_name=app.name %}Accept invite using {{ app_name }}{% endblocktrans %}</a><br/>
61+
</div>
62+
63+
<p>{% blocktrans with app_name=app.name %}After clicking the button you will be taken to {{ app_name }} to finish setting up your new {{ site_name }} account.{% endblocktrans %}</p>
64+
{% endblock %}
65+
66+
{% block extra_scripts %}
67+
<script src="{{ static }}/qrcode.min.js"></script>
68+
<script src="{{ static }}/platform.min.js"></script>
69+
<script src="{{ static }}/invite.js"></script>
70+
{% endblock %}

0 commit comments

Comments
 (0)