diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2013-09-20 04:29:06 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2013-09-20 04:29:06 +0400 |
commit | ab09ec74efff36fbc3d33d7873e196f1fd3f7d83 (patch) | |
tree | ec7a96e23f304a062bbfb49080444f49798e66b6 /plugins/CorePluginsAdmin | |
parent | 69c74620ed9af288024032ea5b90a0ac3a40a661 (diff) |
use some existing translations, splitted markup into multiple templates
Diffstat (limited to 'plugins/CorePluginsAdmin')
7 files changed, 68 insertions, 77 deletions
diff --git a/plugins/CorePluginsAdmin/templates/browsePlugins.twig b/plugins/CorePluginsAdmin/templates/browsePlugins.twig index ee93538790..ed868faffd 100644 --- a/plugins/CorePluginsAdmin/templates/browsePlugins.twig +++ b/plugins/CorePluginsAdmin/templates/browsePlugins.twig @@ -10,18 +10,7 @@ Piwik is not the owner of these Plugins and did not review them. </div> - <div class="sort"> - <a href="{{ linkTo({'sort': 'popular', 'query': ''}) }}" {% if 'popular' == sort %}class="active"{% endif %}>popular</a> - | - <a href="{{ linkTo({'sort': 'newest', 'query': ''}) }}" {% if 'newest' == sort %}class="active"{% endif %}>newest</a> - | - <a href="{{ linkTo({'sort': 'alpha', 'query': ''}) }}" {% if 'alpha' == sort %}class="active"{% endif %}>alpha</a> - | - <form action="{{ linkTo({'sort': ''}) }}" method="POST"> - <input value="{{ query }}" placeholder="Search" type="text" name="query"/> - <button type="submit">Search</button> - </form> - </div> + {% include "@CorePluginsAdmin/browsePluginsActions.twig" %} </div> <div class="pluginslist"> @@ -32,34 +21,11 @@ <div class="plugin"> <div class="content"> - {% if plugin.canBeUpdated %} - <a class="update" href="{{ linkTo({'action':'updatePlugin', 'pluginName': plugin.name, 'nonce': updateNonce}) }}">Update</a> - {% elseif plugin.isInstalled %} - <span class="install">Installed</span> - {% else %} - <a href="{{ linkTo({'action': 'installPlugin', 'pluginName': plugin.name, 'nonce': installNonce}) }}" - class="install">Install</a> - {% endif %} - - <h3 class="header"> - <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more">{{ plugin.name }}</a> - </h3> - <p class="description">{{ plugin.description }} - <br /> - <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more">>> more</a> - </p> - {% if plugin.canBeUpdated %} - <p class="updateAvailableNotice">You can update this plugin to version {{ plugin.latestVersion }}</p> - {% endif %} + {% include "@CorePluginsAdmin/pluginOverview.twig" %} </div> <div class="footer"> - <hr class="metadataSeparator"> - <ul class="metadata"> - <li>Version: <strong>{{ plugin.latestVersion }}</strong></li> - <li class="even">Updated: <strong>{{ plugin.lastUpdated }}</strong></li> - <li>Downloads: <strong>{{ plugin.numDownloads }}</strong></li> - </ul> + {% include "@CorePluginsAdmin/pluginMetadata.twig" %} </div> </div> diff --git a/plugins/CorePluginsAdmin/templates/browsePluginsActions.twig b/plugins/CorePluginsAdmin/templates/browsePluginsActions.twig new file mode 100644 index 0000000000..463dfaa829 --- /dev/null +++ b/plugins/CorePluginsAdmin/templates/browsePluginsActions.twig @@ -0,0 +1,12 @@ +<div class="sort"> + <a href="{{ linkTo({'sort': 'popular', 'query': ''}) }}" {% if 'popular' == sort %}class="active"{% endif %}>popular</a> + | + <a href="{{ linkTo({'sort': 'newest', 'query': ''}) }}" {% if 'newest' == sort %}class="active"{% endif %}>newest</a> + | + <a href="{{ linkTo({'sort': 'alpha', 'query': ''}) }}" {% if 'alpha' == sort %}class="active"{% endif %}>alpha</a> + | + <form action="{{ linkTo({'sort': ''}) }}" method="POST"> + <input value="{{ query }}" placeholder="Search" type="text" name="query"/> + <button type="submit">Search</button> + </form> +</div> diff --git a/plugins/CorePluginsAdmin/templates/browseThemes.twig b/plugins/CorePluginsAdmin/templates/browseThemes.twig index 3cee8d4dd0..cda05f8b31 100644 --- a/plugins/CorePluginsAdmin/templates/browseThemes.twig +++ b/plugins/CorePluginsAdmin/templates/browseThemes.twig @@ -10,18 +10,7 @@ Piwik is not the owner of these Themes and did not review them. </div> - <div class="sort"> - <a href="{{ linkTo({'sort': 'popular', 'query': ''}) }}" {% if 'popular' == sort %}class="active"{% endif %}>popular</a> - | - <a href="{{ linkTo({'sort': 'newest', 'query': ''}) }}" {% if 'newest' == sort %}class="active"{% endif %}>newest</a> - | - <a href="{{ linkTo({'sort': 'alpha', 'query': ''}) }}" {% if 'alpha' == sort %}class="active"{% endif %}>alpha</a> - | - <form action="{{ linkTo({'sort': ''}) }}" method="POST"> - <input value="{{ query }}" placeholder="Search" type="text" name="query"/> - <button type="submit">Search</button> - </form> - </div> + {% include "@CorePluginsAdmin/browsePluginsActions.twig" %} </div> <div class="pluginslist themes"> @@ -31,36 +20,12 @@ <div class="plugin"> <div class="content"> - {% if plugin.canBeUpdated %} - <a class="update" href="{{ linkTo({'action':'updatePlugin', 'pluginName': plugin.name, 'nonce': updateNonce}) }}">Update</a> - {% elseif plugin.isInstalled %} - <span class="install">Installed</span> - {% else %} - <a href="{{ linkTo({'action': 'installPlugin', 'pluginName': plugin.name, 'nonce': installNonce}) }}" - class="install">Install</a> - {% endif %} - - <h3 class="header"> - <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more">{{ plugin.name }}</a> - </h3> - <p class="description">{{ plugin.description }}</p> - - <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more"><img - class="preview" src="{{ plugin.screenshots|first }}?w=250&h=250"/></a> - {% if plugin.canBeUpdated %} - <p class="updateAvailableNotice">You can update this theme to version {{ plugin.latestVersion }}</p> - {% endif %} + {% include "@CorePluginsAdmin/themeOverview.twig" %} </div> <div class="footer"> - <hr class="metadataSeparator"> - <ul class="metadata"> - <li>Version: <strong>{{ plugin.latestVersion }}</strong></li> - <li class="even">Updated: <strong>{{ plugin.lastUpdated }}</strong></li> - <li>Downloads: <strong>{{ plugin.numDownloads }}</strong></li> - </ul> + {% include "@CorePluginsAdmin/pluginMetadata.twig" %} </div> - </div> {% endfor %} diff --git a/plugins/CorePluginsAdmin/templates/extend.twig b/plugins/CorePluginsAdmin/templates/extend.twig index 26ca851423..0b04efb308 100644 --- a/plugins/CorePluginsAdmin/templates/extend.twig +++ b/plugins/CorePluginsAdmin/templates/extend.twig @@ -24,7 +24,7 @@ <span class="callToAction">by <a href="{{ linkTo({'action':'browsePlugins', 'sort': ''}) }}">installing a new plugin</a></span> <p> - <a href="{{ linkTo({'action':'browsePlugins', 'sort': ''}) }}"><img class="teaserImage" src=""/></a> + <a href="{{ linkTo({'action':'browsePlugins', 'sort': ''}) }}"><img class="teaserImage" alt="Install a new plugin" src=""/></a> </p> <span class="callToAction">or <a href="#">write your own plugin</a></span> @@ -35,7 +35,7 @@ <span class="callToAction">by <a href="{{ linkTo({'action':'browseThemes', 'sort': ''}) }}">installing a new theme</a></span> <p> - <a href="{{ linkTo({'action':'browseThemes', 'sort': ''}) }}"><img class="teaserImage" src=""/></a> + <a href="{{ linkTo({'action':'browseThemes', 'sort': ''}) }}"><img class="teaserImage" alt="Install a new theme" src=""/></a> </p> <span class="callToAction">or <a href="#">design your own theme</a></span> diff --git a/plugins/CorePluginsAdmin/templates/pluginMetadata.twig b/plugins/CorePluginsAdmin/templates/pluginMetadata.twig new file mode 100644 index 0000000000..f6752d0e64 --- /dev/null +++ b/plugins/CorePluginsAdmin/templates/pluginMetadata.twig @@ -0,0 +1,6 @@ +<hr class="metadataSeparator"> +<ul class="metadata"> + <li>{{ 'CorePluginsAdmin_Version'|translate }}: <strong>{{ plugin.latestVersion }}</strong></li> + <li class="even">Updated: <strong>{{ plugin.lastUpdated }}</strong></li> + <li>{{ 'General_Downloads'|translate }}: <strong>{{ plugin.numDownloads }}</strong></li> +</ul>
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/templates/pluginOverview.twig b/plugins/CorePluginsAdmin/templates/pluginOverview.twig new file mode 100644 index 0000000000..9059c03fb2 --- /dev/null +++ b/plugins/CorePluginsAdmin/templates/pluginOverview.twig @@ -0,0 +1,21 @@ +{% if plugin.canBeUpdated %} + <a class="update" + href="{{ linkTo({'action':'updatePlugin', 'pluginName': plugin.name, 'nonce': updateNonce}) }}" + >Update</a> +{% elseif plugin.isInstalled %} + <span class="install">Installed</span> +{% else %} + <a href="{{ linkTo({'action': 'installPlugin', 'pluginName': plugin.name, 'nonce': installNonce}) }}" + class="install">Install</a> +{% endif %} + +<h3 class="header"> + <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more">{{ plugin.name }}</a> +</h3> +<p class="description">{{ plugin.description }} + <br /> + <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more">>> more</a> +</p> +{% if plugin.canBeUpdated %} + <p class="updateAvailableNotice">You can update this plugin to version {{ plugin.latestVersion }}</p> +{% endif %}
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/templates/themeOverview.twig b/plugins/CorePluginsAdmin/templates/themeOverview.twig new file mode 100644 index 0000000000..4522756572 --- /dev/null +++ b/plugins/CorePluginsAdmin/templates/themeOverview.twig @@ -0,0 +1,21 @@ +{% if plugin.canBeUpdated %} + <a href="{{ linkTo({'action':'updatePlugin', 'pluginName': plugin.name, 'nonce': updateNonce}) }}" + class="update" + >{{ 'CoreUpdater_UpdateTitle'|translate }}</a> +{% elseif plugin.isInstalled %} + <span class="install">{{ 'General_Installed'|translate }}</span> +{% else %} + <a href="{{ linkTo({'action': 'installPlugin', 'pluginName': plugin.name, 'nonce': installNonce}) }}" + class="install">Install</a> +{% endif %} + +<h3 class="header"> + <a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more">{{ plugin.name }}</a> +</h3> +<p class="description">{{ plugin.description }}</p> + +<a href="javascript:return;" data-pluginName="{{ plugin.name }}" class="more"><img + class="preview" src="{{ plugin.screenshots|first }}?w=250&h=250"/></a> +{% if plugin.canBeUpdated %} + <p class="updateAvailableNotice">You can update this theme to version {{ plugin.latestVersion }}</p> +{% endif %}
\ No newline at end of file |