Skip to content

Commit 3957550

Browse files
committed
fix
1 parent c2fa157 commit 3957550

File tree

21 files changed

+282
-133
lines changed

21 files changed

+282
-133
lines changed

eslint.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,6 @@ export default defineConfig([
575575
'no-restricted-imports': [2, {paths: [
576576
{name: 'jquery', message: 'Use the global $ instead', allowTypeImports: true},
577577
{name: 'htmx.org', message: 'Use the global htmx instead', allowTypeImports: true},
578-
{name: 'idiomorph/htmx', message: 'Loaded in globals.ts', allowTypeImports: true},
579578
]}],
580579
'no-restricted-syntax': [2, 'WithStatement', 'ForInStatement', 'LabeledStatement', 'SequenceExpression'],
581580
'no-return-assign': [0],

routers/web/repo/star.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ func ActionStar(ctx *context.Context) {
2626
ctx.ServerError("GetRepositoryByName", err)
2727
return
2828
}
29-
ctx.RespHeader().Add("hx-trigger", "refreshUserCards") // see the `hx-trigger="refreshUserCards ..."` comments in tmpl
3029
ctx.HTML(http.StatusOK, tplStarUnstar)
3130
}

routers/web/repo/view.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri
316316
clearFilesCommitInfo := func() {
317317
log.Warn("clear directory file commit info to force async loading on frontend")
318318
for i := range files {
319-
files[i].Commit = nil
319+
if i%2 == 0 {
320+
files[i].Commit = nil
321+
}
320322
}
321323
}
322324
_ = clearFilesCommitInfo

routers/web/repo/watch.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ func ActionWatch(ctx *context.Context) {
2626
ctx.ServerError("GetRepositoryByName", err)
2727
return
2828
}
29-
ctx.RespHeader().Add("hx-trigger", "refreshUserCards") // see the `hx-trigger="refreshUserCards ..."` comments in tmpl
3029
ctx.HTML(http.StatusOK, tplWatchUnwatch)
3130
}

routers/web/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ func registerWebRoutes(m *web.Router, webAuth *AuthMiddleware) {
17101710

17111711
m.Get("/forks", repo.Forks)
17121712
m.Get("/commit/{sha:([a-f0-9]{7,64})}.{ext:patch|diff}", repo.MustBeNotEmpty, repo.RawDiff)
1713-
m.Post("/lastcommit/*", context.RepoRefByType(git.RefTypeCommit), repo.LastCommit)
1713+
m.Get("/lastcommit/*", context.RepoRefByType(git.RefTypeCommit), repo.LastCommit)
17141714
}, optSignIn, context.RepoAssignment, reqUnitCodeReader)
17151715
// end "/{username}/{reponame}": repo code
17161716

templates/admin/dashboard.tmpl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@
7676
</h4>
7777
{{/* TODO: make these stats work in multi-server deployments, likely needs per-server stats in DB */}}
7878
<div class="ui attached table segment">
79-
<div class="no-loading-indicator tw-hidden"></div>
80-
<div hx-get="{{$.Link}}/system_status" hx-swap="morph:innerHTML" hx-trigger="every 5s" hx-indicator=".no-loading-indicator">
81-
{{template "admin/system_status" .}}
82-
</div>
79+
{{template "admin/system_status" .}}
8380
</div>
8481
</div>
8582
{{template "admin/layout_footer" .}}

templates/admin/system_status.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<dl class="admin-dl-horizontal">
1+
<dl class="admin-dl-horizontal" data-url="{{AppSubUrl}}/-/admin/system_status" data-fetch-sync="$idiomorph" data-fetch-trigger="every 5s">
22
<dt>{{ctx.Locale.Tr "admin.dashboard.server_uptime"}}</dt>
33
<dd><relative-time format="duration" datetime="{{.SysStatus.StartTime}}">{{.SysStatus.StartTime}}</relative-time></dd>
44
<dt>{{ctx.Locale.Tr "admin.dashboard.current_goroutine"}}</dt>

templates/base/head.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{template "base/head_script" .}}
2424
{{template "custom/header" .}}
2525
</head>
26-
<body hx-swap="outerHTML" hx-ext="morph" hx-push-url="false">
26+
<body hx-swap="outerHTML" hx-push-url="false">
2727
{{template "custom/body_outer_pre" .}}
2828

2929
<div class="full height">

templates/projects/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
>
109109
{{svg "octicon-star"}} {{ctx.Locale.Tr "repo.projects.column.set_default"}}
110110
</a>
111-
<a class="item button link-action" data-url="{{$.Link}}/{{.ID}}" data-link-action-method="DELETE"
111+
<a class="item button link-action" data-url="{{$.Link}}/{{.ID}}" data-fetch-action-method="DELETE"
112112
data-modal-confirm-header="{{ctx.Locale.Tr "repo.projects.column.delete"}}"
113113
data-modal-confirm-content="{{ctx.Locale.Tr "repo.projects.column.deletion_desc"}}"
114114
>

templates/repo/actions/workflow_dispatch.tmpl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44
</div>
55
<div id="runWorkflowDispatchModal" class="ui tiny modal">
66
<div class="content">
7-
<form id="runWorkflowDispatchForm" class="ui form" action="{{$.Link}}/run?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}" method="post">
7+
<form id="runWorkflowDispatchForm" class="ui form ignore-dirty" action="{{$.Link}}/run?workflow={{$.CurWorkflow}}&actor={{$.CurActor}}&status={{.Status}}" method="post">
88
<div class="ui inline field required tw-flex tw-items-center">
99
<span class="ui inline required field">
1010
<label>{{ctx.Locale.Tr "actions.workflow.from_ref"}}:</label>
1111
</span>
1212
<div class="ui inline field dropdown button select-branch branch-selector-dropdown ellipsis-text-items">
13-
<input type="hidden" name="ref" hx-sync="this:replace" hx-target="#runWorkflowDispatchModalInputs" hx-swap="innerHTML" hx-get="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}" hx-trigger="change" value="refs/heads/{{index .Branches 0}}">
13+
<input type="hidden" name="ref" value="refs/heads/{{index .Branches 0}}"
14+
data-fetch-trigger="change" data-fetch-sync="$body #runWorkflowDispatchModalInputs"
15+
data-url="{{$.Link}}/workflow-dispatch-inputs?workflow={{$.CurWorkflow}}"
16+
>
1417
{{svg "octicon-git-branch" 14}}
1518
<div class="default text">{{index .Branches 0}}</div>
1619
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
@@ -45,12 +48,8 @@
4548
</div>
4649
</div>
4750
</div>
48-
4951
<div class="divider"></div>
50-
51-
<div id="runWorkflowDispatchModalInputs">
52-
{{template "repo/actions/workflow_dispatch_inputs" .}}
53-
</div>
52+
{{template "repo/actions/workflow_dispatch_inputs" .}}
5453
</form>
5554
</div>
5655
</div>

0 commit comments

Comments
 (0)