[PATCH] D44681: [LNT] Split newlines in all params/fields for Machine and Run in run view.
Martin Liška via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 27 05:28:03 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL331030: Split newlines in all params/fields for Machine and Run in run view. (authored by marxin, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D44681?vs=144315&id=144316#toc
Repository:
rL LLVM
https://reviews.llvm.org/D44681
Files:
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
Index: lnt/trunk/lnt/server/ui/templates/utils.html
===================================================================
--- lnt/trunk/lnt/server/ui/templates/utils.html
+++ lnt/trunk/lnt/server/ui/templates/utils.html
@@ -130,3 +130,14 @@
</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 %}
Index: lnt/trunk/lnt/server/ui/templates/v4_run.html
===================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_run.html
+++ lnt/trunk/lnt/server/ui/templates/v4_run.html
@@ -143,7 +143,7 @@
{% 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 @@
{% 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 @@
{% 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 @@
{% 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>
Index: lnt/trunk/lnt/server/ui/templates/v4_machine.html
===================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_machine.html
+++ lnt/trunk/lnt/server/ui/templates/v4_machine.html
@@ -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>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44681.144316.patch
Type: text/x-patch
Size: 2482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180427/65464993/attachment.bin>
More information about the llvm-commits
mailing list