Changeset 7112


Ignore:
Timestamp:
15 Nov 2011, 07:21:29 (13 years ago)
Author:
Henrik Bettermann
Message:

Add passport picture uploader to student base data pages.

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/default_waeup_display_form.pt

    r7097 r7112  
    1515      </tr>
    1616    </tal:block>
    17     <tal:actionbar content="structure provider:files" />
     17    <tal:files content="structure provider:files" />
    1818  </tbody>
    1919  <tfoot>
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/default_waeup_edit_form.pt

    r7097 r7112  
    4343        </tr>
    4444      </tal:block>
    45       <tal:actionbar content="structure provider:files" />
     45      <tal:files content="structure provider:files" />
    4646    </tbody>
    4747  </table>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/baseeditpage.pt

    r6756 r7112  
    4040        </tr>
    4141      </tal:block>
     42      <tal:files content="structure provider:files" />
    4243    </tbody>
    4344  </table>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basemanagepage.pt

    r6701 r7112  
    6161        </td>
    6262      </tr>
     63      <tal:files content="structure provider:files" />
    6364    </tbody>
    6465  </table>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/basepage.pt

    r6699 r7112  
    2323      </td>
    2424    <tr>
     25    <tal:files content="structure provider:files" />
    2526  </tbody>
    2627  <tfoot>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/imagedisplay.pt

    r7106 r7112  
    11<tr>
    22  <td class="label">
    3     <label i18n:translate="" tal:attributes="for viewlet/input_name">
     3    <label i18n:translate="">
    44        <span tal:replace="viewlet/label">FILENAME</span>
    55    </label>
     
    77  <td class="field">
    88    <span class="widget">
    9       <img tal:attributes="src viewlet/download_name" /><br />
     9      <img height="125px" tal:attributes="src viewlet/download_name" />
     10      <br />
    1011    </span>
    1112  </td>
  • main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/imageupload.pt

    r7106 r7112  
    77  <td class="field">
    88    <span class="widget">
    9       <img tal:attributes="src viewlet/download_name" /><br />
     9      <img align="middle" height="125px"
     10           tal:attributes="src viewlet/download_name" />
     11      <input type="submit" tal:condition="viewlet/file_exists"
     12       tal:attributes="id python:('delete_%s' % viewlet.input_name);
     13          name python:('delete_%s' % viewlet.input_name)"
     14       value="Delete" class="button" />
     15      <br /><br />
    1016      <input type="file" tal:attributes="name viewlet/input_name"/>
    11       <br />
     17      <input type="submit"
     18               tal:attributes="id python:('upload_%s' % viewlet.input_name);
     19                  name python:('upload_%s' % viewlet.input_name)"
     20               value="Upload" class="button" />
    1221      <span i18n:translate="">
    1322        Max. file size:
  • main/waeup.sirp/trunk/src/waeup/sirp/students/viewlets.py

    r7111 r7112  
    99from waeup.sirp.students.browser import (
    1010    StudentClearanceDisplayFormPage, StudentClearanceManageFormPage,
    11     write_log_message)
    12 from waeup.sirp.students.interfaces import IStudentClearance
     11    write_log_message, StudentBaseManageFormPage, StudentBaseDisplayFormPage,
     12    StudentBaseEditFormPage)
     13from waeup.sirp.students.interfaces import IStudent, IStudentClearance
    1314
    1415grok.context(IWAeUPObject) # Make IWAeUPObject the default context
     
    297298        return
    298299
     300class PassportDisplay(FileDisplay):
     301    """Passport display viewlet.
     302    """
     303    grok.order(1)
     304    grok.context(IStudent)
     305    grok.view(StudentBaseDisplayFormPage)
     306    grok.require('waeup.viewStudent')
     307    grok.template('imagedisplay')
     308    label = u'Passport Picture:'
     309    download_name = u'passport.jpg'
     310
     311class PassportUploadManage(FileUpload):
     312    """Passport upload viewlet for officers.
     313    """
     314    grok.order(1)
     315    grok.context(IStudent)
     316    grok.view(StudentBaseManageFormPage)
     317    grok.require('waeup.manageStudents')
     318    grok.template('imageupload')
     319    label = u'Passport Picture (jpg only):'
     320    mus = 1024 * 50
     321    download_name = u'passport.jpg'
     322    input_name = u'passport'
     323
     324class PassportUploadEdit(PassportUploadManage):
     325    """Passport upload viewlet for students.
     326    """
     327    grok.view(StudentBaseEditFormPage)
     328    grok.require('waeup.handleStudent')
     329
    299330class BirthCertificateDisplay(FileDisplay):
    300     """Birth Certificate upload viewlet.
     331    """Birth Certificate display viewlet.
    301332    """
    302333    grok.order(1)
     
    314345
    315346class AcceptanceLetterDisplay(FileDisplay):
    316     """Acceptance Letter upload viewlet.
     347    """Acceptance Letter display viewlet.
    317348    """
    318349    grok.order(1)
     
    323354    """AcceptanceLetter upload viewlet.
    324355    """
    325     grok.order(1)
     356    grok.order(2)
    326357    label = u'Acceptance Letter (jpg only):'
    327358    mus = 1024 * 150
     
    334365    grok.baseclass()
    335366    grok.name('none.jpg')
    336     grok.view(StudentClearanceManageFormPage)
     367    grok.context(IStudentClearance)
    337368    grok.require('waeup.viewStudent')
    338369    download_name = u'none.jpg'
     
    351382        return image
    352383
     384class Passport(Image):
     385    """Renders jpeg passport picture.
     386    """
     387    grok.name('passport.jpg')
     388    download_name = u'passport.jpg'
     389    grok.context(IStudent)
     390
    353391class BirthCertificateImage(Image):
    354392    """Renders birth certificate jpeg scan.
Note: See TracChangeset for help on using the changeset viewer.