From bf33a1a49290e7819f662d2155727613299fd87d Mon Sep 17 00:00:00 2001
From: Joseph Nuthalapati
Date: Thu, 16 Nov 2017 18:02:26 +0530
Subject: [PATCH] Make naming convention consistent using enums
Signed-off-by: Joseph Nuthalapati
Reviewed-by: James Valleroy
---
plinth/modules/diaspora/manifest.py | 55 +++--
plinth/modules/ejabberd/manifest.py | 208 ++++++++----------
.../modules/ejabberd/templates/ejabberd.html | 3 +
plinth/modules/ejabberd/views.py | 2 +-
plinth/modules/ikiwiki/manifest.py | 16 +-
plinth/modules/infinoted/manifest.py | 42 ++--
plinth/modules/matrixsynapse/manifest.py | 85 +++----
plinth/modules/minetest/manifest.py | 11 +-
plinth/modules/mumble/manifest.py | 19 +-
plinth/modules/quassel/manifest.py | 57 +++--
plinth/modules/radicale/manifest.py | 91 ++++----
plinth/modules/repro/manifest.py | 15 +-
plinth/modules/restore/manifest.py | 18 +-
plinth/modules/roundcube/manifest.py | 18 +-
plinth/modules/shaarli/manifest.py | 18 +-
plinth/modules/syncthing/manifest.py | 2 +-
plinth/modules/tor/manifest.py | 94 ++++----
plinth/modules/transmission/manifest.py | 18 +-
plinth/modules/ttrss/manifest.py | 48 ++--
plinth/templates/clients.html | 6 +-
20 files changed, 385 insertions(+), 441 deletions(-)
diff --git a/plinth/modules/diaspora/manifest.py b/plinth/modules/diaspora/manifest.py
index 0070a2692..9641fe8bf 100644
--- a/plinth/modules/diaspora/manifest.py
+++ b/plinth/modules/diaspora/manifest.py
@@ -19,32 +19,31 @@ from django.utils.translation import ugettext_lazy as _
from plinth.utils import format_lazy
from . import get_configured_domain_name
+from plinth.templatetags.plinth_extras import Mobile_OS, Store
-clients = [
- {
- 'name': _('dandelion*'),
- 'description': _('It is an unofficial webview based client for the '
- 'community-run, distributed social network diaspora*'),
- 'platforms': [
- {
- 'type': 'store',
- 'os': 'Android',
- 'os_version': '>4.2.0',
- 'store_name': 'fdroid_store',
- 'url': 'https://f-droid.org/repository/browse/?fdid=com'
- '.github.dfa.diaspora_android ',
- 'fully_qualified_name': 'com.github.dfa.diaspora_android'
- }
- ]
- },
- {
- 'name': _('diaspora*'),
- 'platforms': [
- {
- 'type': 'web',
- 'url': format_lazy('https://diaspora.{host}',
- host=get_configured_domain_name())
- }
- ]
- }
-]
+clients = [{
+ 'name':
+ _('dandelion*'),
+ 'description':
+ _('It is an unofficial webview based client for the '
+ 'community-run, distributed social network diaspora*'),
+ 'platforms': [{
+ 'type': 'store',
+ 'os': Mobile_OS.ANDROID.value,
+ 'os_version': '>4.2.0',
+ 'store_name': Store.F_DROID.value,
+ 'url': 'https://f-droid.org/repository/browse/?fdid=com'
+ '.github.dfa.diaspora_android ',
+ 'fully_qualified_name': 'com.github.dfa.diaspora_android'
+ }]
+}, {
+ 'name':
+ _('diaspora*'),
+ 'platforms': [{
+ 'type':
+ 'web',
+ 'url':
+ format_lazy('https://diaspora.{host}',
+ host=get_configured_domain_name())
+ }]
+}]
diff --git a/plinth/modules/ejabberd/manifest.py b/plinth/modules/ejabberd/manifest.py
index ff82d9b03..8cb992adf 100644
--- a/plinth/modules/ejabberd/manifest.py
+++ b/plinth/modules/ejabberd/manifest.py
@@ -18,115 +18,101 @@
from django.utils.translation import ugettext_lazy as _
from plinth.modules.jsxc import manifest as jsxc_manifest
+from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
-clients = [
- {
- 'name': _('yaxim'),
- 'platforms': [
- {
- 'type': 'store',
- 'os': 'Android',
- 'store_name': 'google_play_store',
- 'fully_qualified_name': 'org.yaxim.androidclient',
- 'url': 'https://play.google.com/store/apps/details?id=org'
- '.yaxim.androidclient '
- }]
- },
- {
- 'name': _('Bruno'),
- 'description': _('Bruno is a themed version of the open source '
- 'yaxim app.'),
- 'platforms': [
- {
- 'type': 'store',
- 'os': 'Android',
- 'store_name': 'google_play_store',
- 'fully_qualified_name': 'org.yaxim.bruno',
- 'url': 'https://play.google.com/store/apps/details?id'
- '=org.yaxim.bruno '
- }
- ]
- },
- {
- 'name': _('Chat secure - Encrypted Messenger'),
- 'description': _('ChatSecure is a free and open source '
- 'messaging app that features OTR encryption '
- 'over XMPP. You can connect to an existing '
- 'Google account, create new accounts on '
- 'public XMPP servers (including via Tor), '
- 'or even connect to your own server for '
- 'extra security.'),
- 'platforms': [
- {
- 'type': 'store',
- 'os': 'iOS',
- 'store_name': 'apple_store',
- 'url': 'https://itunes.apple.com/us/app/chatsecure'
- '/id464200063 '
- }
- ]
- },
- {
- 'name': _('Conversations'),
- 'platforms': [
- {
- 'type': 'store',
- 'os': 'Android',
- 'store_name': 'google_play_store',
- 'url': 'https://play.google.com/store/apps/details?id'
- '=eu.siacs.conversations ',
- 'fully_qualified_name': 'eu.siacs.conversations'
- }
- ]
- },
- {
- 'name': _('Dino'),
- 'platforms': [
- {
- 'type': 'download',
- 'os': 'Debian',
- 'url': 'https://download.opensuse.org/repositories/network'
- ':/messaging:/xmpp:/dino/Debian_9.0/amd64/dino_0.0'
- '~git178.9d8e1e8_amd64.deb',
- }
- ]
- },
- {
- 'name': _('Gajim'),
- 'platforms': [
- {
- 'type': 'apt',
- 'os': 'Debian',
- 'package_name': 'gajim'
- },
- {
- 'type': 'download',
- 'os': 'Windows',
- 'url': 'https://gajim.org/downloads/0.16/gajim-0.16.8-2.exe'
- }
- ]
- },
- {
- 'name': _('OneTeam'),
- 'platforms': [
- {
- 'type': 'download',
- 'os': 'Windows',
- 'url': 'https://download.process-one.net/oneteam/release'
- '-installers/OneTeam.msi'
- },
- {
- 'type': 'download',
- 'os': 'macOS',
- 'url': 'https://download.process-one.net/oneteam/release'
- '-installers/OneTeam.dmg '
- },
- {
- 'type': 'download',
- 'os': 'Linux',
- 'url': 'https://download.process-one.net/oneteam/release'
- '-installers/oneteam.tar.bz2 '
- }
- ]
- }
-].append(jsxc_manifest.clients)
+clients = [{
+ 'name':
+ _('yaxim'),
+ 'platforms': [{
+ 'type': 'store',
+ 'os': Mobile_OS.ANDROID.value,
+ 'store_name': Store.GOOGLE_PLAY.value,
+ 'fully_qualified_name': 'org.yaxim.androidclient',
+ 'url': 'https://play.google.com/store/apps/details?id=org'
+ '.yaxim.androidclient '
+ }]
+}, {
+ 'name':
+ _('Bruno'),
+ 'description':
+ _('Bruno is a themed version of the open source '
+ 'yaxim app.'),
+ 'platforms': [{
+ 'type': 'store',
+ 'os': Mobile_OS.ANDROID.value,
+ 'store_name': Store.GOOGLE_PLAY.value,
+ 'fully_qualified_name': 'org.yaxim.bruno',
+ 'url': 'https://play.google.com/store/apps/details?id'
+ '=org.yaxim.bruno '
+ }]
+}, {
+ 'name':
+ _('Chat secure - Encrypted Messenger'),
+ 'description':
+ _('ChatSecure is a free and open source '
+ 'messaging app that features OTR encryption '
+ 'over XMPP. You can connect to an existing '
+ 'Google account, create new accounts on '
+ 'public XMPP servers (including via Tor), '
+ 'or even connect to your own server for '
+ 'extra security.'),
+ 'platforms': [{
+ 'type': 'store',
+ 'os': 'iOS',
+ 'store_name': 'apple_store',
+ 'url': 'https://itunes.apple.com/us/app/chatsecure'
+ '/id464200063 '
+ }]
+}, {
+ 'name':
+ _('Conversations'),
+ 'platforms': [{
+ 'type': 'store',
+ 'os': Mobile_OS.ANDROID.value,
+ 'store_name': Store.GOOGLE_PLAY.value,
+ 'url': 'https://play.google.com/store/apps/details?id'
+ '=eu.siacs.conversations ',
+ 'fully_qualified_name': 'eu.siacs.conversations'
+ }]
+}, {
+ 'name':
+ _('Dino'),
+ 'platforms': [{
+ 'type': 'download',
+ 'os': 'Debian',
+ 'url': 'https://download.opensuse.org/repositories/network'
+ ':/messaging:/xmpp:/dino/Debian_9.0/amd64/dino_0.0'
+ '~git178.9d8e1e8_amd64.deb',
+ }]
+}, {
+ 'name':
+ _('Gajim'),
+ 'platforms': [{
+ 'type': 'apt',
+ 'os': 'Debian',
+ 'package_name': 'gajim'
+ }, {
+ 'type': 'download',
+ 'os': Desktop_OS.WINDOWS.value,
+ 'url': 'https://gajim.org/downloads/0.16/gajim-0.16.8-2.exe'
+ }]
+}, {
+ 'name':
+ _('OneTeam'),
+ 'platforms': [{
+ 'type': 'download',
+ 'os': Desktop_OS.WINDOWS.value,
+ 'url': 'https://download.process-one.net/oneteam/release'
+ '-installers/OneTeam.msi'
+ }, {
+ 'type': 'download',
+ 'os': Desktop_OS.MAC_OS.value,
+ 'url': 'https://download.process-one.net/oneteam/release'
+ '-installers/OneTeam.dmg '
+ }, {
+ 'type': 'download',
+ 'os': 'Linux',
+ 'url': 'https://download.process-one.net/oneteam/release'
+ '-installers/oneteam.tar.bz2 '
+ }]
+}].append(jsxc_manifest.clients)
diff --git a/plinth/modules/ejabberd/templates/ejabberd.html b/plinth/modules/ejabberd/templates/ejabberd.html
index 3d20cae60..c3bbce912 100644
--- a/plinth/modules/ejabberd/templates/ejabberd.html
+++ b/plinth/modules/ejabberd/templates/ejabberd.html
@@ -50,6 +50,9 @@
{% block configuration %}
+
+ {% include "clients.html" with clients=clients %}
+
{% trans "Configuration" %}
-
+
{% if clients|has_web_clients %}
{% for client in clients %}
{% if client|has_web_clients %}
@@ -39,7 +39,7 @@
| Web |
{{ client.name }} |
-
+
|
@@ -89,7 +89,7 @@