Patch that touches 'upstream' templates, for use in surveys.
Consists out of three changes.
1 - Move the </head> placement in base.hmtl to after the closing of
scripts_block, so templates that extend base.html can add scripts to
the <head>.
2 - Add tooltips for checkboxes inside fieldsets.
3 - Comment out an empty table row in templatetags/_as_table.html,
which probably has an arcane reason to stay empty :)
Reviewed by: Lennard de Rijk, Pawel Solyga
Patch by: Daniel Diniz, James Levy
--- a/app/soc/templates/soc/base.html Mon Jun 22 07:32:45 2009 +0200
+++ b/app/soc/templates/soc/base.html Tue Jun 23 20:43:22 2009 +0200
@@ -99,8 +99,8 @@
{% if uses_duplicates %}
<script type="text/javascript" src="/soc/content/js/duplicate-slots-090505.js"></script>
{% endif %}
- </head>
{% endblock %}
+</head>
{% block body_tag %}
<body>
@@ -109,7 +109,7 @@
<div id="login">
{% block login_links %}
{% if account %}
- <b>{{ account.email }} ({{ account.nickname }})</b> |
+ <b>{{ account.email }} ({{ account.nickname }})</b> |
{% endif %}
{% if is_admin %}
Developer |
@@ -120,10 +120,10 @@
{% if is_local %}
<form id="flush_form" action="/_ah/admin/memcache" method="post" style="display: inline;">
<input type="submit" class="button" name="action:flush" value="Flush Cache"/>
- </form> |
- <a class="novisit" target="_blank" href="/_ah/admin">Admin</a> |
+ </form> |
+ <a class="novisit" target="_blank" href="/_ah/admin">Admin</a> |
{% endif %}
- <a class="novisit" href="http://code.google.com/p/soc/issues/list">Report bugs</a> |
+ <a class="novisit" href="http://code.google.com/p/soc/issues/list">Report bugs</a> |
{% if account %}
<a class="novisit" href="{{sign_out}}">Sign out</a>
{% else %}
@@ -196,7 +196,7 @@
<div id="side" dir="ltr">
<div id="menu">
-{% block sidebar_menu %}
+{% block sidebar_menu %}
<ul>
<li>
<a class="selected" href="/">
--- a/app/soc/templates/soc/templatetags/_as_table_row.html Mon Jun 22 07:32:45 2009 +0200
+++ b/app/soc/templates/soc/templatetags/_as_table_row.html Tue Jun 23 20:43:22 2009 +0200
@@ -56,17 +56,34 @@
$(document).ready( function() {
var tooltip = "<div class='tooltip'><div class='tooltip-body'><img src='/soc/content/images/purrInfo.png' alt='' /><h3>Info</h3><p>{{ help_text }}</p></div><div class='tooltip-bottom'></div></div>";
var tooltip_object=null;
- $("#{{ field_id }}").focus(function() {
- if (tooltip_object==null) {
- tooltip_object = $(tooltip).purr({usingTransparentPNG: true});
- }
- });
- $("#{{ field_id }}").blur(function() {
- if (tooltip_object!==null) {
- tooltip_object.remove();
- tooltip_object=null;
- }
- });
+ var documented = $("#{{ field_id }}");
+ var not_fieldset = documented.attr('tagName') !== 'FIELDSET';
+ if (not_fieldset) {
+ documented.focus(function() {
+ if (tooltip_object==null) {
+ tooltip_object = $(tooltip).purr({usingTransparentPNG: true});
+ }
+ });
+ documented.blur(function() {
+ if (tooltip_object!==null) {
+ tooltip_object.remove();
+ tooltip_object=null;
+ }
+ });
+ }
+ else {
+ documented.find("input").hover(function() {
+ if (tooltip_object==null) {
+ tooltip_object = $(tooltip).purr({usingTransparentPNG: true});
+ }
+ },
+ function() {
+ if (tooltip_object!==null) {
+ tooltip_object.remove();
+ tooltip_object=null;
+ }
+ });
+ }
});
</script>
{% endif %}