Changeset 7319 for main/waeup.sirp/trunk


Ignore:
Timestamp:
10 Dec 2011, 05:12:28 (13 years ago)
Author:
Henrik Bettermann
Message:

Label colons should be rendered by pagetemplates and not by label attributes.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/filedisplay.pt

    r7107 r7319  
    22  <td class="label">
    33    <label i18n:translate="">
    4         <span tal:replace="viewlet/label">FILENAME</span>
     4        <span tal:replace="viewlet/label">FILENAME</span>:
    55    </label>
    66  </td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/fileupload.pt

    r7127 r7319  
    22  <td class="label">
    33    <label i18n:translate="" tal:attributes="for viewlet/input_name">
    4         <span tal:replace="viewlet/label">FILENAME</span>
     4        <span tal:replace="viewlet/label">FILENAME</span>:
    55    </label>
    66  </td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py

    r7318 r7319  
    5151FONT_COLOR = 'black'
    5252
    53 def formatted_string(color=FONT_COLOR, size=FONT_SIZE):
     53def formatted_label(color=FONT_COLOR, size=FONT_SIZE):
     54    tag1 ='<font color=%s size=%d>' % (color, size)
     55    return tag1 + '%s:</font>'
     56
     57def formatted_text(color=FONT_COLOR, size=FONT_SIZE):
    5458    tag1 ='<font color=%s size=%d>' % (color, size)
    5559    return tag1 + '%s</font>'
     
    98102        if widget.name == 'form.adm_code':
    99103            continue
    100         f_label = formatted_string() % widget.label.strip()
     104        f_label = formatted_label() % widget.label.strip()
    101105        f_label = Paragraph(f_label, style["Normal"])
    102         f_text = formatted_string() % widget()
     106        f_text = formatted_text() % widget()
    103107        f_text = Paragraph(f_text, style["Normal"])
    104108        data_right.append([f_label,f_text])
     
    116120    style = getSampleStyleSheet()
    117121    for element in tableheader:
    118         field = formatted_string(color='white') % element[0]
     122        field = formatted_text(color='white') % element[0]
    119123        field = Paragraph(field, style["Normal"])
    120124        line.append(field)
     
    123127        line = []
    124128        for element in tableheader:
    125               field = formatted_string() % str(getattr(ticket,element[1],u' '))
     129              field = formatted_text() % str(getattr(ticket,element[1],u' '))
    126130              field = Paragraph(field, style["Normal"])
    127131              line.append(field)
     
    252256        data = []
    253257        for widget in view.widgets:
    254             f_label = formatted_string() % widget.label.strip()
     258            f_label = formatted_label() % widget.label.strip()
    255259            f_label = Paragraph(f_label, style["Normal"])
    256             f_text = formatted_string() % str(widget())
     260            f_text = formatted_text() % str(widget())
    257261            f_text = Paragraph(f_text, style["Normal"])
    258262            data.append([f_label,f_text])
     
    272276            # Insert list of scanned documents
    273277            for viewlet in fm.viewlets:
    274                 f_label = formatted_string() % viewlet.label
     278                f_label = formatted_label() % viewlet.label
    275279                f_label = Paragraph(f_label, style["Normal"])
    276280                if viewlet.template.__grok_name__ == 'imagedisplay':
     
    284288                    data.append([f_label,doc_img])
    285289                else:
    286                     f_text = formatted_string() % viewlet.title
     290                    f_text = formatted_text() % viewlet.title
    287291                    f_text = Paragraph(f_text, style["Normal"])
    288292                    data.append([f_label,f_text])
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7280 r7319  
    280280    grok.order(1)
    281281    grok.require('waeup.viewStudent')
    282     label = u'File:'
     282    label = u'File'
    283283    title = u'Scan'
    284284    download_name = u'filename.jpg'
     
    347347    grok.require('waeup.viewStudent')
    348348    grok.template('imagedisplay')
    349     label = u'Passport Picture:'
     349    label = u'Passport Picture'
    350350    download_name = u'passport.jpg'
    351351
     
    358358    grok.require('waeup.manageStudent')
    359359    grok.template('imageupload')
    360     label = u'Passport Picture (jpg only):'
     360    label = u'Passport Picture (jpg only)'
    361361    mus = 1024 * 50
    362362    download_name = u'passport.jpg'
     
    373373    """
    374374    grok.order(1)
    375     label = u'Birth Certificate:'
     375    label = u'Birth Certificate'
    376376    title = u'Birth Certificate Scan'
    377377    download_name = u'birth_certificate'
     
    384384    """
    385385    grok.order(1)
    386     label = u'Birth Certificate:'
     386    label = u'Birth Certificate'
    387387    title = u'Birth Certificate Scan'
    388388    mus = 1024 * 150
     
    394394    """
    395395    grok.order(1)
    396     label = u'Acceptance Letter:'
     396    label = u'Acceptance Letter'
    397397    title = u'Acceptance Letter Scan'
    398398    download_name = u'acceptance_letter'
     
    405405    """
    406406    grok.order(2)
    407     label = u'Acceptance Letter:'
     407    label = u'Acceptance Letter'
    408408    title = u'Acceptance Letter Scan'
    409409    mus = 1024 * 150
Note: See TracChangeset for help on using the changeset viewer.