generated from coulomb/repo-seed
- Schema: hubs, widgets, widget_versions, interaction_events (append-only trigger), annotations, users — single migration file - Web layer: Types, Routes, FrontController with auth + AutoRefresh layout - Controllers: Hubs (CRUD), Widgets (CRUD + versioning), InteractionEvents (JSON capture, canonical event_type validation), Annotations (threaded, append-only) - Sessions controller for IHP auth - Views: Hubs (index/show/new/edit), Widgets (index/show/new/edit), Annotations (index/new), Sessions (login) - widgetEnvelope helper with full data-* governance attributes - Integration tests: Hub CRUD, Widget versioning, event capture, append-only guard, annotation threading, validation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.7 KiB
Haskell
41 lines
1.7 KiB
Haskell
module Web.View.Sessions.New where
|
|
|
|
import Web.Types
|
|
import Generated.Types
|
|
import IHP.Prelude
|
|
import IHP.ViewPrelude
|
|
|
|
data NewView = NewView { user :: !User }
|
|
|
|
instance View NewView where
|
|
html NewView { .. } = [hsx|
|
|
<div class="max-w-sm mx-auto mt-16">
|
|
<h1 class="text-2xl font-semibold mb-6">Sign in to inter-hub</h1>
|
|
<form method="POST" action={CreateSessionAction} class="space-y-4">
|
|
{forEach (getFlashMessages) renderFlash}
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
|
<input type="email" name="email" required
|
|
class="w-full border border-gray-300 rounded px-3 py-2 text-sm
|
|
focus:outline-none focus:ring-2 focus:ring-indigo-500" />
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
|
|
<input type="password" name="password" required
|
|
class="w-full border border-gray-300 rounded px-3 py-2 text-sm
|
|
focus:outline-none focus:ring-2 focus:ring-indigo-500" />
|
|
</div>
|
|
<button type="submit"
|
|
class="w-full bg-indigo-600 text-white rounded px-4 py-2 text-sm font-medium
|
|
hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
|
Sign in
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|]
|
|
|
|
renderFlash :: Text -> Html
|
|
renderFlash msg = [hsx|
|
|
<div class="bg-red-50 border border-red-200 text-red-700 rounded px-3 py-2 text-sm">{msg}</div>
|
|
|]
|