mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 21:04:55 +02:00
#1854 show issue content
This commit is contained in:
1 parent
0f438ef0b3
commit
6a664e88c7
6 files changed
+28
-7
No files matched your search
+11
-1
@@ -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,
|
||||
|
||||
+12
-1
@@ -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,
|
||||
|
||||
+1
-3
@@ -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');
|
||||
|
||||
Vendored
+1
@@ -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('<a class="item" href='+$(this).data("href")+">"+$(this).text()+"</a>");break;case"#assignee_id":n.find(".selected").html('<a class="item" href='+$(this).data("href")+'><img class="ui avatar image" src='+$(this).data("avatar")+">"+$(this).text()+"</a>")}$(".ui"+e+".list .no-select").addClass("hide"),$(i).val($(this).data("id"))}),a.find(".no-select.item").click(function(){$(this).parent().find(".item:not(.no-select)").each(function(){$(this).removeClass("selected active")}),o&&t(a.data("update-url"),"",""),n.find(".selected").html(""),n.find(".no-select").removeClass("hide"),$(i).val("")})}if(0!=$(".comment.form").length){initCommentPreviewTab($(".comment.form"));var i=$(".ui.labels.list"),a=i.find(".no-select"),n=$(".select-label .menu"),o="update"==n.data("action");n.find(".item:not(.no-select)").click(function(){$(this).hasClass("checked")?($(this).removeClass("checked"),$(this).find(".octicon").removeClass("octicon-check"),o&&t(n.data("update-url"),"detach",$(this).data("id"))):($(this).addClass("checked"),$(this).find(".octicon").addClass("octicon-check"),o&&t(n.data("update-url"),"attach",$(this).data("id")));var e="";return $(this).parent().find(".item").each(function(){$(this).hasClass("checked")?(e+=$(this).data("id")+",",$($(this).data("id-selector")).removeClass("hide")):$($(this).data("id-selector")).addClass("hide")}),0==e.length?a.removeClass("hide"):a.addClass("hide"),$($(this).parent().data("id")).val(e),!1}),n.find(".no-select.item").click(function(){o&&t(n.data("update-url"),"clear",""),$(this).parent().find(".item").each(function(){$(this).removeClass("checked"),$(this).find(".octicon").removeClass("octicon-check")}),i.find(".item").each(function(){$(this).addClass("hide")}),a.removeClass("hide"),$($(this).parent().data("id")).val("")}),e(".select-milestone","#milestone_id"),e(".select-assignee","#assignee_id")}}function initInstall(){0!=$(".install").length&&($("#db_type").change(function(){var t="data/gogs.db",e="data/gogs_tidb",i=$(this).val();if("SQLite3"===i||"TiDB"===i)return $("#sql_settings").hide(),$("#pgsql_settings").hide(),$("#sqlite_settings").show(),void("SQLite3"===i&&$("#db_path").val()==e?$("#db_path").val(t):"TiDB"===i&&$("#db_path").val()==t&&$("#db_path").val(e));var a="127.0.0.1:3306",n="127.0.0.1:5432";$("#sqlite_settings").hide(),$("#sql_settings").show(),"PostgreSQL"===i?($("#pgsql_settings").show(),$("#db_host").val()==a&&$("#db_host").val(n)):($("#pgsql_settings").hide(),$("#db_host").val()==n&&$("#db_host").val(a))}),$("#offline-mode input").change(function(){$(this).is(":checked")&&$("#disable-gravatar").checkbox("check")}),$("#disable-registration input").change(function(){$(this).is(":checked")&&$("#enable-captcha").checkbox("uncheck")}),$("#enable-captcha input").change(function(){$(this).is(":checked")&&$("#disable-registration").checkbox("uncheck")}))}function initRepository(){if(0!=$(".repository").length){if($(".repository.settings.options").length>0&&$("#repo_name").keyup(function(){var t=$("#repo-name-change-prompt");$(this).val().toString().toLowerCase()!=$(this).data("repo-name").toString().toLowerCase()?t.show():t.hide()}),$(".repository.labels").length>0){var t=$(".new-label.segment");$(".new-label.button").click(function(){t.show()}),$(".new-label.segment .cancel").click(function(){t.hide()}),$(".color-picker").each(function(){$(this).minicolors()}),$(".precolors .color").click(function(){var t=$(this).data("color-hex");$(".color-picker").val(t),$(".minicolors-swatch-color").css("background-color",t)}),$(".edit-label-button").click(function(){return $("#label-modal-id").val($(this).data("id")),$(".edit-label .new-label-input").val($(this).data("title")),$(".edit-label .color-picker").val($(this).data("color")),$(".minicolors-swatch-color").css("background-color",$(this).data("color")),$(".edit-label.modal").modal({onApprove:function(){$(".edit-label.form").submit()}}).modal("show"),!1})}if($(".repository.milestones").length>0,$(".repository.new.milestone").length>0){var e=$(".milestone.datepicker");e.datetimepicker({lang:e.data("lang"),inline:!0,timepicker:!1,starLine truncated
|
||||
@@ -13,7 +13,7 @@
|
||||
</a>
|
||||
<div class="ui segment content">
|
||||
<div class="field">
|
||||
<input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required>
|
||||
<input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" tabindex="3" autofocus required>
|
||||
</div>
|
||||
{{template "repo/issue/comment_tab" .}}
|
||||
<div class="text right">
|
||||
|
||||
@@ -46,7 +46,8 @@
|
||||
</ul>
|
||||
</div>
|
||||
{{else if eq .GetOpType 6}}
|
||||
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
|
||||
<span class="text truncate issue title">{{index .GetIssueInfos 1}}</span>
|
||||
<p class="text light grey">{{.GetIssueContent}}</p>
|
||||
{{else if eq .GetOpType 7}}
|
||||
<p class="text light grey">{{index .GetIssueInfos 1}}</p>
|
||||
{{else if eq .GetOpType 10}}
|
||||
|
||||
Reference in new issue
Block a user