-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from openedx/bmtcril/finish_rendering
Simple local report rendering
- Loading branch information
Showing
22 changed files
with
351 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% if is_third_party %} | ||
{# no links for third party code since we don't know where to link to #} | ||
{% if annotation.extra and annotation.extra.object_id %} | ||
{{ annotation.extra.object_id }} {% if annotation.line_number > 0 %}line {{ annotation.line_number }}{% endif %}: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% else %} | ||
{% if loop.changed(annotation.line_number)%}{{ filename }}:{{ annotation.line_number }}<br />{% endif %}: | ||
{{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% endif %} | ||
{% elif annotation.extra and annotation.extra.object_id %} | ||
<a href="{{ source_link_prefix }}{{ filename }}#L{{ annotation.line_number }}" target="_blank">{{ annotation.extra.object_id }} {% if annotation.line_number > 0 %}line {{ annotation.line_number }}{% endif %}</a>: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% else %} | ||
<a href="{{ source_link_prefix }}{{ filename }}#L{{ annotation.line_number }}" target="_blank">`{{ filename }}:{{ annotation.line_number }}: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% if annotation.annotation_data is sequence and annotation.annotation_data is not string %} | ||
{% for a in annotation.annotation_data %} | ||
<a href="choice-{{ slugify(a) }}.html">{{ a }}</a>{% if not loop.last %}, {% endif %} | ||
{% endfor %} | ||
|
||
{% else %} | ||
{{ annotation.annotation_data }} | ||
{% endif %} |
27 changes: 27 additions & 0 deletions
27
code_annotations/report_templates/html/annotation_list.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{% extends "base.tpl" %} | ||
{% block content %} | ||
Annotations found in {{ report|length }} files. | ||
|
||
{% for filename in report %} | ||
{% set is_third_party = third_party_package_location in filename %} | ||
|
||
<h2 id="file-{{ slugify(filename) }}">{{ filename }}</h2> | ||
<div class="file-annotations"> | ||
{{ report[filename]|length }} annotations {% if is_third_party %}(installed package){% endif %}<br /> | ||
</div> | ||
|
||
{% for annotation in report[filename] %} | ||
{% if loop.changed(annotation.report_group_id) %} | ||
{% if not loop.first %}</ul></div>{% endif %} | ||
<div class="group-annotations"><ul> | ||
{% endif %} | ||
<li>{% include 'annotation.tpl' %}</li> | ||
{% if loop.last %} | ||
</ul></div> | ||
{% endif %} | ||
{% endfor %} | ||
|
||
|
||
{% endfor %} | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<html> | ||
<head> | ||
<title>{{ doc_title }}</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<style> | ||
body { | ||
font-family: 'Trebuchet MS', sans-serif; | ||
} | ||
.title { | ||
text-align: center; | ||
} | ||
.table { | ||
display: table; | ||
border-spacing: 12px; | ||
} | ||
.row { | ||
display: table-row; | ||
margin-bottom: 0; | ||
margin-top: 0; | ||
width: 100%; | ||
} | ||
.cell1 { | ||
display: table-cell; | ||
width: 20%; | ||
margin-right: 1%; | ||
border: 1px solid #ccc; | ||
margin 12px; | ||
background-color: #ffffee; | ||
} | ||
.cell2 { | ||
display: table-cell; | ||
width: 79%; | ||
margin-right: 1%; | ||
margin 12px; | ||
} | ||
.group-annotations { | ||
border: 1px solid #ccc; | ||
margin: 10px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1 class="title">{{ doc_title }}</h1> | ||
|
||
<div class="table"> | ||
<div class="row"> | ||
<div class="cell1"> | ||
<h3><a href="index.html">Home</a></h3> | ||
|
||
<h3>Annotations</h3> | ||
|
||
<ul> | ||
{% for a in all_annotations %} | ||
<li><a href="annotation-{{ slugify(a) }}.html">annotation_{{ slugify(a) }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<h3>Choices</h3> | ||
|
||
<ul> | ||
{% for choice in all_choices %} | ||
<li><a href="choice-{{ slugify(choice) }}.html">choice_{{ slugify(choice) }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
<div class="cell2"> | ||
<h2>Files in this page</h2> | ||
<ul> | ||
{% for filename in report %} | ||
<li><a href="#file-{{ slugify(filename) }}">{{ filename }}</a></li> | ||
{% endfor %} | ||
</ul> | ||
|
||
{% block content %}{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
{% block footer %} | ||
<div class="footer"> | ||
<br /><br /> | ||
<hr /> | ||
Built at {{ create_time.strftime('%Y-%m-%d %H:%M:%S %Z') }} | ||
</div> | ||
{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% if is_third_party %} | ||
{# no links for third party code since we don't know where to link to #} | ||
{% if annotation.extra and annotation.extra.object_id %} | ||
{{ annotation.extra.object_id }} {% if annotation.line_number > 0 %}line {{ annotation.line_number }}{% endif %}: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% else %} | ||
{{ filename }}:{{ annotation.line_number }}: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% endif %} | ||
{% elif annotation.extra and annotation.extra.object_id %} | ||
`{{ annotation.extra.object_id }} {% if annotation.line_number > 0 %}line {{ annotation.line_number }}{% endif %} <{{ source_link_prefix }}{{ filename }}#L{{ annotation.line_number }}>`_: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% else %} | ||
`{{ filename }}:{{ annotation.line_number }} <{{ source_link_prefix }}{{ filename }}#L{{ annotation.line_number }}>`_: {{ annotation.annotation_token }} {% include "annotation_data.tpl" %} | ||
{% endif %} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.. _index.rst#{{ slugify(filename + '-' + annotation.report_group_id |string) }}: | ||
.. admonition:: {{ group_mapping[annotation.annotation_token] or annotation.annotation_token }} |
Oops, something went wrong.