feat(core): format handles for templates
Implement Display for generated Handle<T> values and migrate example view data to carry handles directly instead of raw handle id numbers for dynamic handle attributes. req: public_api/001 req: public_api/002
This commit is contained in:
@@ -4,7 +4,7 @@ use axum::routing::get;
|
||||
use axum::Router;
|
||||
use futures_util::{stream, StreamExt};
|
||||
use hemplate::Hemplate;
|
||||
use slhx::{IntoEffect, SafeHtml};
|
||||
use slhx::{Handle, IntoEffect, SafeHtml};
|
||||
use slhx_axum::{runtime_js, sse, DispatchRejection, EffectResponse, HandlerRegistry, InteractionForm, PageRequest};
|
||||
use slhx_kanban_example::ui;
|
||||
use std::collections::BTreeMap;
|
||||
@@ -51,9 +51,9 @@ struct BoardColumn {
|
||||
struct BoardCard {
|
||||
id: u64,
|
||||
title: String,
|
||||
left_handle: u32,
|
||||
right_handle: u32,
|
||||
delete_handle: u32,
|
||||
left_handle: Handle<()>,
|
||||
right_handle: Handle<()>,
|
||||
delete_handle: Handle<()>,
|
||||
left_disabled: bool,
|
||||
right_disabled: bool,
|
||||
}
|
||||
@@ -292,9 +292,9 @@ fn render_card(card: &Card) -> BoardCard {
|
||||
BoardCard {
|
||||
id: card.id,
|
||||
title: card.title.clone(),
|
||||
left_handle: ui::board::handles::move_left.id().id,
|
||||
right_handle: ui::board::handles::move_right.id().id,
|
||||
delete_handle: ui::board::handles::delete_card.id().id,
|
||||
left_handle: ui::board::handles::move_left,
|
||||
right_handle: ui::board::handles::move_right,
|
||||
delete_handle: ui::board::handles::delete_card,
|
||||
left_disabled: card.column == 0,
|
||||
right_disabled: card.column + 1 == COLUMNS.len(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user