diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-08-02 03:52:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-02 03:52:27 +0300 |
commit | bca50a1e328ed319c5a01cda4bcb2db6026744c1 (patch) | |
tree | 2bbf5e4f84cd89d5f53824c3e6cfed6fa7d7b418 /plugins/API | |
parent | 4dcd5e1e78c4b643b2f8c86ca412e613c954c829 (diff) |
Couple small additions to glossary generation. (#13243)
Diffstat (limited to 'plugins/API')
-rw-r--r-- | plugins/API/Controller.php | 3 | ||||
-rw-r--r-- | plugins/API/templates/glossary.twig | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php index 244614265b..f7b5c4a02f 100644 --- a/plugins/API/Controller.php +++ b/plugins/API/Controller.php @@ -182,7 +182,8 @@ class Controller extends \Piwik\Plugin\Controller foreach ($glossaryItems as &$item) { $item['letters'] = array(); foreach ($item['entries'] as &$entry) { - $entry['letter'] = Common::mb_strtoupper(substr($entry['name'], 0, 1)); + $cleanEntryName = preg_replace('/["\']/', '', $entry['name']); + $entry['letter'] = Common::mb_strtoupper(substr($cleanEntryName, 0, 1)); $item['letters'][] = $entry['letter']; } diff --git a/plugins/API/templates/glossary.twig b/plugins/API/templates/glossary.twig index 3773248e1b..3deff81375 100644 --- a/plugins/API/templates/glossary.twig +++ b/plugins/API/templates/glossary.twig @@ -42,10 +42,11 @@ <div class="section scrollspy" id="{{ keyword }}{{ lastLetter }}"> {% endif %} <h3 style="color:#4183C4;font-weight: bold;">{{ entry.name }}</h3> + {% if entry.subtitle|default is not empty %}<p style="color:#999;text-transform:uppercase;font-weight:normal;margin-top:-16px;">{{ entry.subtitle|translate }}</p>{% endif %} <p>{{ entry.documentation|raw }} {% if entry.id is defined %} - <br/><span style="color: #bbb;">{{ entry.id }}{% if keyword == 'metrics' %} (API){% endif %}</span> + <br/><span style="color: #bbb;">{{ entry.id }}{% if keyword == 'metrics' or entry.is_metric|default %} (API){% endif %}</span> {% endif %} </p> {% endfor %} |