Use nl2br filter

pull/741/head
Federico Vera 2019-06-05 20:21:14 -03:00
parent ef705cfaf3
commit c29d719c50
No known key found for this signature in database
GPG Key ID: E69ECE2FCCDE9566
2 changed files with 7 additions and 9 deletions

View File

@ -459,12 +459,10 @@ class ServerController extends AbstractServerController {
if (strlen($tpl_data['last_output']) > 255) { if (strlen($tpl_data['last_output']) > 255) {
$tpl_data['last_output_truncated'] = substr($tpl_data['last_output'], 0, 255) . '...'; $tpl_data['last_output_truncated'] = substr($tpl_data['last_output'], 0, 255) . '...';
$tpl_data['last_output'] = nl2br($tpl_data['last_output']);
} }
if (strlen($tpl_data['last_error_output']) > 255) { if (strlen($tpl_data['last_error_output']) > 255) {
$tpl_data['last_error_output_truncated'] = nl2br(substr($tpl_data['last_error_output'], 0, 255) . '...'); $tpl_data['last_error_output_truncated'] = substr($tpl_data['last_error_output'], 0, 255) . '...';
$tpl_data['last_error_output'] = nl2br($tpl_data['last_error_output']);
} }
return $this->twig->render('module/server/server/view.tpl.html', $tpl_data); return $this->twig->render('module/server/server/view.tpl.html', $tpl_data);

View File

@ -335,7 +335,7 @@
</div> </div>
<div class="modal fade" id="modal_last_output" tabindex="-1" role="dialog" aria-labelledby="modal_last_output_label" aria-hidden="true"> <div class="modal fade" id="modal_last_output" tabindex="-1" role="dialog" aria-labelledby="modal_last_output_label" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" style="width:75%;max-width: 100%" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modal_last_output_label">{{ label_last_output }}</h5> <h5 class="modal-title" id="modal_last_output_label">{{ label_last_output }}</h5>
@ -343,8 +343,8 @@
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body" style="word-wrap: break-word;"> <div class="modal-body" style="word-wrap: break-word;font-family: Mono">
{{ last_output }} {{ last_output|nl2br }}
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
@ -354,7 +354,7 @@
</div> </div>
<div class="modal fade" id="modal_last_error" tabindex="-1" role="dialog" aria-labelledby="modal_last_error_label" aria-hidden="true"> <div class="modal fade" id="modal_last_error" tabindex="-1" role="dialog" aria-labelledby="modal_last_error_label" aria-hidden="true">
<div class="modal-dialog" role="document"> <div class="modal-dialog" style="width:75%;max-width: 100%" role="document">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="modal_last_error_label">{{ label_last_error_output }}</h5> <h5 class="modal-title" id="modal_last_error_label">{{ label_last_error_output }}</h5>
@ -362,8 +362,8 @@
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body" style="word-wrap: break-word;"> <div class="modal-body" style="word-wrap: break-word;font-family: Mono">
{{ last_error_output }} {{ last_error_output|nl2br }}
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>