Browse Source

Fix the format

Signed-off-by: Alex Lau(AvengerMoJo) <avengermojo@gmail.com>
pull/30067/head
Alex Lau(AvengerMoJo) 1 month ago
parent
commit
d68a821455
No account linked to committer's email address
2 changed files with 15 additions and 15 deletions
  1. 6
    6
      routers/web/web.go
  2. 9
    9
      web_src/js/features/require-actions-select.js

+ 6
- 6
routers/web/web.go View File

@@ -1382,12 +1382,12 @@ func registerRoutes(m *web.Route) {
}, ignSignIn, context.RepoAssignment, reqRepoProjectsReader, repo.MustEnableRepoProjects)
// end "/{username}/{reponame}/projects"

m.Group("/actions", func() {
m.Get("", actions.List)
m.Post("/disable", reqRepoAdmin, actions.DisableWorkflowFile)
m.Post("/enable", reqRepoAdmin, actions.EnableWorkflowFile)
m.Post("/global_disable", reqRepoAdmin, actions.DisableGlobalWorkflowFile)
m.Post("/global_enable", reqRepoAdmin, actions.EnableGlobalWorkflowFile)
m.Group("/actions", func() {
m.Get("", actions.List)
m.Post("/disable", reqRepoAdmin, actions.DisableWorkflowFile)
m.Post("/enable", reqRepoAdmin, actions.EnableWorkflowFile)
m.Post("/global_disable", reqRepoAdmin, actions.DisableGlobalWorkflowFile)
m.Post("/global_enable", reqRepoAdmin, actions.EnableGlobalWorkflowFile)

m.Group("/runs/{run}", func() {
m.Combo("").

+ 9
- 9
web_src/js/features/require-actions-select.js View File

@@ -2,18 +2,18 @@ export function initRequireActionsSelect() {
const raselect = document.getElementById('add-require-actions-modal');
if (!raselect) return;
const checkboxes = document.querySelectorAll('.ui.radio.checkbox');
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
var hiddenInput = this.nextElementSibling;
var isChecked = this.querySelector('input[type="radio"]').checked;
for (const box of checkboxes) {
box.addEventListener('change', function() {
const hiddenInput = this.nextElementSibling;
const isChecked = this.querySelector('input[type="radio"]').checked;
hiddenInput.disabled = !isChecked;
// Disable other hidden inputs
checkboxes.forEach(function(otherCheckbox) {
var otherHiddenInput = otherCheckbox.nextElementSibling;
if (otherCheckbox !== checkbox) {
for (const otherbox of checkboxes) {
const otherHiddenInput = otherbox.nextElementSibling;
if (otherbox !== box) {
otherHiddenInput.disabled = isChecked;
}
});
}
});
});
}
}

Loading…
Cancel
Save