========
- every paste is a git repository
- paste editing
+
+ - add new files
+ - delete existing files
- multiple files in one paste
- syntax highlighting with GeSHi
- rST rendering
</div>
</div>
<textarea name="files[{{fileid}}][content]" id="content_{{fileid}}" cols="80" rows="15" class="content">{{file.getContent}}</textarea>
+ <div class="row-fluid">
+ <div class="span9">
+
+ <!--
+ <label for="upload_{{fileid}}" class="inline">Replace with file upload:</label>
+ <input type="file" name="files[{{fileid}}][upload]" id="upload_{{fileid}}" class="btn"/>
+ -->
+ </div>
+ <div class="span3" style="text-align: right">
+ <input type="checkbox" name="files[{{fileid}}][delete]" value="1" id="delete_{{fileid}}"/>
+ <label for="delete_{{fileid}}" class="inline">delete file</label>
+ </div>
+ </div>
</div>
}
$bNew = false;
+ $bDelete = false;
if (!isset($orignalName) || $orignalName == '') {
//new file
$bNew = true;
//unknown file
//FIXME: Show error message
continue;
+ } else if (isset($arFile['delete']) && $arFile['delete'] == 1) {
+ $bDelete = true;
} else if ($orignalName != $name) {
//FIXME: what to do with overwrites?
$vc->getCommand('mv')
}
$file = $this->repo->getFileByName($name, false);
- if ($bNew || $file->getContent() != $arFile['content']) {
+ if ($bDelete) {
+ $command = $vc->getCommand('rm')
+ ->addArgument($file->getFilename())
+ ->execute();
+ $bChanged = true;
+ } else if ($bNew || $file->getContent() != $arFile['content']) {
file_put_contents($file->getPath(), $arFile['content']);
$command = $vc->getCommand('add')
->addArgument($file->getFilename())