Skip to content

Commit f21aa9d

Browse files
committed
(refs #16)Remove attachment area from comment form
1 parent ca3998a commit f21aa9d

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

src/main/scala/gitbucket/gist/controller/GistController.scala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ trait GistControllerBase extends ControllerBase {
3737
"content" -> trim(label("Comment", text(required)))
3838
)(CommentForm.apply)
3939

40+
////////////////////////////////////////////////////////////////////////////////
41+
//
42+
// Gist Actions
43+
//
44+
////////////////////////////////////////////////////////////////////////////////
45+
4046
get("/gist"){
4147
if(context.loginAccount.isDefined){
4248
val gists = getRecentGists(context.loginAccount.get.userName, 0, 4)
@@ -286,6 +292,12 @@ trait GistControllerBase extends ControllerBase {
286292
html.editor(count, "", JGitUtil.ContentInfo("text", None, Some("UTF-8")))
287293
}
288294

295+
////////////////////////////////////////////////////////////////////////////////
296+
//
297+
// Fork Actions
298+
//
299+
////////////////////////////////////////////////////////////////////////////////
300+
289301
post("/gist/:userName/:repoName/fork")(usersOnly {
290302
val userName = params("userName")
291303
val repoName = params("repoName")
@@ -329,6 +341,12 @@ trait GistControllerBase extends ControllerBase {
329341
} getOrElse NotFound
330342
}
331343

344+
////////////////////////////////////////////////////////////////////////////////
345+
//
346+
// Comment Actions
347+
//
348+
////////////////////////////////////////////////////////////////////////////////
349+
332350
post("/gist/:userName/:repoName/_preview"){
333351
val userName = params("userName")
334352
val repoName = params("repoName")
@@ -404,6 +422,11 @@ trait GistControllerBase extends ControllerBase {
404422
redirect(s"/gist/${userName}/${repoName}/_comments/${commentId}")
405423
})
406424

425+
////////////////////////////////////////////////////////////////////////////////
426+
//
427+
// Private Methods
428+
//
429+
////////////////////////////////////////////////////////////////////////////////
407430

408431
private def _gist(userName: String, repoName: Option[String] = None, revision: String = "master") = {
409432
repoName match {

src/main/twirl/gitbucket/gist/commentpreview.scala.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,14 @@
1515
<div class="tab-content">
1616
<div class="tab-pane active" id="tab@uid">
1717
<span id="error-content" class="error"></span>
18-
@helper.html.attached(gist.userName, gist.repositoryName){
19-
<textarea id="content@uid" name="content" placeholder="@placeholder" @if(style.nonEmpty){style="@style"}>@content</textarea>
20-
}
18+
<textarea id="content@uid" name="content" placeholder="@placeholder" @if(style.nonEmpty){style="@style"}>@content</textarea>
2119
</div>
2220
<div class="tab-pane" id="tab@(uid+1)">
2321
<div class="markdown-body" id="preview-area@uid">
2422
</div>
2523
</div>
2624
</div>
2725
</div>
28-
@*
29-
<link href="@assets/vendors/google-code-prettify/prettify.css" type="text/css" rel="stylesheet"/>
30-
<script src="@assets/vendors/google-code-prettify/prettify.js"></script>
31-
*@
3226
<script>
3327
$(function(){
3428
@if(elastic){

0 commit comments

Comments
 (0)