diff --git a/models/action.go b/models/action.go index c514a4c47..536476d7e 100644 --- a/models/action.go +++ b/models/action.go @@ -142,11 +142,21 @@ func (a Action) GetIssueTitle() string { issue, err := GetIssueByIndex(a.RepoID, index) if err != nil { log.Error(4, "GetIssueByIndex: %v", err) - return "500 when get title" + return "500 when get issue" } return issue.Name } +func (a Action) GetIssueContent() string { + index := com.StrTo(a.GetIssueInfos()[0]).MustInt64() + issue, err := GetIssueByIndex(a.RepoID, index) + if err != nil { + log.Error(4, "GetIssueByIndex: %v", err) + return "500 when get issue" + } + return issue.Content +} + func newRepoAction(e Engine, u *User, repo *Repository) (err error) { if err = notifyWatchers(e, &Action{ ActUserID: u.Id, diff --git a/public/config.codekit b/public/config.codekit index 59d0c333e..f5d95f6d8 100644 --- a/public/config.codekit +++ b/public/config.codekit @@ -191,7 +191,7 @@ "outputPathIsOutsideProject": 0, "outputPathIsSetByUser": 0, "outputStyle": 1, - "syntaxCheckerStyle": 0 + "syntaxCheckerStyle": 1 }, "\/js\/jquery-1.11.3.min.js": { "fileType": 64, @@ -281,6 +281,17 @@ "outputPathIsSetByUser": 0, "processed": 0 }, + "\/js\/min\/gogs-min.js": { + "fileType": 64, + "ignore": 1, + "ignoreWasSetByUser": 0, + "inputAbbreviatedPath": "\/js\/min\/gogs-min.js", + "outputAbbreviatedPath": "\/js\/min\/min\/gogs-min-min.js", + "outputPathIsOutsideProject": 0, + "outputPathIsSetByUser": 0, + "outputStyle": 1, + "syntaxCheckerStyle": 1 + }, "\/js\/semantic-2.1.5.min.js": { "fileType": 64, "ignore": 0, diff --git a/public/js/gogs.js b/public/js/gogs.js index 81a9c1f44..34c8c9222 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -630,9 +630,7 @@ $(document).ready(function () { emojify.setConfig({ img_dir: suburl + '/img/emoji' }); - $('.emojify').each(function () { - emojify.run($(this)[0]); - }); + emojify.run(); // Clipboard JS var clipboard = new Clipboard('.clipboard'); diff --git a/public/js/min/gogs-min.js b/public/js/min/gogs-min.js new file mode 100644 index 000000000..0430f9566 --- /dev/null +++ b/public/js/min/gogs-min.js @@ -0,0 +1 @@ +"use strict";function initCommentPreviewTab(t){var e=t.find(".tabular.menu");e.find(".item").tab(),e.find('.item[data-tab="'+e.data("preview")+'"]').click(function(){var i=$(this);$.post(i.data("url"),{_csrf:csrf,mode:"gfm",context:i.data("context"),text:t.find('.tab.segment[data-tab="'+e.data("write")+'"] textarea').val()},function(i){var a=t.find('.tab.segment[data-tab="'+e.data("preview")+'"]');a.html(i),emojify.run(a[0])})}),buttonsClickOnEnter()}function initCommentForm(){function t(t,e,i){$.post(t,{_csrf:csrf,action:e,id:i})}function e(e,i){var a=$(e+" .menu"),n=$(".ui"+e+".list"),o="update"==a.data("action");a.find(".item:not(.no-select)").click(function(){switch($(this).parent().find(".item").each(function(){$(this).removeClass("selected active")}),$(this).addClass("selected active"),o&&t(a.data("update-url"),"",$(this).data("id")),i){case"#milestone_id":n.find(".selected").html('')}),this.on("removedfile",function(e){e.name in t&&$("#"+t[e.name]).remove()})}})}emojify.setConfig({img_dir:suburl+"/img/emoji"}),emojify.run();var i=new Clipboard(".clipboard");i.on("success",function(t){t.clearSelection(),$("#"+t.trigger.getAttribute("id")).popup("destroy"),t.trigger.setAttribute("data-content",t.trigger.getAttribute("data-success")),$("#"+t.trigger.getAttribute("id")).popup("show"),t.trigger.setAttribute("data-content",t.trigger.getAttribute("data-original"))}),i.on("error",function(t){$("#"+t.trigger.getAttribute("id")).popup("destroy"),t.trigger.setAttribute("data-content",t.trigger.getAttribute("data-error")),$("#"+t.trigger.getAttribute("id")).popup("show"),t.trigger.setAttribute("data-content",t.trigger.getAttribute("data-original"))}),$(".delete-button").click(function(){var t=$(this);return $(".delete.modal").modal({closable:!1,onApprove:function(){return"form"==t.data("type")?void $(t.data("form")).submit():void $.post(t.data("url"),{_csrf:csrf,id:t.data("id")}).done(function(t){window.location.href=t.redirect})}}).modal("show"),!1}),$(".show-panel.button").click(function(){$($(this).data("panel")).show()}),$(".show-modal.button").click(function(){$($(this).data("modal")).modal("show")}),buttonsClickOnEnter(),initCommentForm(),initInstall(),initRepository(),initOrganization(),initUser(),initWebhook(),initAdmin()}); \ No newline at end of file diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index b3cf99257..8576d7db8 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -13,7 +13,7 @@
{{index .GetIssueInfos 1}}
+ {{index .GetIssueInfos 1}} +{{.GetIssueContent}}
{{else if eq .GetOpType 7}}{{index .GetIssueInfos 1}}
{{else if eq .GetOpType 10}}