[LNT] r331030 - Split newlines in all params/fields for Machine and Run in run view.
Martin Liska via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 27 05:24:30 PDT 2018
Author: marxin
Date: Fri Apr 27 05:24:30 2018
New Revision: 331030
URL: http://llvm.org/viewvc/llvm-project?rev=331030&view=rev
Log:
Split newlines in all params/fields for Machine and Run in run view.
Differential Revision: https://reviews.llvm.org/D44681
Modified:
lnt/trunk/lnt/server/ui/templates/utils.html
lnt/trunk/lnt/server/ui/templates/v4_machine.html
lnt/trunk/lnt/server/ui/templates/v4_run.html
Modified: lnt/trunk/lnt/server/ui/templates/utils.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/utils.html?rev=331030&r1=331029&r2=331030&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/utils.html (original)
+++ lnt/trunk/lnt/server/ui/templates/utils.html Fri Apr 27 05:24:30 2018
@@ -130,3 +130,14 @@ $(document).ready(function() {
</div>
{% endmacro %}
+
+{% macro newline_to_br(value) %}
+ {# Split lines in multi-line values. #}
+ {% if '\n' in value|string %}
+ {% for ln in (value|string).split('\n') %}
+ {{ ln }}<br/>
+ {% endfor %}
+ {% else %}
+ {{value}}
+ {% endif %}
+{% endmacro %}
Modified: lnt/trunk/lnt/server/ui/templates/v4_machine.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_machine.html?rev=331030&r1=331029&r2=331030&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_machine.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_machine.html Fri Apr 27 05:24:30 2018
@@ -53,7 +53,7 @@
{% for key,value in machine.parameters|dictsort %}
<tr>
<td>{{key}}</td>
- <td>{{value}}</td>
+ <td>{{ utils.newline_to_br(value) }}</td>
</tr>
{% endfor %}
</table>
Modified: lnt/trunk/lnt/server/ui/templates/v4_run.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_run.html?rev=331030&r1=331029&r2=331030&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_run.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_run.html Fri Apr 27 05:24:30 2018
@@ -143,7 +143,7 @@ $('.profile-prev-only').tooltip();
{% for item in machine.fields %}
<tr>
<td> <b>{{item.name}}</b> </td>
- <td>{{machine.get_field(item)}}</td>
+ <td>{{ utils.newline_to_br(machine.get_field(item)) }}</td>
</tr>
{% endfor %}
</table>
@@ -153,7 +153,7 @@ $('.profile-prev-only').tooltip();
{% for key,value in machine.parameters|dictsort %}
<tr>
<td> <b>{{key}}</b> </td>
- <td>{{value}}</td>
+ <td>{{ utils.newline_to_br(value) }}</td>
</tr>
{% endfor %}
</table>
@@ -170,7 +170,7 @@ $('.profile-prev-only').tooltip();
{% for item in run.fields %}
<tr>
<td> <b>{{item.name}}</b> </td>
- <td>{{run.get_field(item)}}</td>
+ <td>{{ utils.newline_to_br(run.get_field(item)) }}</td>
</tr>
{% endfor %}
</table>
@@ -183,16 +183,7 @@ $('.profile-prev-only').tooltip();
{% for key, value in run.parameters|dictsort(case_sensitive=True) %}
<tr>
<td> <b>{{key}}</b> </td>
- {# Split lines in multi-line values. #}
- {% if '\n' in value|string %}
- <td>
- {% for ln in (value|string).split('\n') %}
- {{ ln }}<br/>
- {% endfor %}
- </td>
- {% else %}
- <td>{{value}}</td>
- {% endif %}
+ <td>{{ utils.newline_to_br(value) }}</td>
</tr>
{% endfor %}
</table>
More information about the llvm-commits
mailing list