diff --git a/.style.yapf b/.style.yapf index 03ac89877..841a11856 100644 --- a/.style.yapf +++ b/.style.yapf @@ -1,7 +1,8 @@ [style] based_on_style = pep8 spaces_before_comment = 2 -split_before_logical_operator = true +split_before_logical_operator = false each_dict_entry_on_separate_line = true coalesce_brackets = false -indent_dictionary_value = true \ No newline at end of file +indent_dictionary_value = true +split_before_named_assigns = false \ No newline at end of file diff --git a/plinth/modules/syncthing/manifest.py b/plinth/modules/syncthing/manifest.py index da00f1545..837cad950 100644 --- a/plinth/modules/syncthing/manifest.py +++ b/plinth/modules/syncthing/manifest.py @@ -16,6 +16,7 @@ # from django.utils.translation import ugettext_lazy as _ +from plinth.templatetags.plinth_extras import Desktop_OS, Mobile_OS, Store metadata = { 'syncthing': { @@ -45,21 +46,21 @@ clients = [{ .format(metadata['syncthing']['version']) }, { 'type': 'download', - 'os': 'GNU/Linux', + 'os': Desktop_OS.GNU_LINUX.value, 'arch': 'amd64', 'url': 'https://github.com/syncthing/syncthing/releases/' 'download/v{0}/syncthing-linux-amd64-v{0}.tar.gz' .format(metadata['syncthing']['version']), }, { 'type': 'download', - 'os': 'macOS', + 'os': Desktop_OS.MAC_OS.value, 'arch': 'amd64', 'url': 'https://github.com/syncthing/syncthing/releases/' 'download/v{0}/syncthing-macosx-amd64-v{0}.tar.gz' .format(metadata['syncthing']['version']), }, { 'type': 'download', - 'os': 'Windows', + 'os': Desktop_OS.WINDOWS.value, 'arch': 'amd64', 'url': 'https://github.com/syncthing/syncthing/releases/' 'download/v{0}/syncthing-windows-amd64-v{0}.zip' @@ -68,9 +69,9 @@ clients = [{ 'type': 'store', 'os': - 'Android', + Mobile_OS.ANDROID.value, 'store_name': - 'google_play_store', + Store.GOOGLE_PLAY.value, 'fully_qualified_name': 'com.nutomic.syncthingandroid', 'url': @@ -80,9 +81,9 @@ clients = [{ 'type': 'store', 'os': - 'Android', + Mobile_OS.ANDROID.value, 'store_name': - 'fdroid_store', + Store.F_DROID.value, 'fully_qualified_name': 'com.nutomic.syncthingandroid', 'url': diff --git a/plinth/templates/clients.html b/plinth/templates/clients.html index 778a729b0..ad54c01e1 100644 --- a/plinth/templates/clients.html +++ b/plinth/templates/clients.html @@ -60,50 +60,39 @@ {% for platform in client.platforms %} {% if platform.type == 'download' %}
- - {% if platform.os == 'Windows' %} - - {% elif platform.os == 'macOS' %} - - {% elif platform.os == 'GNU/Linux' %} - - {% endif %} - + + {% with 'theme/icons/'|add:platform.os|add:'.png' as icon %} + + {% endwith %} +
- {% endif %} + {% endif %} {% endfor %} {% endif %} - {% endfor %} + {% endfor %} {% endif %} {% if clients|has_mobile_clients %}
- {% load static %} -

{% trans "Mobile Clients" %}:

+ {% load static %} +

{% trans "Mobile Clients" %}: