Commit 57c44f32 authored by Joseph Nuthalapati's avatar Joseph Nuthalapati Committed by James Valleroy

Add support for iOS AppStore

- iSorted Python imports in all the manifest files
- Some refactoring in plinth_extras
Signed-off-by: Joseph Nuthalapati's avatarJoseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy's avatarJames Valleroy <jvalleroy@mailbox.org>
parent bf33a1a4
......@@ -17,9 +17,10 @@
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Mobile_OS, Store
from plinth.utils import format_lazy
from . import get_configured_domain_name
from plinth.templatetags.plinth_extras import Mobile_OS, Store
clients = [{
'name':
......
......@@ -58,8 +58,8 @@ clients = [{
'extra security.'),
'platforms': [{
'type': 'store',
'os': 'iOS',
'store_name': 'apple_store',
'os': Mobile_OS.IOS.value,
'store_name': Store.APP_STORE.value,
'url': 'https://itunes.apple.com/us/app/chatsecure'
'/id464200063 '
}]
......
......@@ -17,9 +17,9 @@
from django.utils.translation import ugettext_lazy as _
from plinth import cfg
from plinth.templatetags.plinth_extras import Desktop_OS
from plinth.utils import format_lazy
from plinth import cfg
clients = [{
'name':
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
clients = [{
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
clients = [{
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
clients = [{
......@@ -38,9 +39,9 @@ clients = [{
'name': 'mumble'
}, {
'type': 'store',
'os': 'iOS',
'os': Mobile_OS.IOS.value,
'os_version': '>=8.0',
'store_name': 'apple_store',
'store_name': Store.APP_STORE.value,
'url': 'https://itunes.apple.com/us/app/mumble/id443472808'
}]
}, {
......@@ -66,9 +67,9 @@ clients = [{
_('Mumblefly'),
'platforms': [{
'type': 'store',
'os': 'iOS',
'os': Mobile_OS.IOS.value,
'os_version': '>=7.0',
'store_name': 'apple_store',
'store_name': Store.APP_STORE.value,
'url': 'https://itunes.apple.com/dk/app/mumblefy/id858752232'
}]
}]
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
clients = [{
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Mobile_OS, Store
clients = [{
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
clients = [{
......@@ -39,8 +40,8 @@ clients = [{
'.jitsi.meet '
}, {
'type': 'store',
'os': 'iOS',
'store_name': 'apple_store',
'os': Mobile_OS.IOS.value,
'store_name': Store.APP_STORE.value,
'url': 'https://itunes.apple.com/in/app/jitsi-meet/id1165103905'
}, {
'type': 'download',
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
metadata = {
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store
version = '7.0.6'
......
......@@ -16,6 +16,7 @@
#
from django.utils.translation import ugettext_lazy as _
from plinth.templatetags.plinth_extras import Mobile_OS, Store
clients = [{
......
......@@ -85,7 +85,7 @@
<td>
<div class="row">
{% for platform in client.platforms %}
{% if platform.type == 'store' and platform.os == 'android' %}
{% if platform.type == 'store' and platform.os == 'android' or platform.os == 'ios' %}
<div class="col-md-2 col-xs-4">
<a href="{{ platform.url }}">
{% with 'theme/icons/'|add:platform.store_name|add:'.png' as icon %}
......
......@@ -16,16 +16,17 @@
#
import os
from django import template
from enum import Enum
from django import template
register = template.Library()
class Desktop_OS(Enum):
WINDOWS = 'windows'
MAC_OS = 'mac-os'
GNU_LINUX = 'gnu-linux'
MAC_OS = 'mac-os'
WINDOWS = 'windows'
class Mobile_OS(Enum):
......@@ -34,8 +35,13 @@ class Mobile_OS(Enum):
class Store(Enum):
GOOGLE_PLAY = 'google-play'
APP_STORE = 'app-store'
F_DROID = 'f-droid'
GOOGLE_PLAY = 'google-play'
def string_values(enum):
return [x.value for x in list(enum)]
def mark_active_menuitem(menu, path):
......@@ -84,22 +90,21 @@ def __check(clients, cond):
if cond(pf))
@register.filter(name='has_web_clients')
def has_web_clients(clients):
"""Filter to find out whether an application has web clients"""
return __check(clients, lambda x: x['type'] == 'web')
@register.filter(name='has_desktop_clients')
def has_desktop_clients(clients):
"""Filter to find out whether an application has desktop clients"""
return __check(clients,
lambda x: x.get('os', '') in string_values(Desktop_OS))
@register.filter(name='has_mobile_clients')
def has_mobile_clients(clients):
"""Filter to find out whether an application has mobile clients"""
return __check(clients,
lambda x: x.get('os', '') == Mobile_OS.ANDROID.value)
lambda x: x.get('os', '') in string_values(Mobile_OS))
@register.filter(name='has_desktop_clients')
def has_desktop_clients(clients):
"""Filter to find out whether an application has desktop clients"""
return __check(
clients,
lambda x: x.get('os', '') in [x.value for x in list(Desktop_OS)])
@register.filter(name='has_web_clients')
def has_web_clients(clients):
"""Filter to find out whether an application has web clients"""
return __check(clients, lambda x: x['type'] == 'web')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment