added shadowrun database
This commit is contained in:
26
src/shadowrun/HtmxShAttributeList.cpp
Normal file
26
src/shadowrun/HtmxShAttributeList.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <format>
|
||||
#include "HtmxShAttributeList.hpp"
|
||||
#include "utils.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
HtmxShAttributeList::HtmxShAttributeList(const std::string& id, const vector<string>& itemList){
|
||||
html += format("<h2>{}</h2>", id);
|
||||
html += "<div class='grid'>";
|
||||
for (auto& item : itemList){
|
||||
string item_id = utils::to_id_format(id + "_" + item);
|
||||
|
||||
html += format("<label>{}:<input type='text' name='{}'></label>", item, item_id);
|
||||
}
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
HtmxShAttributeList::HtmxShAttributeList(const std::string& id, const std::vector<std::pair<std::string, std::string>>& itemValueList){
|
||||
html += format("<h2>{}</h2>", id);
|
||||
html += "<div class='grid'>";
|
||||
for (auto& item : itemValueList){
|
||||
string item_id = utils::to_id_format(id + "_" + item.first);
|
||||
html += format("<label>{}:<input type='text' name='{}' value='{}'></label>", item, item_id, item.second);
|
||||
}
|
||||
html += "</div>";
|
||||
}
|
||||
Reference in New Issue
Block a user