diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-10-04 02:43:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 02:43:09 +0300 |
commit | 6ec19d16c4fd4a36649420b9efa12f3e469eaba6 (patch) | |
tree | 3827e3ba41eb43773c809abb70fb21fd1820c28a /plugins/Marketplace/templates | |
parent | 0e6780eb97e3de95f9dbb8412ee91a3a570696b4 (diff) |
Minor marketplace plugin formatting tweak for bundles (#12144)
* Minor marketplace plugin formatting tweak
* fix position of comma
Diffstat (limited to 'plugins/Marketplace/templates')
-rw-r--r-- | plugins/Marketplace/templates/plugin-details.twig | 90 | ||||
-rw-r--r-- | plugins/Marketplace/templates/plugin-list.twig | 42 |
2 files changed, 72 insertions, 60 deletions
diff --git a/plugins/Marketplace/templates/plugin-details.twig b/plugins/Marketplace/templates/plugin-details.twig index 9e44e487ea..8a297c0a82 100644 --- a/plugins/Marketplace/templates/plugin-details.twig +++ b/plugins/Marketplace/templates/plugin-details.twig @@ -7,6 +7,8 @@ {{ errorMessage }} {% elseif plugin %} + {% set isBundle = plugin.isBundle is defined and plugin.isBundle %} + {% if plugin.versions is not empty and plugin.versions[plugin.versions|length - 1] %} {% set latestVersion = plugin.versions[plugin.versions|length - 1] %} {% else %} @@ -176,11 +178,15 @@ <p><br /></p> <dl> - <dt>{{ 'CorePluginsAdmin_Version'|translate }}</dt> - <dd>{{ plugin.latestVersion }}</dd> + {% if not isBundle %} + <dt>{{ 'CorePluginsAdmin_Version'|translate }}</dt> + <dd>{{ plugin.latestVersion }}</dd> + {% endif %} + <dt>{{ 'Marketplace_PluginKeywords'|translate }}</dt> <dd>{{ plugin.keywords|join(', ') }}</dd> - {% if plugin.lastUpdated %} + + {% if plugin.lastUpdated and not isBundle %} <dt>{{ 'Marketplace_LastUpdated'|translate }}</dt> <dd>{{ plugin.lastUpdated }}</dd> {% endif %} @@ -188,50 +194,54 @@ <dt>{{ 'General_Downloads'|translate }}</dt> <dd title="{{ 'Marketplace_NumDownloadsLatestVersion'|translate(latestVersion.numDownloads|number_format) }}">{{ plugin.numDownloads }}</dd> {% endif %} - <dt>{{ 'Marketplace_Developer'|translate }}</dt> - <dd>{{ marketplaceMacro.pluginDeveloper(plugin.owner) }}</dd> - {% if latestVersion and latestVersion.license is defined and latestVersion.license and latestVersion.license.name is defined and latestVersion.license.name %} - <dt>{{ 'Marketplace_License'|translate }}</dt> - <dd> - {% if latestVersion.license.url is defined and latestVersion.license.url %} - <a rel="noreferrer" - href="{{ latestVersion.license.url }}" - target="_blank">{{ latestVersion.license.name }}</a> - {% else %} - {{ latestVersion.license.name }} - {% endif %} - </dd> - {% endif %} - <dt>{{ 'Marketplace_Authors'|translate }}</dt> - <dd>{% for author in plugin.authors if author.name %} - - {% spaceless %} - {% if author.homepage %} - <a target="_blank" rel="noreferrer" href="{{ author.homepage }}">{{ author.name }}</a> - {% elseif author.email %} - <a href="mailto:{{ author.email|escape('url') }}">{{ author.name }}</a> - {% else %} - {{ author.name }} - {% endif %} - {% if loop.index < plugin.authors|length %} - , + {% if not isBundle %} + <dt>{{ 'Marketplace_Developer'|translate }}</dt> + <dd>{{ marketplaceMacro.pluginDeveloper(plugin.owner) }}</dd> + {% if latestVersion and latestVersion.license is defined and latestVersion.license and latestVersion.license.name is defined and latestVersion.license.name %} + <dt>{{ 'Marketplace_License'|translate }}</dt> + <dd> + {% if latestVersion.license.url is defined and latestVersion.license.url %} + <a rel="noreferrer" + href="{{ latestVersion.license.url }}" + target="_blank">{{ latestVersion.license.name }}</a> + {% else %} + {{ latestVersion.license.name }} {% endif %} - {% endspaceless %} - - {% endfor %} - </dd> + </dd> + {% endif %} + <dt>{{ 'Marketplace_Authors'|translate }}</dt> + <dd>{% for author in plugin.authors if author.name %} + + {% spaceless %} + {% if author.homepage %} + <a target="_blank" rel="noreferrer" href="{{ author.homepage }}">{{ author.name }}</a> + {% elseif author.email %} + <a href="mailto:{{ author.email|escape('url') }}">{{ author.name }}</a> + {% else %} + {{ author.name }} + {% endif %} + + {% if loop.index < plugin.authors|length %} + , + {% endif %} + {% endspaceless %} + + {% endfor %} + </dd> + {% endif %} <dt>{{ 'CorePluginsAdmin_Websites'|translate }}</dt> <dd> {% if plugin.homepage %} - <a target="_blank" rel="noreferrer" href="{{ plugin.homepage }}">{{ 'Marketplace_PluginWebsite'|translate }}</a>, - {% endif %} + <a target="_blank" rel="noreferrer" href="{{ plugin.homepage }}">{{ 'Marketplace_PluginWebsite'|translate }}</a> + {%- endif -%} - {% if plugin.changelog is defined and plugin.changelog and plugin.changelog.url is defined and plugin.changelog.url %} - <a target="_blank" rel="noreferrer" href="{{ plugin.changelog.url }}">{{ 'CorePluginsAdmin_Changelog'|translate }}</a>, - {% endif %} + {%- if plugin.changelog is defined and plugin.changelog and plugin.changelog.url is defined and plugin.changelog.url -%} + {%- if plugin.homepage %}, {% endif %} + <a target="_blank" rel="noreferrer" href="{{ plugin.changelog.url }}">{{ 'CorePluginsAdmin_Changelog'|translate }}</a> + {%- endif -%} - <a target="_blank" href="{{ plugin.repositoryUrl }}">GitHub</a> + {%- if plugin.repositoryUrl %}, <a target="_blank" href="{{ plugin.repositoryUrl }}">GitHub</a>{% endif %} </dd> {% if plugin.activity and plugin.activity.numCommits %} diff --git a/plugins/Marketplace/templates/plugin-list.twig b/plugins/Marketplace/templates/plugin-list.twig index ca1ae90334..9577b5c189 100644 --- a/plugins/Marketplace/templates/plugin-list.twig +++ b/plugins/Marketplace/templates/plugin-list.twig @@ -25,29 +25,31 @@ {% endif %} <ul class="metadata"> - <li> - {% if plugin.latestVersion %} - {{ 'CorePluginsAdmin_Version'|translate }}: {{ plugin.latestVersion }} - {% endif %} + {% if plugin.isBundle is not defined or not plugin.isBundle %} + <li> + {% if plugin.latestVersion %} + {{ 'CorePluginsAdmin_Version'|translate }}: {{ plugin.latestVersion }} + {% endif %} - {% if plugin.canBeUpdated %} - <a class="update-available" - {% if plugin.changelog is defined and plugin.changelog and plugin.changelog.url is defined and plugin.changelog.url %} - target="_blank" href="{{ plugin.changelog.url|e('html_attr') }}" - {% else %} - href="#" piwik-plugin-name="{{ plugin.name }}" - {% endif %} - title="{{ 'Marketplace_PluginUpdateAvailable'|translate(plugin.currentVersion, plugin.latestVersion) }}"> - {{ 'Marketplace_NewVersion'|translate }}</a> + {% if plugin.canBeUpdated %} + <a class="update-available" + {% if plugin.changelog is defined and plugin.changelog and plugin.changelog.url is defined and plugin.changelog.url %} + target="_blank" href="{{ plugin.changelog.url|e('html_attr') }}" + {% else %} + href="#" piwik-plugin-name="{{ plugin.name }}" + {% endif %} + title="{{ 'Marketplace_PluginUpdateAvailable'|translate(plugin.currentVersion, plugin.latestVersion) }}"> + {{ 'Marketplace_NewVersion'|translate }}</a> + {% endif %} + </li> + {% if plugin.lastUpdated %} + <li>{{ 'Marketplace_Updated'|translate }}: {{ plugin.lastUpdated }}</li> {% endif %} - </li> - {% if plugin.lastUpdated %} - <li>{{ 'Marketplace_Updated'|translate }}: {{ plugin.lastUpdated }}</li> - {% endif %} - {% if plugin.numDownloads %} - <li>{{ 'General_Downloads'|translate }}: {{ plugin.numDownloads }}</li> + {% if plugin.numDownloads %} + <li>{{ 'General_Downloads'|translate }}: {{ plugin.numDownloads }}</li> + {% endif %} + <li>{{ 'Marketplace_Developer'|translate }}: {{ marketplaceMacro.pluginDeveloper(plugin.owner) }}</li> {% endif %} - <li>{{ 'Marketplace_Developer'|translate }}: {{ marketplaceMacro.pluginDeveloper(plugin.owner) }}</li> </ul> {% macro moreDetailsLink(plugin) %} |