Skip to content

Commit

Permalink
Add WebpartsRecursive: follow all links from rot and do xhtml/dtd val…
Browse files Browse the repository at this point in the history
…idation
  • Loading branch information
marcus-sonestedt committed Jan 22, 2010
1 parent a119a02 commit e9bb78e
Show file tree
Hide file tree
Showing 16 changed files with 367 additions and 39 deletions.
2 changes: 1 addition & 1 deletion buildbot/status/web/base.py
Expand Up @@ -171,7 +171,7 @@ def getTitle(self, request):

class HtmlResource(resource.Resource, ContextMixin):
# this is a cheap sort of template thingy
contentType = "text/html; charset=UTF-8"
contentType = "text/html; charset=utf-8"
title = "Buildbot"
addSlash = False # adapted from Nevow

Expand Down
1 change: 1 addition & 0 deletions buildbot/status/web/baseweb.py
Expand Up @@ -491,6 +491,7 @@ def __init__(self, http_port=None, distrib_port=None, allowForce=False,
trim_blocks=True,
undefined=webbase.AlmostStrictUndefined)

self.templates.filters['urlencode'] = urllib.quote
self.templates.filters['email'] = webbase.emailfilter
self.templates.filters['user'] = webbase.userfilter
self.templates.filters['shortrev'] = \
Expand Down
3 changes: 2 additions & 1 deletion buildbot/status/web/build.py
Expand Up @@ -189,7 +189,8 @@ def rebuild(self, req):
# preferred place is somewhere that the user can see tangible
# evidence of their build starting (or to see the reason that it
# didn't start). This should be the Builder page.
r = Redirect("../..") # the Builder's page

r = Redirect('../..') # the Builder's page
d = defer.Deferred()
reactor.callLater(1, d.callback, r)
return DeferredResource(d)
Expand Down
4 changes: 2 additions & 2 deletions buildbot/status/web/logs.py
Expand Up @@ -103,9 +103,9 @@ def render_GET(self, req):

def _setContentType(self, req):
if self.asText:
req.setHeader("content-type", "text/plain")
req.setHeader("content-type", "text/plain; charset=utf-8")
else:
req.setHeader("content-type", "text/html")
req.setHeader("content-type", "text/html; charset=utf-8")

def finished(self):
if not self.req:
Expand Down
2 changes: 2 additions & 0 deletions buildbot/status/web/templates/build.html
Expand Up @@ -195,6 +195,8 @@ <h2>All Changes:</h2>
<ol>
{% for c in ss.changes %}
<li>{{ change(**c.html_dict()) }}</li>
{% else %}
<li>no changes</li>
{% endfor %}
</ol>
</div>
Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/templates/build_line.html
@@ -1,5 +1,5 @@
{% macro build_line(b, include_builder=False) %}
<font size="-1">({{ b.time }})</font>
<small>({{ b.time }})</small>
Rev: {{ b.rev|shortrev }}
<span class="{{ b.class }}">{{ b.results }}</span>
{% if include_builder %}
Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/templates/builder.html
Expand Up @@ -37,7 +37,7 @@ <h2>No current builds</h2>
<h2>Pending builds:</h2>
<ul>
{% for b in pending %}
<li><font size="-1">({{ b.when }}, waiting {{ b.delay }})</font>
<li><small>({{ b.when }}, waiting {{ b.delay }})</small>

{% if cancel_url %}
<form method="post" action="{{ cancel_url }}" class="command cancelbuild" style="display:inline">
Expand Down
2 changes: 2 additions & 0 deletions buildbot/status/web/templates/change_macros.html
Expand Up @@ -42,6 +42,8 @@ <h3 class="files">Changed files</h3>
{%- else %}<b>{{ f.name|e }}</b>
{%- endif -%}
</li>
{% else %}
<li>no files</li>
{% endfor %}
</ul>

Expand Down
43 changes: 28 additions & 15 deletions buildbot/status/web/templates/console.html
Expand Up @@ -3,7 +3,7 @@
{% block head %}
{{ super() }}
<script type='text/javascript'>
// <;![Cdata[
// <![CDATA[
//

//
Expand Down Expand Up @@ -70,6 +70,7 @@
return !containsDOM(element, event.relatedTarget);
}
}

// ]]>
</script>
{% endblock %}
Expand All @@ -79,7 +80,7 @@
<h1>Console View</h1>

<div align="center">
<table width=95% class="Grid" border="0" cellspacing="0">
<table width="95%" class="Grid" border="0" cellspacing="0">
<tr>
<td width="33%" align="left" class="left_align">
{% if categories|length > 1 %}
Expand All @@ -89,7 +90,7 @@ <h1>Console View</h1>
<br><b>Branch:</b> {{ branch }}
{% endif %}
</td>
<td width=33% align=center class=center_align>
<td width="33%" align="center" class="center_align">
<div align="center">
<table class="info">
<tr>
Expand All @@ -104,28 +105,27 @@ <h1>Console View</h1>
</table>
</div>
</td>
<td width=33% align=right class=right_align>
<script>
<td width="33%" align="right" class="right_align">
<script type="text/javascript"> <![CDATA[
function reload_page() {
name_value = document.getElementById('namebox').value
if (document.location.href.lastIndexOf('?') == -1)
document.location.href = document.location.href+ '?name=' + name_value;
else
document.location.href = document.location.href+ '&name=' + name_value;
}
} ]]>
</script>
<input id='namebox' name='name' type='text' style='color:#999;'
onblur='this.value = this.value || this.defaultValue; this.style.color = "#999";'
onfocus='this.value=""; this.style.color = "#000";'
value='Personalized for...'>

<input type=submit value='Go' onclick='reload_page()'>
value='Personalized for...'/>
<input type='submit' value='Go' onclick='reload_page()'/>
</td>
</tr>
</table>
</div>

<br>
<br/>

{% set alt_class = cycler('', 'alt') %}

Expand Down Expand Up @@ -160,7 +160,7 @@ <h1>Console View</h1>
<tr>
{% for s in slaves[c.name] %}
<td class='DevSlaveBox'>
<a href='{{ s.url }}' title='{{ s.title }}' class='DevSlaveBox {{ s.color }}' target=_blank>
<a href='{{ s.url }}' title='{{ s.title }}' class='DevSlaveBox {{ s.color }}' target="_blank">
</a>
</td>
{% endfor %}
Expand Down Expand Up @@ -191,9 +191,9 @@ <h1>Console View</h1>
<tr>
{% for b in r.builds[c.name] %}
<td class='DevStatusBox'>
<a href='#' onClick='showBuildBox("{{ b.url }}", event); return false;'
<a href='#' onclick='showBuildBox("{{ b.url|urlencode }}", event); return false;'
title='{{ b.title }}' class='DevStatusBox {{ b.color }} {{ b.tag }}'
target=_blank></a>
target="_blank"></a>
</td>
{% endfor %}
</tr>
Expand Down Expand Up @@ -223,15 +223,28 @@ <h1>Console View</h1>
</td>
</tr>

{% else %}
<tr><td>No revisions available</td></tr>
{% endfor %}

</table>
</div>

<div id="divBox" OnMouseOut="if (checkMouseLeave(this, event)) this.style.display = 'None'" class="BuildWaterfall">

<div id="divBox" onmouseout="if (checkMouseLeave(this, event)) this.style.display = 'None'" class="BuildWaterfall">
</div>

<iframe id="frameBox" style="display: none;" onload="updateDiv(event);"></iframe>

<script type="text/javascript">
// replace 'onload="updateDiv(event);" with this, as iframe doesn't have onload event in xhtml
window.onload = function() {
document.getElementById('myframe').onload = function(event) {
updateDiv(event);
};
};
</script>

<iframe id="frameBox" style="display: none;"></iframe>

{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/templates/forms.html
Expand Up @@ -45,7 +45,7 @@
<form method="post" action="{{ force_url }}" class="command forcebuild">

{% if on_all %}
<p>To force a build on <b><u>all Builders</u></b>, fill out the following fields
<p>To force a build on <strong>all Builders</strong>, fill out the following fields
and push the 'Force Build' button</p>
{% else %}
<p>To force a build, fill out the following fields and
Expand Down
2 changes: 2 additions & 0 deletions buildbot/status/web/templates/logs.html
@@ -1,4 +1,6 @@
{%- macro page_header(title, path_to_root, texturl) -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title>{{ title }}</title>
<link rel="stylesheet" href="{{ path_to_root }}default.css" type="text/css" />
Expand Down
3 changes: 2 additions & 1 deletion buildbot/status/web/templates/oneboxperbuilder.html
Expand Up @@ -17,7 +17,8 @@ <h1>Latest builds: {{ branches|join(', ')|e }}</h1>
{% else %}
<td class="LastBuild box">no build</td>
{% endif %}
{{ box(**b.current_box) }}
{{ box(**b.current_box) }}
</tr>
{% endfor %}
</table>

Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/templates/revmacros.html
@@ -1,7 +1,7 @@
{# both macro pairs must have the same signature #}

{% macro id_replace(rev, url) -%}
<span class="revision"><a href="{{ url }}">r{{ rev }}</span>
<span class="revision"><a href="{{ url }}">r{{ rev }}</a></span>
{%- endmacro %}

{% macro shorten_replace(short, rev, url) -%}
Expand Down
25 changes: 14 additions & 11 deletions buildbot/status/web/templates/waterfallhelp.html
@@ -1,7 +1,7 @@
{% extends "layout.html" %}
{% block content %}

<form action="../waterfall" method="GET">
<form action="../waterfall" method="get">

<h1>The Waterfall Display</h1>

Expand Down Expand Up @@ -41,7 +41,7 @@ <h2>Showing non-Build events</h2>

<p>
<input type="checkbox" name="show_events" value="true"
{% if show_events_checked %} checked="checked" {% endif %} >
{% if show_events_checked %} checked="checked" {% endif %}/>
Show non-Build events
</p>

Expand All @@ -53,13 +53,17 @@ <h2>Showing only Certain Branches</h2>

Erase the text from these "Show Branch:" boxes to remove that branch filter.

{% if branches %}
<table>
{% for b in branches %}
<tr><td>Show Branch:
<input type="text" name="branch" value="{{ b|e }}">
</td></tr>
{% endfor %}
{% for b in branches %}
<tr>
<td>Show Branch:
<input type="text" name="branch" value="{{ b|e }}"/>
</td>
</tr>
{% endfor %}
</table>
{% endif %}

<h2>Limiting the Builders that are Displayed</h2>

Expand All @@ -84,13 +88,12 @@ <h2>Showing only the Builders with failures</h2>
<p>By adding the <tt>failures_only=true</tt> argument, the display will be limited
to showing builders that are currently failing. A builder is considered
failing if the last finished build was not successful, a step in the current
build(s) failed, or if the builder is offline.
build(s) failed, or if the builder is offline.</p>

<p>
<input type="checkbox" name="failures_only" value="true"
{% if failures_only %}checked="checked"{% endif %} >
{% if failures_only %}checked="checked"{% endif %}/>
Show failures only
</input>
</p>

<h2>Auto-reloading the Page</h2>
Expand All @@ -101,7 +104,7 @@ <h2>Auto-reloading the Page</h2>
<table>
{% for value, name in times %}
<tr><td><input type="radio" name="reload" value="{{ value|e }}"
{% if value == current_reload_time %}checked="checked"{% endif %} >
{% if value == current_reload_time %}checked="checked"{% endif %}/>
</td><td>{{ name|e }}</td></tr>
{% endfor %}
</table>
Expand Down
2 changes: 1 addition & 1 deletion buildbot/status/web/waterfall.py
Expand Up @@ -406,7 +406,7 @@ def with_args(req, remove_args=[], new_args=[], new_path=None):
newargs[k].append(v)
else:
newargs[k] = [v]
newquery = "&".join(["%s=%s" % (urllib.quote(k), urllib.quote(v))
newquery = "&amp;".join(["%s=%s" % (urllib.quote(k), urllib.quote(v))
for k in newargs
for v in newargs[k]
])
Expand Down

0 comments on commit e9bb78e

Please sign in to comment.