Changeset 190

Show
Ignore:
Timestamp:
02/09/10 13:54:02 (3 years ago)
Author:
luciano.ramalho
Message:

added linebreaks formatting to trial html dump view

Location:
trunk/clinicaltrials/registry
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/clinicaltrials/registry/models.py

    r186 r190  
    33 
    44from django.utils.translation import ugettext_lazy as _ 
     5from django.utils.html import linebreaks 
    56 
    67from datetime import datetime 
     
    4142            if field.rel and hasattr(value, 'html_dump'): 
    4243                content = '<table>%s</table>' % value.html_dump(seen) 
    43             else:     
     44            else: 
    4445                content = unicode(value) 
     46                if u'\n' in content: 
     47                    content = linebreaks(content) 
    4548            html.append('<tr><th>%s</th><td>%s</td></tr>' % (field.name, content)) 
    4649        for field_name in dir(self): 
     
    5962                        #else:     
    6063                        content = unicode(rel_value) 
     64                        if u'\n' in content: 
     65                            content = linebreaks(content) 
    6166                        inner_html.append('<tr><th>%s</th><td>%s</td></tr>' % (id, content)) 
    6267                    content = '<table>%s</table>' % '\n\t'.join(inner_html) 
  • trunk/clinicaltrials/registry/views.py

    r189 r190  
    2424 
    2525EXTRA_FORMS = 2 
    26 TRIAL_FORMS = ['Trial Identification Form', 
    27                'Sponsors Form', 
    28                'Health Conditions Form', 
    29                'Interventions Form', 
    30                'Recruitment Form', 
    31                'Study Type Form', 
    32                'Outcomes Form', 
    33                'Descriptor Form'] 
     26TRIAL_FORMS = ['Trial Identification', 
     27               'Sponsors', 
     28               'Health Conditions', 
     29               'Interventions', 
     30               'Recruitment', 
     31               'Study Type', 
     32               'Outcomes', 
     33               'Contacts'] 
    3434 
    3535 
     
    6565    return HttpResponse(t.render(c)) 
    6666 
    67  
    6867@login_required 
    6968def step_1(request, trial_pk):