0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-30 11:57:44 +02:00
This commit is contained in:
wxiaoguang 2026-02-22 13:45:27 +08:00
parent 3eac7b5926
commit 4b238930cc
2 changed files with 47 additions and 51 deletions

View File

@ -812,6 +812,7 @@ func (c *Comment) MetaSpecialDoerTr(locale translation.Locale) template.HTML {
}
return res
default:
// don't trust the content of SpecialDoerName, it might not be fully controlled by us
return htmlutil.HTMLFormat("%s", c.CommentMetaData.SpecialDoerName)
}
}

View File

@ -5,56 +5,51 @@ export async function initProjectWorkflow() {
const workflowDiv = document.querySelector('#project-workflows');
if (!workflowDiv) return;
try {
const locale = {
defaultWorkflows: workflowDiv.getAttribute('data-locale-default-workflows'),
moveToColumn: workflowDiv.getAttribute('data-locale-move-to-column'),
viewWorkflowConfiguration: workflowDiv.getAttribute('data-locale-view-workflow-configuration'),
configureWorkflow: workflowDiv.getAttribute('data-locale-configure-workflow'),
when: workflowDiv.getAttribute('data-locale-when'),
runWhen: workflowDiv.getAttribute('data-locale-run-when'),
filters: workflowDiv.getAttribute('data-locale-filters'),
applyTo: workflowDiv.getAttribute('data-locale-apply-to'),
whenMovedFromColumn: workflowDiv.getAttribute('data-locale-when-moved-from-column'),
whenMovedToColumn: workflowDiv.getAttribute('data-locale-when-moved-to-column'),
onlyIfHasLabels: workflowDiv.getAttribute('data-locale-only-if-has-labels'),
actions: workflowDiv.getAttribute('data-locale-actions'),
addLabels: workflowDiv.getAttribute('data-locale-add-labels'),
removeLabels: workflowDiv.getAttribute('data-locale-remove-labels'),
anyLabel: workflowDiv.getAttribute('data-locale-any-label'),
anyColumn: workflowDiv.getAttribute('data-locale-any-column'),
issueState: workflowDiv.getAttribute('data-locale-issue-state'),
none: workflowDiv.getAttribute('data-locale-none'),
noChange: workflowDiv.getAttribute('data-locale-no-change'),
edit: workflowDiv.getAttribute('data-locale-edit'),
delete: workflowDiv.getAttribute('data-locale-delete'),
save: workflowDiv.getAttribute('data-locale-save'),
clone: workflowDiv.getAttribute('data-locale-clone'),
cancel: workflowDiv.getAttribute('data-locale-cancel'),
disable: workflowDiv.getAttribute('data-locale-disable'),
disabled: workflowDiv.getAttribute('data-locale-disabled'),
enabled: workflowDiv.getAttribute('data-locale-enabled'),
enable: workflowDiv.getAttribute('data-locale-enable'),
issuesAndPullRequests: workflowDiv.getAttribute('data-locale-issues-and-pull-requests'),
issuesOnly: workflowDiv.getAttribute('data-locale-issues-only'),
pullRequestsOnly: workflowDiv.getAttribute('data-locale-pull-requests-only'),
selectColumn: workflowDiv.getAttribute('data-locale-select-column'),
closeIssue: workflowDiv.getAttribute('data-locale-close-issue'),
reopenIssue: workflowDiv.getAttribute('data-locale-reopen-issue'),
saveWorkflowFailed: workflowDiv.getAttribute('data-locale-save-workflow-failed'),
updateWorkflowFailed: workflowDiv.getAttribute('data-locale-update-workflow-failed'),
deleteWorkflowFailed: workflowDiv.getAttribute('data-locale-delete-workflow-failed'),
atLeastOneActionRequired: workflowDiv.getAttribute('data-locale-at-least-one-action-required'),
};
const locale = {
defaultWorkflows: workflowDiv.getAttribute('data-locale-default-workflows'),
moveToColumn: workflowDiv.getAttribute('data-locale-move-to-column'),
viewWorkflowConfiguration: workflowDiv.getAttribute('data-locale-view-workflow-configuration'),
configureWorkflow: workflowDiv.getAttribute('data-locale-configure-workflow'),
when: workflowDiv.getAttribute('data-locale-when'),
runWhen: workflowDiv.getAttribute('data-locale-run-when'),
filters: workflowDiv.getAttribute('data-locale-filters'),
applyTo: workflowDiv.getAttribute('data-locale-apply-to'),
whenMovedFromColumn: workflowDiv.getAttribute('data-locale-when-moved-from-column'),
whenMovedToColumn: workflowDiv.getAttribute('data-locale-when-moved-to-column'),
onlyIfHasLabels: workflowDiv.getAttribute('data-locale-only-if-has-labels'),
actions: workflowDiv.getAttribute('data-locale-actions'),
addLabels: workflowDiv.getAttribute('data-locale-add-labels'),
removeLabels: workflowDiv.getAttribute('data-locale-remove-labels'),
anyLabel: workflowDiv.getAttribute('data-locale-any-label'),
anyColumn: workflowDiv.getAttribute('data-locale-any-column'),
issueState: workflowDiv.getAttribute('data-locale-issue-state'),
none: workflowDiv.getAttribute('data-locale-none'),
noChange: workflowDiv.getAttribute('data-locale-no-change'),
edit: workflowDiv.getAttribute('data-locale-edit'),
delete: workflowDiv.getAttribute('data-locale-delete'),
save: workflowDiv.getAttribute('data-locale-save'),
clone: workflowDiv.getAttribute('data-locale-clone'),
cancel: workflowDiv.getAttribute('data-locale-cancel'),
disable: workflowDiv.getAttribute('data-locale-disable'),
disabled: workflowDiv.getAttribute('data-locale-disabled'),
enabled: workflowDiv.getAttribute('data-locale-enabled'),
enable: workflowDiv.getAttribute('data-locale-enable'),
issuesAndPullRequests: workflowDiv.getAttribute('data-locale-issues-and-pull-requests'),
issuesOnly: workflowDiv.getAttribute('data-locale-issues-only'),
pullRequestsOnly: workflowDiv.getAttribute('data-locale-pull-requests-only'),
selectColumn: workflowDiv.getAttribute('data-locale-select-column'),
closeIssue: workflowDiv.getAttribute('data-locale-close-issue'),
reopenIssue: workflowDiv.getAttribute('data-locale-reopen-issue'),
saveWorkflowFailed: workflowDiv.getAttribute('data-locale-save-workflow-failed'),
updateWorkflowFailed: workflowDiv.getAttribute('data-locale-update-workflow-failed'),
deleteWorkflowFailed: workflowDiv.getAttribute('data-locale-delete-workflow-failed'),
atLeastOneActionRequired: workflowDiv.getAttribute('data-locale-at-least-one-action-required'),
};
const View = createApp(ProjectWorkflow, {
projectLink: workflowDiv.getAttribute('data-project-link'),
eventID: workflowDiv.getAttribute('data-event-id'),
locale,
});
View.mount(workflowDiv);
} catch (err) {
console.error('Project Workflow failed to load', err);
workflowDiv.textContent = 'Project Workflow failed to load';
}
const View = createApp(ProjectWorkflow, {
projectLink: workflowDiv.getAttribute('data-project-link'),
eventID: workflowDiv.getAttribute('data-event-id'),
locale,
});
View.mount(workflowDiv);
}