Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 11557)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 11558)
@@ -4,4 +4,6 @@
 1.2dev (unreleased)
 ===================
+
+* File input fields brought into shape with Bootstrap 3.
 
 * Transcript and access code pagetemplates adjusted.
Index: /main/waeup.kofa/trunk/layout/static/css/base.css
===================================================================
--- /main/waeup.kofa/trunk/layout/static/css/base.css	(revision 11557)
+++ /main/waeup.kofa/trunk/layout/static/css/base.css	(revision 11558)
@@ -131,8 +131,11 @@
 /* Buttons */
 
-.btn {
-    margin: 4px;
-    font-size: 13px;
-    display: inline;
+input.btn {
+    padding: 8px 12px;
+    margin-right: 4px;
+}
+
+input.btn-sm {
+  padding: 5px 10px;
 }
 
Index: /main/waeup.kofa/trunk/layout/static/css/file-upload.css
===================================================================
--- /main/waeup.kofa/trunk/layout/static/css/file-upload.css	(revision 11558)
+++ /main/waeup.kofa/trunk/layout/static/css/file-upload.css	(revision 11558)
@@ -0,0 +1,19 @@
+.btn-file {
+    position: relative;
+    overflow: hidden;
+}
+.btn-file input[type=file] {
+    position: absolute;
+    top: 0;
+    right: 0;
+    min-width: 100%;
+    min-height: 100%;
+    font-size: 999px;
+    text-align: right;
+    filter: alpha(opacity=0);
+    opacity: 0;
+    outline: none;
+    background: white;
+    cursor: inherit;
+    display: block;
+}
Index: /main/waeup.kofa/trunk/layout/static/js/file-upload.js
===================================================================
--- /main/waeup.kofa/trunk/layout/static/js/file-upload.js	(revision 11558)
+++ /main/waeup.kofa/trunk/layout/static/js/file-upload.js	(revision 11558)
@@ -0,0 +1,21 @@
+$(document)
+	.on('change', '.btn-file :file', function() {
+		var input = $(this),
+		numFiles = input.get(0).files ? input.get(0).files.length : 1,
+		label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
+		input.trigger('fileselect', [numFiles, label]);
+});
+
+$(document).ready( function() {
+	$('.btn-file :file').on('fileselect', function(event, numFiles, label) {
+
+		var input = $(this).parents('.input-group').find(':text'),
+			log = numFiles > 1 ? numFiles + ' files selected' : label;
+
+		if( input.length ) {
+			input.val(log);
+		} else {
+			if( log ) alert(log);
+		}
+	});
+});
Index: /main/waeup.kofa/trunk/layout/theme.html
===================================================================
--- /main/waeup.kofa/trunk/layout/theme.html	(revision 11557)
+++ /main/waeup.kofa/trunk/layout/theme.html	(revision 11558)
@@ -18,4 +18,5 @@
           rel="stylesheet">
     <link href="static/css/base.css" rel="stylesheet">
+    <link href="static/css/file-upload.css" rel="stylesheet">
 
     <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
@@ -271,5 +272,39 @@
                      title="This is a tooltip">Sample Tooltip
                 </div>
+
                 <br><br>
+
+                <h3>File Upload</h3>
+                <br>
+                <a href="#">Birth Certificate Scan</a>
+                <input type="submit"
+                       value="Delete file"
+                       class="btn btn-danger" />
+                <div class="btn btn-default btn-file">
+                  Select new file&hellip;
+                  <input type="file"/>
+                </div>
+                <input type="submit"
+                       value="Upload selected file"
+                       class="btn btn-primary" />
+                (10 kB max.)
+                <br><br>
+
+        				<div class="input-group">
+        					<div class="input-group-btn">
+        						<div class="btn btn-default btn-file">
+                      Select new file&hellip;
+                      <input type="file">
+                    </div>
+        					</div>
+        					<input type="text" class="form-control" readonly>
+                  <div class="input-group-btn">
+                    <input type="submit"
+                           value="Upload selected file"
+                           class="btn btn-primary" />
+                    (10 kB max.)
+                  </div>
+                </div>
+
 
               </div><!-- /tab-content -->
@@ -309,9 +344,8 @@
                            name="myinput[]" placeholder="A name..." />
                   </div>
-                  <button type="submit" class="btn rowadd btn-default">
+                  <div type="submit" class="btn rowadd btn-default">
                     Add row
-                  </button>
-                  <br />
-                  <button type="submit" class="btn btn-primary">Save</button>
+                  </div>
+                  <div type="submit" class="btn btn-primary">Save</div>
                 </fieldset>
               </form>
@@ -338,7 +372,7 @@
                       <form method="post">
                         <input type="hidden" name="userid" value="admin" />
-                        <input class="btn btn-sm btn-primary" type="submit"
+                        <input class="btn btn-primary btn-sm" type="submit"
                                name="manage" value="Manage" />
-                        <input class="btn btn-sm btn-default" type="submit"
+                        <input class="btn btn-default btn-sm" type="submit"
                                name="delete" value="Remove" />
                       </form>
@@ -518,4 +552,5 @@
     <script src="static/js/kofa-activate-tab.js"></script>
     <script src="static/js/kofa-scrollto.js"></script>
+    <script src="static/js/file-upload.js"></script>
     <script class="kofa-script-tooltip"
         src="static/js/kofa-tooltip.js">
Index: /main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt	(revision 11557)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt	(revision 11558)
@@ -28,6 +28,14 @@
         <td>
           <img src="passport.jpg" height="180px" /><br />
-          <input type="file" name="form.passport" />
           <br />
+      		<div class="input-group half">
+      			<div class="input-group-btn">
+      				<div class="btn btn-default btn-file">
+                Select&hellip;
+                <input type="file" name="form.passport" />
+              </div>
+      			</div>
+      			<input type="text" class="form-control" readonly>
+          </div>
           <span i18n:translate="">
             Max. file size:
Index: /main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenteruploadpage.pt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenteruploadpage.pt	(revision 11557)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenteruploadpage.pt	(revision 11558)
@@ -16,5 +16,13 @@
       </td>
       <td>
-        <input type="file" size=47 name="uploadfile:file" />
+    		<div class="input-group half">
+    			<div class="input-group-btn">
+    				<div class="btn btn-default btn-file">
+              Select&hellip;
+              <input type="file" name="uploadfile:file" />
+            </div>
+    			</div>
+    			<input type="text" class="form-control" readonly>
+        </div>
       </td>
     </tr>
Index: /main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/fileupload.pt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/fileupload.pt	(revision 11557)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/fileupload.pt	(revision 11558)
@@ -4,5 +4,30 @@
   </td>
   <td>
+
+		<div class="input-group">
+			<div class="input-group-btn">
+				<div class="btn btn-default btn-file">
+          Select new file&hellip;
+          <input type="file" tal:attributes="name viewlet/input_name" />
+        </div>
+			</div>
+			<input type="text" class="form-control" readonly>
+      <div class="input-group-btn">
+        <input type="submit"
+               tal:attributes="id python:('upload_%s' % viewlet.input_name);
+                name python:('upload_%s' % viewlet.input_name);
+                value viewlet/upload_button"
+               class="btn btn-primary" />
+        (<span tal:replace="viewlet/max_upload_size">10 kB</span> max.)
+      </div>
+    </div>
+
     <tal:file tal:condition="viewlet/file_exists">
+      <br />
+      <input type="submit"
+             tal:attributes="id python:('delete_%s' % viewlet.input_name);
+                name python:('delete_%s' % viewlet.input_name);
+                value viewlet/delete_button"
+             class="btn btn-danger" />&nbsp;
       <a tal:attributes="href python: view.url(context, viewlet.download_name)"
          tal:content="viewlet/title"
@@ -11,20 +36,5 @@
       </a>
     </tal:file>
-    <input type="file" tal:attributes="name viewlet/input_name"/>
-    <br />
-    <input type="submit" tal:condition="viewlet/file_exists"
-           tal:attributes="id python:('delete_%s' % viewlet.input_name);
-              name python:('delete_%s' % viewlet.input_name);
-              value viewlet/delete_button"
-           class="btn btn-danger" />
-    <input type="submit"
-             tal:attributes="id python:('upload_%s' % viewlet.input_name);
-                name python:('upload_%s' % viewlet.input_name);
-                value viewlet/upload_button"
-             class="btn btn-primary" />
-    <span i18n:translate="">
-      Max. file size:
-    </span>
-    <span tal:replace="viewlet/max_upload_size">10 KB</span>
+
     <br />
   </td>
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/imageupload.pt
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/imageupload.pt	(revision 11557)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/imageupload.pt	(revision 11558)
@@ -6,4 +6,5 @@
     <img align="middle" height="125px"
          tal:attributes="src python: view.url(context, viewlet.download_name)" />
+    &nbsp;
     <input type="submit" tal:condition="viewlet/file_exists"
      tal:attributes="id python:('delete_%s' % viewlet.input_name);
@@ -11,15 +12,22 @@
      value="Delete" class="btn btn-danger" />
     <br /><br />
-    <input type="file" tal:attributes="name viewlet/input_name"/>
-    <br /><br />
-    <input type="submit"
-             tal:attributes="id python:('upload_%s' % viewlet.input_name);
+
+		<div class="input-group">
+			<div class="input-group-btn">
+				<div class="btn btn-default btn-file">
+          Select new file&hellip;
+          <input type="file" tal:attributes="name viewlet/input_name" />
+        </div>
+			</div>
+			<input type="text" class="form-control" readonly>
+      <div class="input-group-btn">
+        <input type="submit"
+               tal:attributes="id python:('upload_%s' % viewlet.input_name);
                 name python:('upload_%s' % viewlet.input_name);
                 value viewlet/upload_button"
-             value="Upload" class="btn btn-primary" />
-    <span i18n:translate="">
-      Max. file size:
-    </span>
-    <span tal:replace="viewlet/max_upload_size">10 KB</span>
+               class="btn btn-primary" />
+        (<span tal:replace="viewlet/max_upload_size">10 kB</span> max.)
+      </div>
+    </div>
   </td>
 </tr>
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py	(revision 11557)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py	(revision 11558)
@@ -894,6 +894,6 @@
     tab_redirect = '#tab2-top'
     mus = 1024 * 150
-    upload_button =_('Upload new file')
-    delete_button = _('Delete attachment')
+    upload_button =_('Upload selected file')
+    delete_button = _('Delete')
 
     @property
