tickets
All repositories: gitoria
2.6 KB
// components/project-form.hl — the form that opens a project (ticket #20), used by the page `/new-project` (components/new_project.hl) and by// the "New project" window of the ticket list (components/ticket_list.hl). Any logged-in user with a display name may; they become its first// admin. The slug (the URL part) is proposed from the title as you type and stays editable — once you edit it, the title no longer overwrites// it. Title / slug / description can be changed later on the project's settings page. The host hears the result through `onCreated(title,// settingsHref)`; a refusal is shown under the form. ONE per page (a composed component's members are the page's state).import { createProject, slugFromTitle, uniqueSlug } from '../lib/projects.hl'import { writerOfSession } from '../lib/users.hl'import { messageLook } from '../lib/looks.hl'onCreated = nulltitle = ''slug = ''slugEdited = falsemessage = ''Style {pMessage = messageLook + { }}View {form { id = "projectform"on submit(e) {e.preventDefault()emit create(e)}label { "Title"input { id = "projecttitle" name = "title" required = "required" maxlength = "100" autocomplete = "off" value = title on input(e) { emit setTitle(e.target.value) } }}label { "Slug (the address of the project)"input { id = "projectslug" name = "slug" maxlength = "100" autocomplete = "off" value = slug on input(e) { emit setSlug(e.target.value) } }}button { id = "projectcreate" type = "submit" "Create project" }p { id = "projectmessage" Style.pMessage message }}}on setTitle(v) {title = vif (!slugEdited) {r = emit server proposeSlug(v)if (r != null && r.slug != null) { slug = r.slug }}}on setSlug(v) {slug = vslugEdited = true}on create(e) {if (title.trim() == '') { return null }r = emit server makeProject(title, slug)if (r == null || r.error != null) {message = r != null ? r.error : 'could not create the project'return null}message = ''made = rtitle = ''slug = ''slugEdited = falseif (onCreated != null) { onCreated(made.title, made.settingsHref) }}on server proposeSlug(text, session) {if (hlTypeName(text) != 'String' || text.trim() == '') { return { slug = '' } }return { slug = uniqueSlug(slugFromTitle(text)) }}on server makeProject(title, slug, session) {w = writerOfSession(session)if (w.error != null) { return { error = w.error } }if (hlTypeName(title) != 'String' || hlTypeName(slug) != 'String') { return { error = 'title and slug must be text' } }r = createProject(w.user, title, slug, '')if (r.error != null) { return { error = r.error } }return { title = r.project.title slug = r.project.slug settingsHref = r.project.settingsHref }}
Branches
Latest commits
- 0814ce6bTickets conductor: brief 025 tickets#36 style formmre
- 1b6916c4Tickets conductor: Atlas handover tickets#36mre
- aab95226Tickets conductor: worldapi-conductor paths, deploy blocker = read-only diskmre
- 6372b06dTickets conductor: worker port slotmre
- 836af31cTickets conductor: token pathsmre
- b03f11b6Tickets conductor: CONDUCTOR.md (project part), short STATUS.md, old STATUS to archive/2026-10-31mre
- a4123831tickets#42: the /connect and /login/callback error pages are app pages: the function routes redirect to /connect/failed/<code> and /login/failed/<code> (components/problem.hl, sentences in lib/problems.hl), htmlPage and its hand-written stylesheet are gone; gate tests/error-pages.mjsmre
- cefc7b4atickets: a startup error prints its message before exit 1 (hybriel#247)mre
- 99bd6570tickets: lib/migrate.hl writes no table of another topic any more: projects.hl rewriteSlug / addProjectNamed / hasMembers, tickets.hl moveToProject / ticketRecords / ticketRecordsOf, events.hl renameStates / eventRecords / eventRecordsOf; the migration calls them (tickets#47)mre
- b57161e3tickets: the markup names its own rules (Style.pMessage, Style.olTickets, ...) instead of hand-written class strings that copy a stylesheet rule; the shared bodies sit in lib/looks.hl (tickets#38)mre
- f767b24dtickets: 111 needless let became plain declarations (3 in ticket.hl, ticket_list.hl, comments.hl and 108 never-reassigned, not captured loop-body ones); the 212 really reassigned lets stay (tickets#44)mre
- 16c0d3b5tickets: the modal window is phone first: the full-screen sheet is the base rule, the centred window sits in the min-width 60rem block (tickets#39)mre
- 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
- d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
- afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
- 48c1ba79tickets: md-paste-files gate with the file manager casesmre
- f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre
- 06599fa0tickets: MdEditor from components b0f1ec2 (a clipboard with text always pastes the text, tickets#49); real Ctrl+V gatemre
- 2e1b116ftickets: re-vendor Hybriel master acaceaf3 (framework ec8d6c1d): plugins/web patch queue while a page is built, anonymous session cookies refresh; gate waits for the comment editors to draw (W174) and clicks the form editor when it stands still; security gate: main's code runs on its own binary, lazy-session cookie checksmre
- 361bc0fetickets: re-vendor Hybriel 7a684920 (WIP, not deployed); on Error exits 1 at startup; migrate passes its log by reference; gate checks follow lazy sessions and the 413 refusalmre