Possible to load basic data from the database
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user