From d9f6b83ed6d8a4546e4119c64b639adda057d25e Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 13 Apr 2012 19:56:24 +0200 Subject: first tool supported: xmllint --- data/config.default.php | 3 +++ data/templates/display-file.htm | 12 +++++++++ data/templates/display-foot.htm | 7 ++++++ data/templates/display-head.htm | 35 ++++++++++++++++++++++++++ data/templates/display.htm | 54 +++-------------------------------------- data/templates/tool.htm | 44 +++++++++++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 51 deletions(-) create mode 100644 data/templates/display-file.htm create mode 100644 data/templates/display-foot.htm create mode 100644 data/templates/display-head.htm create mode 100644 data/templates/tool.htm (limited to 'data') diff --git a/data/config.default.php b/data/config.default.php index 804ff5e..443328d 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -6,6 +6,9 @@ $GLOBALS['phorkie']['cfg'] = array( 'tpl' => __DIR__ . '/templates/', 'css' => 'http://twitter.github.com/bootstrap/assets/css/bootstrap.css', ); +$GLOBALS['phorkie']['tools'] = array( + '\\phorkie\\Tool_Xmllint' +); /** * Array of supported file types / languages. * Key is the file extension diff --git a/data/templates/display-file.htm b/data/templates/display-file.htm new file mode 100644 index 0000000..d06c365 --- /dev/null +++ b/data/templates/display-file.htm @@ -0,0 +1,12 @@ +
+
+ raw + {% for toolinfo in file.getToolInfos %} + {{toolinfo.getTitle}} + {% endfor %} +

{{file.getFilename}}

+
+
+ {{file.getHighlightedContent|raw}} +
+
diff --git a/data/templates/display-foot.htm b/data/templates/display-foot.htm new file mode 100644 index 0000000..9f2451f --- /dev/null +++ b/data/templates/display-foot.htm @@ -0,0 +1,7 @@ +
+ +
diff --git a/data/templates/display-head.htm b/data/templates/display-head.htm new file mode 100644 index 0000000..7ce5160 --- /dev/null +++ b/data/templates/display-head.htm @@ -0,0 +1,35 @@ +

{{repo.getDescription}}

+
+
+ edit +
+
+

Paste #{{repo.id}}

+
+
+
+ +
+
+
+ +{% if repo.getCloneURL(true) or repo.getCloneURL(false) %} +
+ {% if repo.getCloneURL(true) %} +
+
Public clone URL
+ +
+ {% endif %} + {% if repo.getCloneURL(false) %} +
+
Private clone URL
+ +
+ {% endif %} +
+{% endif %} diff --git a/data/templates/display.htm b/data/templates/display.htm index da75cd9..e021296 100644 --- a/data/templates/display.htm +++ b/data/templates/display.htm @@ -8,61 +8,13 @@ {% endblock %} {% block content %} -

{{repo.getDescription}}

-
-
- edit -
-
-

Paste #{{repo.id}}

-
-
-
- -
-
-
- -{% if repo.getCloneURL(true) or repo.getCloneURL(false) %} -
- {% if repo.getCloneURL(true) %} -
-
Public clone URL
- -
- {% endif %} - {% if repo.getCloneURL(false) %} -
-
Private clone URL
- -
- {% endif %} -
-{% endif %} + {% include 'display-head.htm' %} {% for file in repo.getFiles %} -
-
- raw -

{{file.getFilename}}

-
-
- {{file.getHighlightedContent|raw}} -
-
+ {% include 'display-file.htm' %} {% endfor %} -
- -
+ {% include 'display-foot.htm' %} {% endblock %} {% block sidebar %} diff --git a/data/templates/tool.htm b/data/templates/tool.htm new file mode 100644 index 0000000..ef8e5e0 --- /dev/null +++ b/data/templates/tool.htm @@ -0,0 +1,44 @@ +{% extends "base.htm" %} +{% block title %} + Tool results: + {%if repo.getDescription %} + {{repo.getDescription}} + {%else%} + {{repo.id}} + {%endif%} +{% endblock %} + +{% block content %} +

Tool results: {{repo.getDescription}}

+
+
+ edit + back +
+
+

Paste #{{repo.id}}

+
+
+ + {% for line in toolres.annotations.general %} +
+ {{line.message}} +
+ {% endfor %} + + {% include 'display-file.htm' %} + + {% for number,lineinfos in toolres.annotations if number != 'general' %} + {% for line in lineinfos %} +
+ Line #{{number}}: {{line.message}} +
+ {% endfor %} + {% endfor %} + + {% include 'display-foot.htm' %} +{% endblock %} + +{% block sidebar %} +sidebar FIXME +{% endblock %} -- cgit v1.2.3