Fixes an issue where the organization home page would throw a 505 when no projects...
[Melange.git] / app / soc / templates / soc / templatetags / _as_table_row.html
blobf3055ae839b415574afe93b414136031a1501866
1 {% comment %}
2 Licensed under the Apache License, Version 2.0 (the "License");
3 you may not use this file except in compliance with the License.
4 You may obtain a copy of the License at
6 http://www.apache.org/licenses/LICENSE-2.0
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13 {% endcomment %}
15 {% if errors %}
16 <tr>
17 {% block error_td %}
18 <td>&nbsp;</td>
19 <td colspan="3" class="formfielderror">
20 {% endblock error_td %}
21 {% for error in errors %}
22 <span class="formfielderrorlabel">{{ error }}</span> <br />
23 {% endfor %}
24 </td>
25 </tr>
26 {% endif %}
28 {% block label_row %}{% endblock %}
30 <tr>
31 {% block label_column %}
32 <td class="{{ field_class_type }}">
33 {{ label }}
34 </td>
35 {% endblock %}
36 <td class="formfieldvalue">
37 {% if select_url %}
38 <script type="text/javascript">
39 $.getJSON("{{ select_url|safe }}",
40 function(data){
41 $("#{{ field_id }}").autocomplete(data.data, {
42 matchContains: true,
43 formatItem: function(item) {
44 return item.link_id+" ("+item.name+")";
46 formatResult: function(item) {
47 return item.link_id;
49 });
52 </script>
53 {% endif %}
54 {% if help_text %}
55 <script type="text/javascript">
56 $(document).ready( function() {
57 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>";
58 var tooltip_object=null;
59 $("#{{ field_id }}").focus(function() {
60 if (tooltip_object==null) {
61 tooltip_object = $(tooltip).purr({usingTransparentPNG: true});
63 });
64 $("#{{ field_id }}").blur(function() {
65 if (tooltip_object!==null) {
66 tooltip_object.remove();
67 tooltip_object=null;
69 });
70 });
71 </script>
72 {% endif %}
73 {{ field|safe }}
74 </td>
76 {% if required %}
77 <td class="formfieldrequired">(required)</td>
78 {% else %}
79 <td></td>
80 {% endif %}
82 {% if example_text %}
83 <td class="formfieldexample">{{ example_text|safe }}</td>
84 {% else %}
85 <td></td>
86 {% endif %}
87 </tr>