Ticket #5405: 5405-1.diff

File 5405-1.diff, 2.0 KB (added by mattmcc, 8 years ago)
  • django/contrib/admin/templates/admin_doc/model_detail.html

     
    1515
    1616{% block content %}
    1717<div id="content-main">
    18 <h1>{{ summary|escape }}</h1>
     18<h1>{{ name|escape }}</h1>
     19<h2 class="subhead">{% if summary %}
     20  {% trans summary %}
     21{% endif %}</h2>
    1922
    20 {% if description %}
    21   <p>{% filter escape|linebreaksbr %}{% trans description %}{% endfilter %}</p>
     23{% if body %}
     24  <p>{% trans body %}</p>
    2225{% endif %}
    2326
     27<h2>{{ fieldsheading|escape }}</h2>
    2428<div class="module">
    2529<table class="model">
    2630<thead>
  • django/contrib/admindocs/views.py

     
    173173
    174174    opts = model._meta
    175175
     176    title, body, metadata = utils.parse_docstring(model.__doc__)
     177    if title:
     178        title = utils.parse_rst(title, 'model', _('model:') + model_name)
     179    if body:
     180        body = utils.parse_rst(body, 'model', _('model:') + model_name)
     181    for key in metadata:
     182        metadata[key] = utils.parse_rst(metadata[key], 'model', _('model:') + model_name)
     183
    176184    # Gather fields/field descriptions.
    177185    fields = []
    178186    for field in opts.fields:
     
    227235
    228236    return render_to_response('admin_doc/model_detail.html', {
    229237        'name': '%s.%s' % (opts.app_label, opts.object_name),
    230         'summary': _("Fields on %s objects") % opts.object_name,
    231         'description': model.__doc__,
     238        'summary': title,
     239        'fieldsheading': _("Fields on %s objects") % opts.object_name,
    232240        'fields': fields,
     241        'body': body,
     242        'meta': metadata,
    233243    }, context_instance=RequestContext(request))
    234244model_detail = staff_member_required(model_detail)
    235245
Back to Top