mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
(refs #12) Modified to use the helper of the attachment.
This commit is contained in:
@@ -6,19 +6,18 @@
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab1" data-toggle="tab">Write</a></li>
|
||||
<li><a href="#tab2" data-toggle="tab" id="preview">Preview</a></li>
|
||||
@*
|
||||
<li class="pull-right">
|
||||
<a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown Syntax Guide</a>
|
||||
</li>
|
||||
*@
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab1">
|
||||
<span id="error-content" class="error"></span>
|
||||
<div id="clickable">
|
||||
@textarea = {
|
||||
<textarea id="content" name="content"@if(style.nonEmpty){ style="@style"} placeholder="@placeholder">@content</textarea>
|
||||
<span class="muted">Attach images by dragging & dropping, or selecting them.</span>
|
||||
</div>
|
||||
}
|
||||
@if(enableWikiLink){
|
||||
@textarea
|
||||
} else {
|
||||
@helper.html.attached(repository.owner, repository.name)(textarea)
|
||||
}
|
||||
</div>
|
||||
<div class="tab-pane" id="tab2">
|
||||
<div class="markdown-body" id="preview-area">
|
||||
@@ -45,18 +44,5 @@ $(function(){
|
||||
prettyPrint();
|
||||
});
|
||||
});
|
||||
|
||||
@if(!enableWikiLink){
|
||||
$("div#clickable").dropzone({
|
||||
url: '@path/upload/image/@repository.owner/@repository.name',
|
||||
maxFilesize: 10,
|
||||
previewTemplate: "<div class=\"dz-preview\">\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress>Uploading your images...</span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n</div>",
|
||||
success: function(file, id) {
|
||||
var images = '\n![' + file.name.split('.')[0] + '](@url(repository)/_attached/' + id + ')';
|
||||
$('#content').val($('#content').val() + images);
|
||||
file.previewElement.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
@(content: String, commentId: Int, owner: String, repository: String)(implicit context: app.Context)
|
||||
@import context._
|
||||
<span id="error-edit-content-@commentId" class="error"></span>
|
||||
@helper.html.attached(owner, repository){
|
||||
<textarea style="width: 680px; height: 100px;" id="edit-content-@commentId">@content</textarea>
|
||||
}
|
||||
<div>
|
||||
<input type="button" id="update-comment-@commentId" class="btn btn-small" value="Update Comment"/>
|
||||
<input type="button" id="cancel-comment-@commentId" class="btn btn-small btn-danger pull-right" value="Cancel"/>
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
@import context._
|
||||
<span id="error-edit-title" class="error"></span>
|
||||
<input type="text" style="width: 680px;" id="edit-title" value="@title"/>
|
||||
@helper.html.attached(owner, repository){
|
||||
<textarea style="width: 680px; height: 100px; max-height: 300px;" id="edit-content">@content.getOrElse("")</textarea>
|
||||
}
|
||||
<div>
|
||||
<input type="button" id="update" class="btn btn-small" value="Update Issue"/>
|
||||
<input type="button" id="cancel" class="btn btn-small btn-danger pull-right" value="Cancel"/>
|
||||
|
||||
Reference in New Issue
Block a user