|
- {{define "build_new"}}
- <!doctype html>
- <html lang="en">
- <head>
- <title>{{.Title}}</title>
- {{template "head" .}}
- </head>
- <body>
- {{template "nav" .}}
- {{if .Msg}}<div class="flash flash-ok">{{.Msg}}</div>{{end}}
- {{if .Err}}<div class="flash flash-err">{{.Err}}</div>{{end}}
- <h1>New Build</h1>
-
- <form method="get" action="/builds/new">
- {{if .ShowDebug}}<input type="hidden" name="debug" value="1">{{end}}
- <label for="draft_id">Draft laden</label>
- <select id="draft_id" name="draft_id">
- <option value="">Kein Draft</option>
- {{range .Drafts}}
- <option value="{{.ID}}" {{if eq $.SelectedDraftID .ID}}selected{{end}}>{{.RequestName}} | {{.Status}} | {{.Source}} ({{.TemplateID}})</option>
- {{end}}
- </select>
- <button type="submit">Draft laden</button>
- </form>
-
- <form method="get" action="/builds/new">
- {{if .ShowDebug}}<input type="hidden" name="debug" value="1">{{end}}
- {{if .SelectedDraftID}}<input type="hidden" name="draft_id" value="{{.SelectedDraftID}}">{{end}}
- <label for="template_id">Template</label>
- <select id="template_id" name="template_id">
- <option value="">Select template</option>
- {{range .Templates}}
- <option value="{{.ID}}" {{if eq $.SelectedTemplateID .ID}}selected{{end}}>{{.Name}} ({{.ID}})</option>
- {{end}}
- </select>
- <button type="submit">Load Fields</button>
- </form>
-
- {{if gt .SelectedTemplateID 0}}
- <form method="post" action="/builds">
- <input type="hidden" name="draft_id" value="{{.Form.DraftID}}">
- <input type="hidden" name="template_id" value="{{.SelectedTemplateID}}">
- <input type="hidden" name="manifest_id" value="{{.SelectedManifestID}}">
- <input type="hidden" name="field_count" value="{{len .EditableFields}}">
- <input type="hidden" name="suggestion_state_json" value="{{.SuggestionStateJSON}}">
-
- <h2>Global Data</h2>
- <div class="grid2">
- <div><label>Draft Source<input type="text" name="draft_source" value="{{.Form.DraftSource}}" placeholder="ui"></label></div>
- <div>
- <label>Draft Status
- <select name="draft_status">
- <option value="draft" {{if eq .Form.DraftStatus "draft"}}selected{{end}}>draft</option>
- <option value="reviewed" {{if eq .Form.DraftStatus "reviewed"}}selected{{end}}>reviewed</option>
- <option value="submitted" {{if eq .Form.DraftStatus "submitted"}}selected{{end}}>submitted</option>
- </select>
- </label>
- </div>
- </div>
- <div><label>Request Name<input type="text" name="request_name" value="{{.Form.RequestName}}"></label></div>
- <div><label>Draft Notes<textarea name="draft_notes">{{.Form.DraftNotes}}</textarea></label></div>
-
- <h3>Basis / Firma</h3>
- <div class="grid2">
- <div><label>Firmenname*<input type="text" name="company_name" value="{{.Form.CompanyName}}" required></label></div>
- <div><label>Benutzername*<input type="text" name="username" value="{{.Form.Username}}" required></label></div>
- <div><label>Branche / Business Type
- <select name="business_type">
- <option value="">Bitte waehlen</option>
- <option value="accountant" {{if eq .Form.BusinessType "accountant"}}selected{{end}}>Buchhaltung / Steuerberatung</option>
- <option value="consultancy" {{if eq .Form.BusinessType "consultancy"}}selected{{end}}>Beratung / Consultancy</option>
- <option value="financial_legal_services" {{if eq .Form.BusinessType "financial_legal_services"}}selected{{end}}>Finanz- & Rechtsdienstleistungen</option>
- <option value="lawyer" {{if eq .Form.BusinessType "lawyer"}}selected{{end}}>Rechtsanwalt / Kanzlei</option>
- <option value="auto_motor" {{if eq .Form.BusinessType "auto_motor"}}selected{{end}}>Auto / Motor</option>
- <option value="auto_parts_equipment" {{if eq .Form.BusinessType "auto_parts_equipment"}}selected{{end}}>Autoteile & Zubehör</option>
- <option value="boat_equipment" {{if eq .Form.BusinessType "boat_equipment"}}selected{{end}}>Bootsausstattung</option>
- <option value="auto_repair" {{if eq .Form.BusinessType "auto_repair"}}selected{{end}}>Autowerkstatt / Reparatur</option>
- <option value="auto_sales" {{if eq .Form.BusinessType "auto_sales"}}selected{{end}}>Autohandel</option>
- <option value="dentist" {{if eq .Form.BusinessType "dentist"}}selected{{end}}>Zahnarzt</option>
- <option value="doctor" {{if eq .Form.BusinessType "doctor"}}selected{{end}}>Arzt / Praxis</option>
- <option value="surgery" {{if eq .Form.BusinessType "surgery"}}selected{{end}}>Chirurgie / OP-Zentrum</option>
- <option value="veterinarian" {{if eq .Form.BusinessType "veterinarian"}}selected{{end}}>Tierarzt</option>
- <option value="limousine_services" {{if eq .Form.BusinessType "limousine_services"}}selected{{end}}>Limousinenservice</option>
- <option value="taxi_services" {{if eq .Form.BusinessType "taxi_services"}}selected{{end}}>Taxi / Fahrdienst</option>
- <option value="bar" {{if eq .Form.BusinessType "bar"}}selected{{end}}>Bar / Lounge</option>
- <option value="nightclub" {{if eq .Form.BusinessType "nightclub"}}selected{{end}}>Nachtclub</option>
- <option value="bathroom_toilet" {{if eq .Form.BusinessType "bathroom_toilet"}}selected{{end}}>Bad & Sanitär</option>
- <option value="hotel" {{if eq .Form.BusinessType "hotel"}}selected{{end}}>Hotel</option>
- <option value="menu_accommodation" {{if eq .Form.BusinessType "menu_accommodation"}}selected{{end}}>Gastronomie & Unterkunft</option>
- <option value="beauty_salon_spa" {{if eq .Form.BusinessType "beauty_salon_spa"}}selected{{end}}>Beauty Salon / Spa</option>
- <option value="health_beauty_personal_services" {{if eq .Form.BusinessType "health_beauty_personal_services"}}selected{{end}}>Gesundheit & Beauty</option>
- <option value="bicycle" {{if eq .Form.BusinessType "bicycle"}}selected{{end}}>Fahrrad / Velo</option>
- <option value="building_materials" {{if eq .Form.BusinessType "building_materials"}}selected{{end}}>Baumaterialien & Handel</option>
- <option value="cafe" {{if eq .Form.BusinessType "cafe"}}selected{{end}}>Café / Kaffeehaus</option>
- <option value="carpenter" {{if eq .Form.BusinessType "carpenter"}}selected{{end}}>Schreiner / Tischler</option>
- <option value="catering_kitchen" {{if eq .Form.BusinessType "catering_kitchen"}}selected{{end}}>Catering / Küche</option>
- <option value="cleaning_services" {{if eq .Form.BusinessType "cleaning_services"}}selected{{end}}>Reinigung & Gebäudedienste</option>
- <option value="transportation_of_goods" {{if eq .Form.BusinessType "transportation_of_goods"}}selected{{end}}>Gütertransport / Logistik</option>
- <option value="transportation_services" {{if eq .Form.BusinessType "transportation_services"}}selected{{end}}>Personentransport</option>
- <option value="construction" {{if eq .Form.BusinessType "construction"}}selected{{end}}>Bau / Bauunternehmen</option>
- <option value="construction_repair_craftmanship" {{if eq .Form.BusinessType "construction_repair_craftmanship"}}selected{{end}}>Bau & Handwerk</option>
- <option value="scaffolding" {{if eq .Form.BusinessType "scaffolding"}}selected{{end}}>Gerüstbau</option>
- <option value="demolition" {{if eq .Form.BusinessType "demolition"}}selected{{end}}>Abbruch / Rückbau</option>
- <option value="e_shop" {{if eq .Form.BusinessType "e_shop"}}selected{{end}}>Online-Shop / E-Commerce</option>
- <option value="school" {{if eq .Form.BusinessType "school"}}selected{{end}}>Schule / Ausbildung</option>
- <option value="educational_community_services" {{if eq .Form.BusinessType "educational_community_services"}}selected{{end}}>Bildung & Gemeinschaft</option>
- <option value="voluntary_work" {{if eq .Form.BusinessType "voluntary_work"}}selected{{end}}>Ehrenamt / NGO</option>
- <option value="electrician" {{if eq .Form.BusinessType "electrician"}}selected{{end}}>Elektriker</option>
- <option value="event_happenings_culture" {{if eq .Form.BusinessType "event_happenings_culture"}}selected{{end}}>Events & Kultur</option>
- <option value="event" {{if eq .Form.BusinessType "event"}}selected{{end}}>Veranstaltung</option>
- <option value="exhibition" {{if eq .Form.BusinessType "exhibition"}}selected{{end}}>Messe / Ausstellung</option>
- <option value="it_consultancy" {{if eq .Form.BusinessType "it_consultancy"}}selected{{end}}>IT-Beratung</option>
- <option value="media_it_communication_services" {{if eq .Form.BusinessType "media_it_communication_services"}}selected{{end}}>Medien & IT</option>
- <option value="tires" {{if eq .Form.BusinessType "tires"}}selected{{end}}>Reifen & Felgen</option>
- <option value="fashion_clothes" {{if eq .Form.BusinessType "fashion_clothes"}}selected{{end}}>Mode & Bekleidung</option>
- <option value="haute_couture" {{if eq .Form.BusinessType "haute_couture"}}selected{{end}}>Haute Couture</option>
- <option value="fitness" {{if eq .Form.BusinessType "fitness"}}selected{{end}}>Fitness & Sport</option>
- <option value="people_in_motion" {{if eq .Form.BusinessType "people_in_motion"}}selected{{end}}>Bewegung & Lifestyle</option>
- <option value="florist" {{if eq .Form.BusinessType "florist"}}selected{{end}}>Blumenladen / Florist</option>
- <option value="gardening_services" {{if eq .Form.BusinessType "gardening_services"}}selected{{end}}>Gartenbau & Gartenpflege</option>
- <option value="landscapes" {{if eq .Form.BusinessType "landscapes"}}selected{{end}}>Landschaftsbau</option>
- <option value="hairdresser" {{if eq .Form.BusinessType "hairdresser"}}selected{{end}}>Friseur / Coiffeur</option>
- <option value="heating_pumps" {{if eq .Form.BusinessType "heating_pumps"}}selected{{end}}>Heizung & Wärmepumpen</option>
- <option value="home_decor" {{if eq .Form.BusinessType "home_decor"}}selected{{end}}>Wohndekoration & Einrichtung</option>
- <option value="interior_design" {{if eq .Form.BusinessType "interior_design"}}selected{{end}}>Innenarchitektur</option>
- <option value="home_broker" {{if eq .Form.BusinessType "home_broker"}}selected{{end}}>Immobilien</option>
- <option value="manufacturing_production" {{if eq .Form.BusinessType "manufacturing_production"}}selected{{end}}>Produktion & Fertigung</option>
- <option value="masonry_stone_work" {{if eq .Form.BusinessType "masonry_stone_work"}}selected{{end}}>Maurer & Steinmetz</option>
- <option value="moving_services" {{if eq .Form.BusinessType "moving_services"}}selected{{end}}>Umzug & Transport</option>
- <option value="online_media" {{if eq .Form.BusinessType "online_media"}}selected{{end}}>Online-Medien</option>
- <option value="optician" {{if eq .Form.BusinessType "optician"}}selected{{end}}>Optiker</option>
- <option value="paint_tapestry" {{if eq .Form.BusinessType "paint_tapestry"}}selected{{end}}>Maler & Tapezierung</option>
- <option value="printed_media" {{if eq .Form.BusinessType "printed_media"}}selected{{end}}>Druckmedien</option>
- <option value="restaurant" {{if eq .Form.BusinessType "restaurant"}}selected{{end}}>Restaurant</option>
- <option value="retail" {{if eq .Form.BusinessType "retail"}}selected{{end}}>Detailhandel / Einzelhandel</option>
- <option value="shop" {{if eq .Form.BusinessType "shop"}}selected{{end}}>Laden / Geschäft</option>
- <option value="shopping_commercial_services" {{if eq .Form.BusinessType "shopping_commercial_services"}}selected{{end}}>Shopping & Handelsdienstleistungen</option>
- <option value="travel_agencies" {{if eq .Form.BusinessType "travel_agencies"}}selected{{end}}>Reisebüro / Touristik</option>
- <option value="plumber" {{if eq .Form.BusinessType "plumber"}}selected{{end}}>Sanitär / Klempner</option>
- <option value="other" {{if eq .Form.BusinessType "other"}}selected{{end}}>Andere</option>
- </select>
- </label></div>
- <div><label>Website-Sprache<input type="text" name="site_language" value="{{.Form.SiteLanguage}}"></label></div>
- </div>
-
- <h3>Intake / Website-Kontext</h3>
- <div class="grid2">
- <div><label>Website URL<input type="url" name="website_url" value="{{.Form.WebsiteURL}}" placeholder="https://example.com"></label></div>
- <div>
- <label>Locale Style
- <select name="locale_style">
- <option value="">Bitte waehlen</option>
- <option value="de-CH" {{if eq .Form.LocaleStyle "de-CH"}}selected{{end}}>de-CH</option>
- <option value="de-DE" {{if eq .Form.LocaleStyle "de-DE"}}selected{{end}}>de-DE</option>
- <option value="de-AT" {{if eq .Form.LocaleStyle "de-AT"}}selected{{end}}>de-AT</option>
- </select>
- </label>
- </div>
- <div>
- <label>Market Style
- <select name="market_style">
- <option value="">Bitte waehlen</option>
- <option value="DACH" {{if eq .Form.MarketStyle "DACH"}}selected{{end}}>DACH</option>
- <option value="Schweiz" {{if eq .Form.MarketStyle "Schweiz"}}selected{{end}}>Schweiz</option>
- <option value="Deutschland" {{if eq .Form.MarketStyle "Deutschland"}}selected{{end}}>Deutschland</option>
- <option value="Oesterreich" {{if eq .Form.MarketStyle "Oesterreich"}}selected{{end}}>Oesterreich</option>
- </select>
- </label>
- </div>
- <div>
- <label>Address Mode
- <select name="address_mode">
- <option value="">Bitte waehlen</option>
- <option value="du" {{if eq .Form.AddressMode "du"}}selected{{end}}>du</option>
- <option value="sie" {{if eq .Form.AddressMode "sie"}}selected{{end}}>sie</option>
- </select>
- </label>
- </div>
- <div>
- <label>Content Tone
- <select name="content_tone">
- <option value="">Bitte waehlen</option>
- <option value="sachlich" {{if eq .Form.ContentTone "sachlich"}}selected{{end}}>sachlich</option>
- <option value="freundlich" {{if eq .Form.ContentTone "freundlich"}}selected{{end}}>freundlich</option>
- <option value="modern" {{if eq .Form.ContentTone "modern"}}selected{{end}}>modern</option>
- <option value="professionell" {{if eq .Form.ContentTone "professionell"}}selected{{end}}>professionell</option>
- <option value="locker" {{if eq .Form.ContentTone "locker"}}selected{{end}}>locker</option>
- <option value="premium" {{if eq .Form.ContentTone "premium"}}selected{{end}}>premium</option>
- </select>
- </label>
- </div>
- </div>
- <div><label>Website Summary<textarea name="website_summary">{{.Form.WebsiteSummary}}</textarea></label></div>
- <p><small>Prompt-/Systemsteuerung wird global unter <a href="/settings">Settings</a> gepflegt.</small></p>
-
- <h3>Kontakt</h3>
- <div class="grid2">
- <div><label>E-Mail*<input type="email" name="email" value="{{.Form.Email}}" required></label></div>
- <div><label>Telefon<input type="text" name="phone" value="{{.Form.Phone}}"></label></div>
- </div>
-
- <h3>Firmeninformation</h3>
- <div class="grid2">
- <div><label>Organisationsnummer<input type="text" name="org_number" value="{{.Form.OrgNumber}}"></label></div>
- <div><label>Startdatum<input type="text" name="start_date" value="{{.Form.StartDate}}" placeholder="YYYY-MM-DD"></label></div>
- <div><label>Mission<textarea name="mission">{{.Form.Mission}}</textarea></label></div>
- <div><label>Kurzbeschreibung<textarea name="description_short">{{.Form.DescriptionShort}}</textarea></label></div>
- </div>
- <div><label>Langbeschreibung<textarea name="description_long">{{.Form.DescriptionLong}}</textarea></label></div>
-
- <h3>Adresse</h3>
- <div class="grid2">
- <div><label>Adresszeile 1<input type="text" name="address_line1" value="{{.Form.AddressLine1}}"></label></div>
- <div><label>Adresszeile 2<input type="text" name="address_line2" value="{{.Form.AddressLine2}}"></label></div>
- <div><label>Stadt<input type="text" name="address_city" value="{{.Form.AddressCity}}"></label></div>
- <div><label>Region / Bundesland<input type="text" name="address_region" value="{{.Form.AddressRegion}}"></label></div>
- <div><label>PLZ<input type="text" name="address_zip" value="{{.Form.AddressZIP}}"></label></div>
- <div><label>Land<input type="text" name="address_country" value="{{.Form.AddressCountry}}"></label></div>
- </div>
-
- <h2>Template-Felder</h2>
- <div>
- <label><input type="checkbox" name="debug" value="1" {{if .ShowDebug}}checked{{end}}> Debug: technische Felddetails anzeigen</label>
- </div>
- <div>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="generate_all">Generate all suggestions</button>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="regenerate_all">Regenerate all suggestions</button>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="apply_all">Apply all suggestions</button>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="apply_all_empty">Apply all suggestions to empty fields (safe)</button>
- </div>
- {{if and .ShowDebug .SemanticSlots}}
- <details>
- <summary>Technik-Preview: Semantische Zielslots (intern)</summary>
- <table>
- <thead>
- <tr><th>Slot</th><th>Zuordnungen</th><th>Beispiele</th></tr>
- </thead>
- <tbody>
- {{range .SemanticSlots}}
- <tr>
- <td class="mono">{{.Slot}}</td>
- <td>{{.Count}}</td>
- <td class="mono">{{.Examples}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </details>
- {{end}}
-
- {{range .FieldSections}}
- <h3>{{.Title}}</h3>
- {{if .Description}}<p>{{.Description}}</p>{{end}}
-
- {{range .EditableGroups}}
- <h4>{{.Title}}</h4>
- <table>
- <thead>
- <tr><th>Field</th><th>Value</th><th>Sample</th></tr>
- </thead>
- <tbody>
- {{range .Fields}}
- <tr id="{{.AnchorID}}">
- <td>
- <input type="hidden" name="field_path_{{.Index}}" value="{{.Path}}">
- {{.DisplayLabel}}
- {{if $.ShowDebug}}<br><span class="mono">{{.Path}}</span>{{end}}
- </td>
- <td>
- <textarea name="field_value_{{.Index}}">{{.Value}}</textarea>
- {{if .SuggestedValue}}
- <div><small>Vorschlag: {{.SuggestedValue}}</small></div>
- {{if and $.ShowDebug .SuggestionReason}}<div><small>Grund: {{.SuggestionReason}}</small></div>{{end}}
- {{if and $.ShowDebug .SuggestionStatus}}<div><small>Status: {{.SuggestionStatus}}</small></div>{{end}}
- {{if and $.ShowDebug .SuggestionSource}}<div><small>Quelle: {{.SuggestionSource}}</small></div>{{end}}
- <div>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="apply_field::{{.Path}}">Apply</button>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="regenerate_field::{{.Path}}">Regenerate</button>
- </div>
- {{else}}
- <div>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="regenerate_field::{{.Path}}">Regenerate</button>
- </div>
- {{end}}
- </td>
- <td class="mono">{{.SampleValue}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- {{end}}
-
- {{if .EditableFields}}
- <table>
- <thead>
- <tr><th>Field</th><th>Value</th><th>Sample</th></tr>
- </thead>
- <tbody>
- {{range .EditableFields}}
- <tr id="{{.AnchorID}}">
- <td>
- <input type="hidden" name="field_path_{{.Index}}" value="{{.Path}}">
- {{.DisplayLabel}}
- {{if $.ShowDebug}}<br><span class="mono">{{.Path}}</span>{{end}}
- </td>
- <td>
- <textarea name="field_value_{{.Index}}">{{.Value}}</textarea>
- {{if .SuggestedValue}}
- <div><small>Vorschlag: {{.SuggestedValue}}</small></div>
- {{if and $.ShowDebug .SuggestionReason}}<div><small>Grund: {{.SuggestionReason}}</small></div>{{end}}
- {{if and $.ShowDebug .SuggestionStatus}}<div><small>Status: {{.SuggestionStatus}}</small></div>{{end}}
- {{if and $.ShowDebug .SuggestionSource}}<div><small>Quelle: {{.SuggestionSource}}</small></div>{{end}}
- <div>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="apply_field::{{.Path}}">Apply</button>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="regenerate_field::{{.Path}}">Regenerate</button>
- </div>
- {{else}}
- <div>
- <button type="submit" formaction="/builds/drafts/autofill" name="autofill_action" value="regenerate_field::{{.Path}}">Regenerate</button>
- </div>
- {{end}}
- </td>
- <td class="mono">{{.SampleValue}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- {{end}}
-
- {{if .DisabledFields}}
- <table>
- <thead>
- <tr><th>Field</th><th>Status</th><th>Sample</th></tr>
- </thead>
- <tbody>
- {{range .DisabledFields}}
- <tr>
- <td>{{.DisplayLabel}}{{if $.ShowDebug}}<br><span class="mono">{{.Path}}</span>{{end}}</td>
- <td>Erkannt, deaktiviert (MVP ohne Bildlogik)</td>
- <td class="mono">{{.SampleValue}}</td>
- </tr>
- {{end}}
- </tbody>
- </table>
- {{end}}
- {{end}}
-
- {{if eq (len .EditableFields) 0}}
- <p>No enabled text fields found for this template.</p>
- {{end}}
-
- <button type="submit" formaction="/builds/drafts">Save Draft</button>
- <button type="submit">Start Build</button>
- </form>
- {{if .AutofillFocusID}}
- <script>
- window.addEventListener("load", function () {
- var target = document.getElementById("{{.AutofillFocusID}}");
- if (target) {
- target.scrollIntoView({ block: "center" });
- }
- });
- </script>
- {{end}}
- {{end}}
- </body>
- </html>
- {{end}}
|