Add help popup to MailingListForm.

- Legacy-Id: 276
This commit is contained in:
Bill Fenner 2007-06-10 03:02:01 +00:00
parent 20334bc8aa
commit 100f24baef
7 changed files with 42 additions and 1 deletions

View file

@ -11,5 +11,6 @@ urlpatterns = patterns('django.views.generic.list_detail',
urlpatterns += patterns('', urlpatterns += patterns('',
(r'^nonwg_lists/submit/$', views.non_wg_wizard), (r'^nonwg_lists/submit/$', views.non_wg_wizard),
(r'^request/$', views.list_req_wizard), (r'^request/$', views.list_req_wizard),
(r'^request/help/(?P<field>[^/]+)/$', views.list_req_help),
(r'^approve/(?P<object_id>[^/]+)/$', views.list_approve), (r'^approve/(?P<object_id>[^/]+)/$', views.list_approve),
) )

View file

@ -286,6 +286,10 @@ def list_req_wizard(request):
wiz = ListReqWizard([ ListReqStep1 ]) wiz = ListReqWizard([ ListReqStep1 ])
return wiz(request) return wiz(request)
def list_req_help(request, field):
return render_to_response('mailinglists/list_help_%s.html' % field, {},
context_instance=RequestContext(request) )
def list_approve(request, object_id): def list_approve(request, object_id):
list = get_object_or_404(MailingList, mailing_list_id=object_id) list = get_object_or_404(MailingList, mailing_list_id=object_id)
if list.mail_type == 5 or list.mail_type == 6: if list.mail_type == 5 or list.mail_type == 6:

View file

@ -0,0 +1,9 @@
<html>
<head>
<title>Mailing List Form Field Help</title>
</head>
<body background="/images/ietf_waterbg.gif">
{% block content %}
{% endblock %}
</body>
</html>

View file

@ -0,0 +1,9 @@
{% extends "mailinglists/list_help_base.html" %}
{% block content %}
<br><b>Long description:</b> An introductory description - a few paragraphs - about the list.
It will be include, as html, at the top of the listinfo page. Carriage returns will end a paragraph.<br><br>
The text will be treated as html <i>except</i> that newlines will be translated to <br> - so you can use links, preformatted text, etc, but don't put in carriage returns except where you mean to separate paragraphs. And review your changes - bad html (like some unterminated HTML constructs) can prevent display of the entire listinfo page.<br><br>
<b><font color="blue">Example:</font> This list is for discussions relating to the development, clarification, and implementation of the media gateway control protocol defined in RFC 3015 (and ITU-T Recommendation H.248). Standardization related to this protocol is carried out jointly by the IETF Megaco Working Group and ITU-T Stydy Group 16 Question 3.</b>
{% endblock %}

View file

@ -0,0 +1,10 @@
{% extends "mailinglists/list_help_base.html" %}
{% block content %}
<br><b>Short description:</b> A terse phrase identifying this list.<br><br>
This description is used when the mailing list is listed with other mailing lists, or
in headers, and so forth. It should be as succinct as you can get it, while
still identifying what the list is.<br>
<b><font color="blue">Example:</font> Media Gateway Control working group discussion list.</b>
{% endblock %}

View file

@ -24,7 +24,14 @@ function checkthis () {
{# so don't render anything #} {# so don't render anything #}
{% else %} {% else %}
<tr> <tr>
<th>{{ field.label_tag }}:</th> <th>{{ field.label_tag }}:
{% ifequal field.name "short_desc" %}
<img src="/images/icon_help.gif" border="0" title="Click for help" onClick="window.open('help/{{ field.name }}',null,'height=200,width=500,status=no,toolbar=no,menubar=no,location=no')">
{% endifequal %}
{% ifequal field.name "long_desc" %}
<img src="/images/icon_help.gif" border="0" title="Click for help" onClick="window.open('help/{{ field.name }}',null,'height=300,width=600,status=no,toolbar=no,menubar=no,location=no')">
{% endifequal %}
</th>
<td> <td>
{% if field.errors %} {% if field.errors %}
<ul class="errorlist">{% for error in field.errors %}<li>{{ error|escape }}</li>{% endfor %}</ul> <ul class="errorlist">{% for error in field.errors %}<li>{{ error|escape }}</li>{% endfor %}</ul>

View file

@ -4,6 +4,7 @@
{% block css %} {% block css %}
ul.errorlist { color: red; border: 1px solid red; } ul.errorlist { color: red; border: 1px solid red; }
th { text-align: left; vertical-align: top; font-weight: normal;}
{% block mlcss %}{% endblock %} {% block mlcss %}{% endblock %}
{% endblock %} {% endblock %}