Skip to content

Commit

Permalink
Merge pull request #213 from Honny1/rearrange-fields-in-rule-detail
Browse files Browse the repository at this point in the history
Rearrange fields in Rule detail and OVAL definition detail
  • Loading branch information
Honny1 authored Sep 25, 2023
2 parents 961a063 + 97d9c54 commit 1c3e3ff
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml;charset=utf-8;base64,
PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lk
dGg9IjUyIiBoZWlnaHQ9IjUyIiBhbHQ9Ik9wZW4gU0NBUCBsb2dvIiByb2xlPSJpbWciPjxnIHRy
Expand All @@ -30,7 +31,6 @@
c3ZnPgoK"/>
{% block patternfly_css %}{% endblock %}
{% block style %}{% endblock %}
<title>{% block title %}{% endblock %}</title>
</head>

<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@
</td>
</tr>
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Version:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Description:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">{{ rule.oval_definition.version }}</p></div></div>
<p class="pf-c-table__text">{{ rule.oval_definition.description }}</p></div></div>
</td>
</tr>
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Description:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Class explained:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">{{ rule.oval_definition.description }}</p></div></div>
<p class="pf-c-table__text">{{ rule.oval_definition.get_oval_class_description() }}</p></div></div>
</td>
</tr>
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Class explained:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Version:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">{{ rule.oval_definition.get_oval_class_description() }}</p></div></div>
<p class="pf-c-table__text">{{ rule.oval_definition.version }}</p></div></div>
</td>
</tr>
{% else %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# Copyright 2022, Red Hat, Inc. #}
{# SPDX-License-Identifier: LGPL-2.1-or-later #}
{% if rule.oval_definition -%}
<div class="pf-c-helper-text">
<div class="pf-c-helper-text">
{% if rule.oval_definition.oval_tree.value == 'true' -%}
<div class="pf-c-helper-text__item pf-m-success">
<span class="pf-c-helper-text__item-icon">
Expand All @@ -22,7 +22,7 @@
<i class="fas fa-fw fa-exclamation-triangle" aria-hidden="true"></i>
</span>
<span class="pf-c-helper-text__item-text"><b>OVAL graph of OVAL definition: {{ rule.oval_definition_id }}</b></span>
</div>
</div>
{%- endif %}
</div>
{%- endif -%}
Expand Down
36 changes: 18 additions & 18 deletions openscap_report/report_generators/html_templates/rule_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,35 +62,31 @@
</td>
</tr>
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><p class="pf-c-table__text"><b>Multi-check rule:</b></p></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Time:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
{% if rule.multi_check %}
<p class="pf-c-table__text">yes</p>
{% else %}
<p class="pf-c-table__text">no</p>
{% endif %}
<p class="pf-c-table__text">{{ rule.time }}</p>
</div></div>
</td>
</tr>
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Time:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Description:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">{{ rule.time }}</p>
</div></div>
<div class="text_block pf-c-table__text">{{- rule.description | set_css_for_list -}}</div></div></div>
</td>
</tr>
{% if rule.rationale %}
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Weight:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Rationale:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">{{ rule.weight }}</p>
</div></div>
<p class="pf-c-table__text">{{- rule.rationale | set_css_for_list -}}</p></div></div>
</td>
</tr>
{% endif %}
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><p class="pf-c-table__text"><b>Severity:</b></p></td>
<th class="pf-m-fit-content" role="rowheader" scope="row"><p class="pf-c-table__text"><b>Severity:</b></p></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">
Expand Down Expand Up @@ -157,19 +153,23 @@
</td>
</tr>
{% endif %}
{% if rule.multi_check %}
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Description:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><p class="pf-c-table__text"><b>Multi-check rule:</b></p></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<div class="text_block pf-c-table__text">{{- rule.description | set_css_for_list -}}</div></div></div>
<p class="pf-c-table__text">yes</p>
</div></div>
</td>
</tr>
{% if rule.rationale %}
{% endif %}
{% if rule.weight | string != "1.0" %}
<tr role="row">
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Rationale:</b></th>
<th class="pf-m-fit-content" role="rowheader" scope="row"><b>Weight:</b></th>
<td role="cell">
<div class="pf-l-flex pf-m-column"><div class="pf-l-flex__item">
<p class="pf-c-table__text">{{- rule.rationale | set_css_for_list -}}</p></div></div>
<p class="pf-c-table__text">{{ rule.weight }}</p>
</div></div>
</td>
</tr>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
</th>
</tr>
</thead>
{%- set rule_hidden = "" -%}
{% for rule_id, rule in report.get_selected_rules() %}
{%- if rule.result != "notselected" -%}
{%- set rule_title = rule.title -%}
{%- if rule_title == "" -%}
{%- set rule_title = rule_id -%}
{%- endif -%}
{% if loop.index > 50 %}
<tbody class="pf-m-expanded hidden" role="rowgroup" rule-title="{{ rule_title }}" rule-id="{{ rule.rule_id }}" result="{{ rule.result }}" severity="{{ rule.severity }}">
{% else %}
<tbody class="pf-m-expanded" role="rowgroup" rule-title="{{ rule_title }}" rule-id="{{ rule.rule_id }}" result="{{ rule.result }}" severity="{{ rule.severity }}">
{%- set rule_hidden = "hidden" -%}
{% endif %}
<tbody class="pf-m-expanded {{ rule_hidden }}" role="rowgroup" rule-title="{{ rule_title }}" rule-id="{{ rule.rule_id }}" result="{{ rule.result }}" severity="{{ rule.severity }}">
<tr role="row">
<td class="pf-c-table__toggle" role="cell">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h3 class="pf-c-title pf-m-md">Advanced filtering options</h3>
Filter by result:
<div class="container">
<div>
<button id="show-all-rules-details" class="pf-c-button pf-m-primary" type="button" onclick="toogle_deselect_button(this)">Deselect all</button>
<button id="deselect-all-result" class="pf-c-button pf-m-primary" type="button" onclick="toogle_deselect_button(this)">Deselect all</button>
</div>
<label class="pf-c-check" for="checkbox-result-pass">
<input class="pf-c-check__input" type="checkbox" id="checkbox-result-pass" autocomplete="off" onchange="toggle_rules('result', 'pass');" checked/>
Expand Down Expand Up @@ -65,7 +65,7 @@ <h3 class="pf-c-title pf-m-md">Advanced filtering options</h3>
Filter by severity:
<div class="container">
<div>
<button id="show-all-rules-details" class="pf-c-button pf-m-primary" type="button" onclick="toogle_deselect_button(this)">Deselect all</button>
<button id="deselect-all-severity" class="pf-c-button pf-m-primary" type="button" onclick="toogle_deselect_button(this)">Deselect all</button>
</div>
<label class="pf-c-check" for="checkbox-severity-high">
<input class="pf-c-check__input" type="checkbox" id="checkbox-severity-high" autocomplete="off" onchange="toggle_rules('severity', 'high');" checked/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</p>
<div class="pf-c-alert__description">
Please review rule results and consider applying remediation.
</div>
</div>
</div>
{% elif rule_result_stats.unknown_error > 0 %}
<div class="pf-c-alert pf-m-warning pf-m-inline">
Expand Down

0 comments on commit 1c3e3ff

Please sign in to comment.