From 7ef4a88d3f0ff96f08419104dad98f0f9fd508a4 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 12 Aug 2023 23:56:16 +0200 Subject: [PATCH] Fix tooltip of commit select button --- routers/web/repo/pull.go | 1 - templates/repo/diff/box.tmpl | 2 +- web_src/js/components/DiffCommitSelector.vue | 5 ++++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/routers/web/repo/pull.go b/routers/web/repo/pull.go index be4e9711e74db..e3854779fe258 100644 --- a/routers/web/repo/pull.go +++ b/routers/web/repo/pull.go @@ -718,7 +718,6 @@ func GetPullCommits(ctx *context.Context) { // Get the needed locale resp.Locale = map[string]string{ "lang": ctx.Locale.Language(), - "filter_changes_by_commit": ctx.Tr("repo.pulls.filter_changes_by_commit"), "show_all_commits": ctx.Tr("repo.pulls.show_all_commits"), "stats_num_commits": ctx.TrN(len(commits), "repo.activity.git_stats_commit_1", "repo.activity.git_stats_commit_n", len(commits)), "show_changes_since_your_last_review": ctx.Tr("repo.pulls.show_changes_since_your_last_review"), diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 324166b03c1da..7b936cb8174e3 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -32,7 +32,7 @@ {{template "repo/diff/whitespace_dropdown" .}} {{template "repo/diff/options_dropdown" .}} {{if .PageIsPullFiles}} -
+
{{/* the following will be replaced by vue component but this avoids any loading artifacts till the vue component is initialized diff --git a/web_src/js/components/DiffCommitSelector.vue b/web_src/js/components/DiffCommitSelector.vue index a0fc4b2a9183d..e24619dc081a4 100644 --- a/web_src/js/components/DiffCommitSelector.vue +++ b/web_src/js/components/DiffCommitSelector.vue @@ -77,10 +77,13 @@ import {SvgIcon} from '../svg.js'; export default { components: {SvgIcon}, data: () => { + const el = document.getElementById('diff-commit-select'); return { menuVisible: false, isLoading: false, - locale: {}, + locale: { + filter_changes_by_commit: el.getAttribute('data-filter_changes_by_commit'), + }, commits: [], hoverActivated: false, lastReviewCommitSha: null