aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorJohn Smith <me@madao.dev>2025-03-18 03:24:54 +0800
committerGitHub <noreply@github.com>2025-03-17 19:24:54 +0000
commit8f051d598cd2c16878a293eaee2aee9891ef74e6 (patch)
treed4b886a6aaffc85a27b014bdb091a731b65027cf /templates
parent9d7c02f9f75d2e7b2131831ed37184f9fe386efc (diff)
downloadgitea-8f051d598cd2c16878a293eaee2aee9891ef74e6.tar.gz
gitea-8f051d598cd2c16878a293eaee2aee9891ef74e6.zip
Added Description Field for Secrets and Variables (#33526)
Fixes #33484 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/shared/secrets/add_list.tmpl14
-rw-r--r--templates/shared/variables/variable_list.tmpl16
-rw-r--r--templates/swagger/v1_json.tmpl25
3 files changed, 55 insertions, 0 deletions
diff --git a/templates/shared/secrets/add_list.tmpl b/templates/shared/secrets/add_list.tmpl
index 59596d1013..977f308b71 100644
--- a/templates/shared/secrets/add_list.tmpl
+++ b/templates/shared/secrets/add_list.tmpl
@@ -23,6 +23,9 @@
{{.Name}}
</div>
<div class="flex-item-body">
+ {{if .Description}}{{.Description}}{{else}}-{{end}}
+ </div>
+ <div class="flex-item-body">
******
</div>
</div>
@@ -72,9 +75,20 @@
<textarea required
id="secret-data"
name="data"
+ maxlength="{{.DataMaxLength}}"
placeholder="{{ctx.Locale.Tr "secrets.creation.value_placeholder"}}"
></textarea>
</div>
+ <div class="field">
+ <label for="secret-description">{{ctx.Locale.Tr "secrets.creation.description"}}</label>
+ <textarea
+ id="secret-description"
+ name="description"
+ rows="2"
+ maxlength="{{.DescriptionMaxLength}}"
+ placeholder="{{ctx.Locale.Tr "secrets.creation.description_placeholder"}}"
+ ></textarea>
+ </div>
</div>
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
</form>
diff --git a/templates/shared/variables/variable_list.tmpl b/templates/shared/variables/variable_list.tmpl
index 7a0ab48cef..2edca431c1 100644
--- a/templates/shared/variables/variable_list.tmpl
+++ b/templates/shared/variables/variable_list.tmpl
@@ -7,6 +7,7 @@
data-modal-header="{{ctx.Locale.Tr "actions.variables.creation"}}"
data-modal-dialog-variable-name=""
data-modal-dialog-variable-data=""
+ data-modal-dialog-variable-description=""
>
{{ctx.Locale.Tr "actions.variables.creation"}}
</button>
@@ -25,6 +26,9 @@
{{.Name}}
</div>
<div class="flex-item-body">
+ {{if .Description}}{{.Description}}{{else}}-{{end}}
+ </div>
+ <div class="flex-item-body">
{{.Data}}
</div>
</div>
@@ -39,6 +43,7 @@
data-modal-header="{{ctx.Locale.Tr "actions.variables.edit"}}"
data-modal-dialog-variable-name="{{.Name}}"
data-modal-dialog-variable-data="{{.Data}}"
+ data-modal-dialog-variable-description="{{.Description}}"
>
{{svg "octicon-pencil"}}
</button>
@@ -82,9 +87,20 @@
<textarea required
name="data"
id="dialog-variable-data"
+ maxlength="{{.DataMaxLength}}"
placeholder="{{ctx.Locale.Tr "secrets.creation.value_placeholder"}}"
></textarea>
</div>
+ <div class="field">
+ <label for="dialog-variable-description">{{ctx.Locale.Tr "secrets.creation.description"}}</label>
+ <textarea
+ name="description"
+ id="dialog-variable-description"
+ rows="2"
+ maxlength="{{.DescriptionMaxLength}}"
+ placeholder="{{ctx.Locale.Tr "secrets.creation.description_placeholder"}}"
+ ></textarea>
+ </div>
</div>
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
</form>
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 48ed958ca2..1efaf1a875 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -19325,6 +19325,11 @@
"type": "string",
"x-go-name": "Data"
},
+ "description": {
+ "description": "the description of the variable",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"name": {
"description": "the name of the variable",
"type": "string",
@@ -20988,6 +20993,11 @@
"description": "Data of the secret to update",
"type": "string",
"x-go-name": "Data"
+ },
+ "description": {
+ "description": "Description of the secret to update",
+ "type": "string",
+ "x-go-name": "Description"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@@ -21498,6 +21508,11 @@
"value"
],
"properties": {
+ "description": {
+ "description": "Description of the variable to create",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"value": {
"description": "Value of the variable to create",
"type": "string",
@@ -25459,6 +25474,11 @@
"format": "date-time",
"x-go-name": "Created"
},
+ "description": {
+ "description": "the secret's description",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"name": {
"description": "the secret's name",
"type": "string",
@@ -26034,6 +26054,11 @@
"value"
],
"properties": {
+ "description": {
+ "description": "Description of the variable to update",
+ "type": "string",
+ "x-go-name": "Description"
+ },
"name": {
"description": "New name for the variable. If the field is empty, the variable name won't be updated.",
"type": "string",