prepare release 1.14 (#2495)
* removed un-maintained docker file * update all packages * fix deprecations * only show one line descriptions for customer, projects and activities * allow to show export column in timesheet listing
This commit is contained in:
@@ -69,6 +69,36 @@ final class MarkdownExtension implements RuntimeExtensionInterface
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the entities comment (customer, project, activity ...) into a one-liner.
|
||||
*
|
||||
* @param string|null $content
|
||||
* @param bool $fullLength
|
||||
* @return string
|
||||
*/
|
||||
public function commentOneLiner(?string $content, bool $fullLength = false): string
|
||||
{
|
||||
if (empty($content)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$addHellip = false;
|
||||
|
||||
if (!$fullLength && \strlen($content) > 52) {
|
||||
$content = trim(substr($content, 0, 50));
|
||||
$addHellip = true;
|
||||
}
|
||||
|
||||
$content = explode(PHP_EOL, $content);
|
||||
$result = $content[0];
|
||||
|
||||
if (\count($content) > 1 || $addHellip) {
|
||||
$result .= ' …';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the timesheet description content into HTML.
|
||||
*
|
||||
|
||||
@@ -44,6 +44,7 @@ class RuntimeExtensions extends AbstractExtension
|
||||
new TwigFilter('md2html', [MarkdownExtension::class, 'markdownToHtml'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('desc2html', [MarkdownExtension::class, 'timesheetContent'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('comment2html', [MarkdownExtension::class, 'commentContent'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
new TwigFilter('comment1line', [MarkdownExtension::class, 'commentOneLiner'], ['pre_escape' => 'html', 'is_safe' => ['html']]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user