app/soc/templates/soc/templatetags/_as_table_row.html
author Sverre Rabbelier <srabbelier@gmail.com>
Sun, 14 Dec 2008 00:33:59 +0000
changeset 741 2dc2c65c5f76
child 785 c740d0129cce
permissions -rw-r--r--
Converted as_table to be a template tag This allows us to move all the HTML from python code (which made it extremely icky and unreadable) to Django templates, which is _a lot_ more readable, and makes it feasable for HTML/CSS experts to change the way these tables are generated. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
741
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
{% comment %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
Licensed under the Apache License, Version 2.0 (the "License");
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     3
you may not use this file except in compliance with the License.
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
You may obtain a copy of the License at
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
  http://www.apache.org/licenses/LICENSE-2.0
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
Unless required by applicable law or agreed to in writing, software
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
distributed under the License is distributed on an "AS IS" BASIS,
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
See the License for the specific language governing permissions and
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
limitations under the License.
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
{% endcomment %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
{% if errors %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
<tr>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    17
  <td>&nbsp;</td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    18
  <td class="formfielderror">
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
  {% for error in errors %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
    <span class="formfielderrorlabel">{{ error }}</span> <br />
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
  {% endfor %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
  </td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
</tr>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
{% endif %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
<tr title="{{ help_text }}">
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    27
  <td class="{{ field_class_type }}">
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    28
    {{ label }}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    29
  </td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    30
  <td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    31
    {{ field }}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    32
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    33
    {% if required %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    34
    <td class="formfieldrequired">(required)</td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
    {% else %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    36
    <td></td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    37
    {% endif %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    38
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    39
    {% if example_text %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    40
      <td class="formfieldexample">e.g. {{ example_text }}</td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    41
    {% else %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    42
      <td></td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    43
    {% endif %}
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    44
  </td>
2dc2c65c5f76 Converted as_table to be a template tag
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
</tr>