mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Frontend refactor: move Vue related code from index.js
to components
dir, and remove unused codes. (#17301)
* frontend refactor
* Apply suggestions from code review
Co-authored-by: delvh <dev.lh@web.de>
* Update templates/base/head.tmpl
Co-authored-by: delvh <dev.lh@web.de>
* Update docs/content/doc/developers/guidelines-frontend.md
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* fix typo
* fix typo
* refactor PageData to pageData
* Apply suggestions from code review
Co-authored-by: delvh <dev.lh@web.de>
* Simply for the visual difference.
Co-authored-by: delvh <dev.lh@web.de>
* Revert "Apply suggestions from code review"
This reverts commit 4d78ad9b0e
.
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@@ -108,11 +108,8 @@
|
||||
{{.i18n.Tr "repo.activity.git_stats_and_deletions" }}
|
||||
<strong class="text red">{{.i18n.Tr (TrN .i18n.Lang .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n") .Activity.Code.Deletions }}</strong>.
|
||||
</div>
|
||||
<div class="ui attached segment" id="app">
|
||||
<script type="text/javascript">
|
||||
var ActivityTopAuthors = {{Json .ActivityTopAuthors | SafeJS}};
|
||||
</script>
|
||||
<activity-top-authors :data="activityTopAuthors" />
|
||||
<div class="ui attached segment">
|
||||
<div id="repo-activity-top-authors-chart"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
@@ -126,7 +123,7 @@
|
||||
<div class="list">
|
||||
{{range .Activity.PublishedReleases}}
|
||||
<p class="desc">
|
||||
<div class="ui green label">{{$.i18n.Tr "repo.activity.published_release_label"}}</div>
|
||||
<span class="ui green label">{{$.i18n.Tr "repo.activity.published_release_label"}}</span>
|
||||
{{.TagName}}
|
||||
{{if not .IsTag}}
|
||||
<a class="title" href="{{$.RepoLink}}/src/{{.TagName | EscapePound}}">{{.Title | RenderEmoji}}</a>
|
||||
@@ -145,7 +142,7 @@
|
||||
<div class="list">
|
||||
{{range .Activity.MergedPRs}}
|
||||
<p class="desc">
|
||||
<div class="ui purple label">{{$.i18n.Tr "repo.activity.merged_prs_label"}}</div>
|
||||
<span class="ui purple label">{{$.i18n.Tr "repo.activity.merged_prs_label"}}</span>
|
||||
#{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji}}</a>
|
||||
{{TimeSinceUnix .MergedUnix $.Lang}}
|
||||
</p>
|
||||
@@ -161,7 +158,7 @@
|
||||
<div class="list">
|
||||
{{range .Activity.OpenedPRs}}
|
||||
<p class="desc">
|
||||
<div class="ui green label">{{$.i18n.Tr "repo.activity.opened_prs_label"}}</div>
|
||||
<span class="ui green label">{{$.i18n.Tr "repo.activity.opened_prs_label"}}</span>
|
||||
#{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji}}</a>
|
||||
{{TimeSinceUnix .Issue.CreatedUnix $.Lang}}
|
||||
</p>
|
||||
@@ -177,7 +174,7 @@
|
||||
<div class="list">
|
||||
{{range .Activity.ClosedIssues}}
|
||||
<p class="desc">
|
||||
<div class="ui red label">{{$.i18n.Tr "repo.activity.closed_issue_label"}}</div>
|
||||
<span class="ui red label">{{$.i18n.Tr "repo.activity.closed_issue_label"}}</span>
|
||||
#{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
|
||||
{{TimeSinceUnix .ClosedUnix $.Lang}}
|
||||
</p>
|
||||
@@ -193,7 +190,7 @@
|
||||
<div class="list">
|
||||
{{range .Activity.OpenedIssues}}
|
||||
<p class="desc">
|
||||
<div class="ui green label">{{$.i18n.Tr "repo.activity.new_issue_label"}}</div>
|
||||
<span class="ui green label">{{$.i18n.Tr "repo.activity.new_issue_label"}}</span>
|
||||
#{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji}}</a>
|
||||
{{TimeSinceUnix .CreatedUnix $.Lang}}
|
||||
</p>
|
||||
@@ -212,7 +209,7 @@
|
||||
<div class="list">
|
||||
{{range .Activity.UnresolvedIssues}}
|
||||
<p class="desc">
|
||||
<div class="ui green label">{{$.i18n.Tr "repo.activity.unresolved_conv_label"}}</div>
|
||||
<span class="ui green label">{{$.i18n.Tr "repo.activity.unresolved_conv_label"}}</span>
|
||||
#{{.Index}}
|
||||
{{if .IsPull}}
|
||||
<a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji}}</a>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
{{end}}
|
||||
|
||||
<!-- I know, there is probably a better way to do this (moved from sidebar.tmpl, original author: 6543 @ 2021-02-28) -->
|
||||
<!-- Agree, there should be a better way, eg: introduce window.config.PageData (original author: wxiaoguang @ 2021-09-05) -->
|
||||
<!-- Agree, there should be a better way, eg: introduce window.config.pageData (original author: wxiaoguang @ 2021-09-05) -->
|
||||
<input type="hidden" id="repolink" value="{{$.RepoRelPath}}">
|
||||
<input type="hidden" id="repoId" value="{{.Repository.ID}}">
|
||||
<input type="hidden" id="issueIndex" value="{{.Issue.Index}}"/>
|
||||
|
@@ -131,13 +131,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function submitDeleteForm() {
|
||||
var message = prompt("{{.i18n.Tr "repo.delete_confirm_message"}}\n\n{{.i18n.Tr "repo.delete_commit_summary"}}", "Delete '{{.TreeName}}'");
|
||||
if (message != null) {
|
||||
$("#delete-message").val(message);
|
||||
$("#delete-file-form").submit()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user