You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {{template "base/head" .}}
  2. <div class="repository file editor edit">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <form class="ui edit form" method="post">
  7. {{.CsrfTokenHtml}}
  8. <input type="hidden" name="last_commit" value="{{.last_commit}}">
  9. <div class="ui secondary menu">
  10. <div class="fitted item treepath">
  11. <div class="ui breadcrumb field {{if .Err_TreePath}}error{{end}}">
  12. <a class="section" href="{{EscapePound $.BranchLink}}">{{.Repository.Name}}</a>
  13. {{ $n := len .TreeNames}}
  14. {{ $l := Subtract $n 1}}
  15. {{range $i, $v := .TreeNames}}
  16. <div class="divider"> / </div>
  17. {{if eq $i $l}}
  18. <input id="file-name" value="{{$v}}" placeholder="{{$.i18n.Tr "repo.editor.name_your_file"}}" data-ec-url-prefix="{{$.EditorconfigURLPrefix}}" required autofocus>
  19. <span class="octicon octicon-info poping up" data-content="{{$.i18n.Tr "repo.editor.filename_help"}}" data-position="bottom center" data-variation="tiny inverted"></span>
  20. {{else}}
  21. <span class="section"><a href="{{EscapePound $.BranchLink}}/{{index $.TreePaths $i | EscapePound}}">{{$v}}</a></span>
  22. {{end}}
  23. {{end}}
  24. <span>{{.i18n.Tr "repo.editor.or"}} <a href="{{EscapePound $.BranchLink}}{{if not .IsNewFile}}/{{EscapePound .TreePath}}{{end}}">{{.i18n.Tr "repo.editor.cancel_lower"}}</a></span>
  25. <input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}" required>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="field">
  30. <div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff">
  31. <a class="active item" data-tab="write"><i class="octicon octicon-code"></i> {{if .IsNewFile}}{{.i18n.Tr "repo.editor.new_file"}}{{else}}{{.i18n.Tr "repo.editor.edit_file"}}{{end}}</a>
  32. {{if not .IsNewFile}}
  33. <a class="item" data-tab="preview" data-url="{{.Repository.APIURL}}/markdown" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL | EscapePound}}" data-preview-file-modes="{{.PreviewableFileModes}}"><i class="octicon octicon-eye"></i> {{.i18n.Tr "preview"}}</a>
  34. <a class="item" data-tab="diff" data-url="{{.RepoLink}}/_preview/{{.BranchName | EscapePound}}/{{.TreePath | EscapePound}}" data-context="{{.BranchLink}}"><i class="octicon octicon-diff"></i> {{.i18n.Tr "repo.editor.preview_changes"}}</a>
  35. {{end}}
  36. </div>
  37. <div class="ui bottom attached active tab segment" data-tab="write">
  38. <textarea id="edit_area" name="content" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
  39. data-url="{{.Repository.APIURL}}/markdown"
  40. data-context="{{.RepoLink}}"
  41. data-markdown-file-exts="{{.MarkdownFileExts}}"
  42. data-line-wrap-extensions="{{.LineWrapExtensions}}"
  43. required>
  44. {{.FileContent}}</textarea>
  45. </div>
  46. <div class="ui bottom attached tab segment markdown" data-tab="preview">
  47. {{.i18n.Tr "loading"}}
  48. </div>
  49. <div class="ui bottom attached tab segment diff" data-tab="diff">
  50. {{.i18n.Tr "loading"}}
  51. </div>
  52. </div>
  53. {{template "repo/editor/commit_form" .}}
  54. </form>
  55. </div>
  56. </div>
  57. {{template "base/footer" .}}