Ignore:
Timestamp:
2 Apr 2014, 09:58:39 (11 years ago)
Author:
Henrik Bettermann
Message:

File input fields brought into shape with Bootstrap 3. Technique adapted from http://labs.abeautifulsite.net/demos/bootstrap-file-inputs/.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/imageupload.pt

    r11254 r11558  
    66    <img align="middle" height="125px"
    77         tal:attributes="src python: view.url(context, viewlet.download_name)" />
     8    &nbsp;
    89    <input type="submit" tal:condition="viewlet/file_exists"
    910     tal:attributes="id python:('delete_%s' % viewlet.input_name);
     
    1112     value="Delete" class="btn btn-danger" />
    1213    <br /><br />
    13     <input type="file" tal:attributes="name viewlet/input_name"/>
    14     <br /><br />
    15     <input type="submit"
    16              tal:attributes="id python:('upload_%s' % viewlet.input_name);
     14
     15                <div class="input-group">
     16                        <div class="input-group-btn">
     17                                <div class="btn btn-default btn-file">
     18          Select new file&hellip;
     19          <input type="file" tal:attributes="name viewlet/input_name" />
     20        </div>
     21                        </div>
     22                        <input type="text" class="form-control" readonly>
     23      <div class="input-group-btn">
     24        <input type="submit"
     25               tal:attributes="id python:('upload_%s' % viewlet.input_name);
    1726                name python:('upload_%s' % viewlet.input_name);
    1827                value viewlet/upload_button"
    19              value="Upload" class="btn btn-primary" />
    20     <span i18n:translate="">
    21       Max. file size:
    22     </span>
    23     <span tal:replace="viewlet/max_upload_size">10 KB</span>
     28               class="btn btn-primary" />
     29        (<span tal:replace="viewlet/max_upload_size">10 kB</span> max.)
     30      </div>
     31    </div>
    2432  </td>
    2533</tr>
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r11254 r11558  
    894894    tab_redirect = '#tab2-top'
    895895    mus = 1024 * 150
    896     upload_button =_('Upload new file')
    897     delete_button = _('Delete attachment')
     896    upload_button =_('Upload selected file')
     897    delete_button = _('Delete')
    898898
    899899    @property
Note: See TracChangeset for help on using the changeset viewer.