* fixed ui of file form.

This commit is contained in:
Catouse
2014-06-18 11:16:25 +08:00
parent 697e1b5967
commit daf87b209f
2 changed files with 15 additions and 20 deletions

View File

@@ -1,18 +1,22 @@
<style>
.fileBox {margin-bottom: 10px; width: 100%}
table.fileBox td {padding: 0!important}
.fileBox .input-control > input[type='file'] {width: 100%; height: 100%; height: 26px; line-height: 26px; border: none; position: relative;}
.fileBox td .btn {border-radius: 0; border-left: none}
.file-wrapper.form-control {border-right: 0}
</style>
<div id='fileform'>
<?php
/* Define the html code of a file row. */
$fileRow = <<<EOT
<div class='fileBox input-group' id='fileBox\$i'>
<span class='input-control w-p45 pd-0'><input type='file' name='files[]' class='fileControl' tabindex='-1' /></span>
<span class="input-group-addon">{$lang->file->label}</span>
<input type='text' name='labels[]' class='form-control' placeholder='{$lang->file->label}' tabindex='-1' />
<span class='input-group-btn'>
<a href='javascript:void();' onclick='addFile(this)' class='btn'><i class='icon-plus'></i></a>
</span>
<span class='input-group-btn'>
<a href='javascript:void();' onclick='delFile(this)' class='btn'><i class='icon-remove'></i></a>
</span>
</div>
<table class='fileBox' id='fileBox\$i'>
<tr>
<td class='w-p45'><div class='form-control file-wrapper'><input type='file' name='files[]' class='fileControl' tabindex='-1' /></div></td>
<td class=''><input type='text' name='labels[]' class='form-control' placeholder='{$lang->file->label}' tabindex='-1' /></td>
<td class='w-30px'><a href='javascript:void();' onclick='addFile(this)' class='btn btn-block'><i class='icon-plus'></i></a></td>
<td class='w-30px'><a href='javascript:void();' onclick='delFile(this)' class='btn btn-block'><i class='icon-remove'></i></a></td>
</tr>
</table>
EOT;
for($i = 1; $i <= $fileCount; $i ++) echo str_replace('$i', $i, $fileRow);
?>

View File

@@ -310,15 +310,6 @@ div.form-control[contenteditable='true'] {height: auto; text-align: left; outlin
.list-group-item.active,.list-group-item.active:hover {background: #fff; border-color: #ddd; background: #f1f1f1; color: #333; font-weight: bold;}
.list-group-item.active > a {color: #333}
/* File form */
.fileBox {margin-bottom: 10px; width: 100%}
#fileform > .fileBox:last-child {margin-bottom: 0;}
.fileBox .input-group-addon{text-indent: -9999em; padding: 0 !important; border-left: 0; border-right: 0}
.fileBox .form-control[type='text'] + .input-group-btn > .btn {border-left: 0}
.fileBox .form-control[type='text'] {height: 30px;}
.fileBox .input-control {display: table-cell; border: 1px solid #ccc; padding: 0 10px; border-radius: 2px 0 0 2px}
.fileBox .input-control > input[type='file'] {width: 100%; height: 100%; height: 26px; padding: 0 5px; line-height: 26px; border: none; position: relative; top: 0;}
/* Bug status */
.bug-closed, .bug-closed a {color: #808080; text-decoration: line-through;}