Skip to content

Commit b17528f

Browse files
Document: Update document templates - refs #3698
1 parent 985da20 commit b17528f

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/CoreBundle/Controller/TemplateController.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,34 @@ private function formatSystemTemplates(array $systemTemplates, AssetRepository $
134134
$imageUrl = $assetRepository->getAssetUrl($template->getImage());
135135
}
136136

137+
$content = $template->getContent();
138+
$content = str_replace('<table', '<table class="responsive-table"', $content);
139+
$content = str_replace(
140+
'{CSS}',
141+
'<style>
142+
.responsive-table {
143+
width: 100%;
144+
max-width: 100%;
145+
overflow-x: auto;
146+
display: block;
147+
border-collapse: collapse;
148+
}
149+
.responsive-table th,
150+
.responsive-table td {
151+
padding: 8px;
152+
text-align: left;
153+
word-wrap: break-word;
154+
border: 1px solid #ccc;
155+
}
156+
</style>',
157+
$content
158+
);
159+
137160
return [
138161
'id' => $template->getId(),
139162
'title' => $template->getTitle(),
140163
'comment' => $template->getComment(),
141-
'content' => $template->getContent(),
164+
'content' => $content,
142165
'image' => $imageUrl,
143166
];
144167
}, $systemTemplates);

0 commit comments

Comments
 (0)