Picking a file loads its current content to edit in place
proposed_yaml binds to the file select: the selected file's content fetches through Gitea's contents API (base64-decoded by the jq filter) and lands in the editor. On-site contributions no longer start from a blank box. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
b2423d64cf
commit
9dbd30655f
@@ -158,7 +158,10 @@ Question id (doubles as the URL path), name, description,
|
||||
(Iconify name, e.g. lucide:star), requirements[],
|
||||
resource
|
||||
Requirement name, label, type, optional, multiple, placeholder,
|
||||
accept (file), resource + id_field (select options)
|
||||
accept (file), resource + id_field (select options),
|
||||
bind {field, param, resource} (load this field's
|
||||
value from a resource whenever the named sibling
|
||||
changes - {param} templates into a url source's path)
|
||||
ResourceSpec source (kv | gitea_starred | gitea_org_repos | url),
|
||||
key, public, requires_group, transitions[{from, to, label}],
|
||||
jq (reshape filter)
|
||||
|
||||
@@ -43,7 +43,8 @@ alternatives:
|
||||
optional: true
|
||||
- name: The change
|
||||
description: >
|
||||
Pick the page you're changing — or name a new file's path if
|
||||
Pick the page you're changing and its current content loads
|
||||
below, ready to edit in place — or name a new file's path if
|
||||
the proposal creates one.
|
||||
requirements:
|
||||
- name: target_path
|
||||
@@ -68,3 +69,12 @@ alternatives:
|
||||
- name: proposed_yaml
|
||||
label: Proposed file content (complete YAML)
|
||||
type: textarea
|
||||
bind:
|
||||
field: target_path
|
||||
param: path
|
||||
resource:
|
||||
public: true
|
||||
source:
|
||||
kind: url
|
||||
url: https://project.uhhm.no/api/v1/repos/uhhm/questions/contents/{path}?ref=main
|
||||
jq: ".content | @base64d"
|
||||
|
||||
Reference in New Issue
Block a user