Possible to load basic data from the database

This commit is contained in:
2025-06-02 22:44:53 +02:00
parent 69f7f625f8
commit 397189c259
15 changed files with 426 additions and 58 deletions

View File

@@ -8,7 +8,7 @@ HtmxShAttributeList::HtmxShAttributeList(const std::string& id, const vector<str
html += format("<h2>{}</h2>", id);
html += "<div class='grid'>";
for (auto& item : itemList){
string item_id = utils::to_id_format(id + "_" + item);
string item_id = utils::to_id_format(format("{}_{}", id, item));
html += format("<label>{}:<input type='text' name='{}'></label>", item, item_id);
}
@@ -19,8 +19,15 @@ HtmxShAttributeList::HtmxShAttributeList(const std::string& id, const std::vecto
html += format("<h2>{}</h2>", id);
html += "<div class='grid'>";
for (auto& item : itemValueList){
string item_id = utils::to_id_format(id + "_" + item.first);
string item_id = utils::to_id_format(format("{}_{}", id, item));
html += format("<label>{}:<input type='text' name='{}' value='{}'></label>", item, item_id, item.second);
}
html += "</div>";
}
void HtmxShAttributeList::genIds(std::vector<std::string>& vec, const std::string& id, const std::vector<std::string>& itemList)
{
for (auto& item : itemList){
vec.push_back(utils::to_id_format(format("{}_{}", id, item)));
}
}