mirror of
https://github.com/go-gitea/gitea
synced 2025-07-30 06:08:35 +00:00
Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876)
The first step of the plan * #23290 Thanks to @silverwind for the first try in #15394 . Close #10729 and a lot of related issues. The EasyMDE is not removed, now it works as a fallback, users can switch between these two editors. Editor list: * Issue / PR comment * Issue / PR comment edit * Issue / PR comment quote reply * PR diff view, inline comment * PR diff view, inline comment edit * PR diff view, inline comment quote reply * Release editor * Wiki editor Some editors have attached dropzone Screenshots: <details>     </details> --------- Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -253,7 +253,6 @@ func FileHistory(ctx *context.Context) {
|
||||
// Diff show different from current commit to previous commit
|
||||
func Diff(ctx *context.Context) {
|
||||
ctx.Data["PageIsDiff"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
|
||||
userName := ctx.Repo.Owner.Name
|
||||
repoName := ctx.Repo.Repository.Name
|
||||
|
@@ -781,7 +781,6 @@ func CompareDiff(ctx *context.Context) {
|
||||
|
||||
ctx.Data["IsRepoToolbarCommits"] = true
|
||||
ctx.Data["IsDiffCompare"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
templateErrs := setTemplateIfExists(ctx, pullRequestTemplateKey, pullRequestTemplateCandidates)
|
||||
|
||||
if len(templateErrs) > 0 {
|
||||
|
@@ -538,7 +538,6 @@ func DeleteFilePost(ctx *context.Context) {
|
||||
// UploadFile render upload file page
|
||||
func UploadFile(ctx *context.Context) {
|
||||
ctx.Data["PageIsUpload"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
upload.AddUploadContext(ctx, "repo")
|
||||
canCommit := renderCommitRights(ctx)
|
||||
treePath := cleanUploadFileName(ctx.Repo.TreePath)
|
||||
@@ -573,7 +572,6 @@ func UploadFile(ctx *context.Context) {
|
||||
func UploadFilePost(ctx *context.Context) {
|
||||
form := web.GetForm(ctx).(*forms.UploadRepoFileForm)
|
||||
ctx.Data["PageIsUpload"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
upload.AddUploadContext(ctx, "repo")
|
||||
canCommit := renderCommitRights(ctx)
|
||||
|
||||
|
@@ -849,7 +849,6 @@ func NewIssue(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
ctx.Data["NewIssueChooseTemplate"] = ctx.HasIssueTemplatesOrContactLinks()
|
||||
ctx.Data["RequireTribute"] = true
|
||||
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
|
||||
title := ctx.FormString("title")
|
||||
ctx.Data["TitleQuery"] = title
|
||||
@@ -1295,7 +1294,6 @@ func ViewIssue(ctx *context.Context) {
|
||||
ctx.Data["IssueType"] = "all"
|
||||
}
|
||||
|
||||
ctx.Data["RequireTribute"] = true
|
||||
ctx.Data["IsProjectsEnabled"] = ctx.Repo.CanRead(unit.TypeProjects)
|
||||
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
|
||||
upload.AddUploadContext(ctx, "comment")
|
||||
|
@@ -28,7 +28,6 @@ func Labels(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.labels")
|
||||
ctx.Data["PageIsIssueList"] = true
|
||||
ctx.Data["PageIsLabels"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
ctx.Data["LabelTemplates"] = repo_module.LabelTemplates
|
||||
ctx.HTML(http.StatusOK, tplLabels)
|
||||
}
|
||||
|
@@ -791,7 +791,6 @@ func ViewPullFiles(ctx *context.Context) {
|
||||
|
||||
setCompareContext(ctx, baseCommit, commit, ctx.Repo.Owner.Name, ctx.Repo.Repository.Name)
|
||||
|
||||
ctx.Data["RequireTribute"] = true
|
||||
if ctx.Data["Assignees"], err = repo_model.GetRepoAssignees(ctx, ctx.Repo.Repository); err != nil {
|
||||
ctx.ServerError("GetAssignees", err)
|
||||
return
|
||||
@@ -1160,7 +1159,6 @@ func CompareAndPullRequestPost(ctx *context.Context) {
|
||||
ctx.Data["PageIsComparePull"] = true
|
||||
ctx.Data["IsDiffCompare"] = true
|
||||
ctx.Data["IsRepoToolbarCommits"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
|
||||
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
|
||||
upload.AddUploadContext(ctx, "comment")
|
||||
|
@@ -308,7 +308,6 @@ func LatestRelease(ctx *context.Context) {
|
||||
func NewRelease(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.release.new_release")
|
||||
ctx.Data["PageIsReleaseList"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
ctx.Data["tag_target"] = ctx.Repo.Repository.DefaultBranch
|
||||
if tagName := ctx.FormString("tag"); len(tagName) > 0 {
|
||||
rel, err := repo_model.GetRelease(ctx.Repo.Repository.ID, tagName)
|
||||
@@ -351,7 +350,6 @@ func NewReleasePost(ctx *context.Context) {
|
||||
form := web.GetForm(ctx).(*forms.NewReleaseForm)
|
||||
ctx.Data["Title"] = ctx.Tr("repo.release.new_release")
|
||||
ctx.Data["PageIsReleaseList"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
|
||||
if ctx.HasError() {
|
||||
ctx.HTML(http.StatusOK, tplReleaseNew)
|
||||
@@ -469,7 +467,6 @@ func EditRelease(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.release.edit_release")
|
||||
ctx.Data["PageIsReleaseList"] = true
|
||||
ctx.Data["PageIsEditRelease"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
ctx.Data["IsAttachmentEnabled"] = setting.Attachment.Enabled
|
||||
upload.AddUploadContext(ctx, "release")
|
||||
|
||||
@@ -514,7 +511,6 @@ func EditReleasePost(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.release.edit_release")
|
||||
ctx.Data["PageIsReleaseList"] = true
|
||||
ctx.Data["PageIsEditRelease"] = true
|
||||
ctx.Data["RequireTribute"] = true
|
||||
|
||||
tagName := ctx.Params("*")
|
||||
rel, err := repo_model.GetRelease(ctx.Repo.Repository.ID, tagName)
|
||||
|
Reference in New Issue
Block a user