Skip to content

Commit

Permalink
v0.5.0 (see release notes)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Kerzig committed May 8, 2018
1 parent da0318f commit af946d1
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 30 deletions.
3 changes: 1 addition & 2 deletions broken-links-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* @package Kirby CMS
* @author Dennis Kerzig <hi@wottpal.com>
* @version 0.4.0
* @version 0.5.0
*
*/

Expand All @@ -20,7 +20,6 @@
*/
function loadBlinksTranslation()
{

if (defined('KIRBY')) {
$site = kirby()->site();
$code = $site->multilang() ? $site->language()->code() : $site->user()->language();
Expand Down
3 changes: 1 addition & 2 deletions broken-links/broken-links.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
// Populate the Widget-Template
return tpl::load(__DIR__ . DS . 'template.php', [
'broken_links' => $broken_links,
'has_broken_links' => !empty(array_filter($broken_links)),
'brokenLinksOk' => l::get('broken-links.ok')
'has_broken_links' => !empty(array_filter($broken_links))
]);
}

Expand Down
6 changes: 4 additions & 2 deletions broken-links/template.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php include_once __DIR__ . DS . '..' . DS . 'helpers.php'; ?>

<?php loadBlinksTranslation(); ?>

<style>
.broken-link-list {
Expand All @@ -16,7 +17,7 @@

<?php if(!$has_broken_links): ?>
<div class="dashboard-box" style="margin-top: 1rem;">
<div class="text"><?= $brokenLinksOk ?></div>
<div class="text"><?= l::get('broken-links.ok') ?></div>
</div>

<?php else: ?>
Expand All @@ -28,8 +29,9 @@
<li>
<a href="<?= $page->url('edit') ?>">
<?= $page->icon() ?>
<?php $links_string = count($links) == 1 ? l::get('broken-links.link') : l::get('broken-links.links'); ?>
<span><?= $page->title() ?></span>
<small class="marginalia shiv shiv-left shiv-white" style="color: red; font-weight:bold;"><?= count($links) ?> <?= link_string(count($links)) ?></small>
<small class="marginalia shiv shiv-left shiv-white" style="color: red; font-weight:bold;"><?= count($links) ?> <?= $links_string ?></small>
</a>

<ul class="broken-link-list">
Expand Down
9 changes: 0 additions & 9 deletions helpers.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<?php


/**
* Returns either singular or plural "Links" string.
* TODO Has to be localized.
*/
function link_string($count) {
return $count == 1 ? "Link" : "Links";
}


/**
* Returns the HTTP-Response-Code of a given Domain.
*/
Expand Down
8 changes: 5 additions & 3 deletions languages/de.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

l::set([
'broken-links.brokenLinks' => 'Tote Links',
'broken-links.ok' => 'Alle internen Links scheinen zu funktionieren.',
'broken-links.check' => 'Jetzt überprüfen'
'broken-links.link' => 'Link',
'broken-links.links' => 'Links',
'broken-links.brokenLinks' => 'Tote Links',
'broken-links.ok' => 'Alle internen Links scheinen zu funktionieren.',
'broken-links.check' => 'Jetzt überprüfen'
]);
10 changes: 6 additions & 4 deletions languages/en.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

l::set([
'broken-links.brokenLinks' => 'Broken links',
'broken-links.ok' => 'All internal links seem to be okay.',
'broken-links.check' => 'Check now'
]);
'broken-links.link' => 'Link',
'broken-links.links' => 'Links',
'broken-links.brokenLinks' => 'Broken links',
'broken-links.ok' => 'All internal links seem to be okay.',
'broken-links.check' => 'Check now'
]);
8 changes: 5 additions & 3 deletions languages/fr.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

<?php
l::set([
'broken-links.brokenLinks' => 'Liens cassés',
'broken-links.ok' => 'Tous les liens internes semblent fonctionner.',
'broken-links.check' => 'Vérifier maintenant'
'broken-links.link' => 'Lien',
'broken-links.links' => 'Liens',
'broken-links.brokenLinks' => 'Liens cassés',
'broken-links.ok' => 'Tous les liens internes semblent fonctionner.',
'broken-links.check' => 'Vérifier maintenant'
]);
10 changes: 6 additions & 4 deletions languages/pl.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

l::set([
'broken-links.brokenLinks' => 'Niedziałające linki',
'broken-links.ok' => 'Wszystkie linki na stronie są poprawne i działają.',
'broken-links.check' => 'Sprawdź'
]);
'broken-links.link' => 'Link',
'broken-links.links' => 'Links',
'broken-links.brokenLinks' => 'Niedziałające linki',
'broken-links.ok' => 'Wszystkie linki na stronie są poprawne i działają.',
'broken-links.check' => 'Sprawdź'
]);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "broken-links-widget",
"description": "A Kirby panel-widget which shows broken links within the pages.",
"author": "Dennis Kerzig <hi@wottpal.com> (https://wottpal.com)",
"version": "0.4.0",
"version": "0.5.0",
"type": "kirby-plugin",
"license": "MIT"
}

0 comments on commit af946d1

Please # to comment.