#include <fmt/format.h>
#include "biawebutil.hpp"
#include "biawebsidebar.hpp"
+#include "biawebtemplate.hpp"
namespace biaweb {
// class to represent a navigation bit like this in html
}
// render using the given template directory
- std::string to_html (std::string templatedir) ;
+ std::string to_html (Template *t) ;
};
// render using the given template
- std::string NavigationBit::to_html (std::string templatedir) {
- std::ifstream templ (templatedir + "/navigationbit.tpl.html");
- std::string templ_str ((std::istreambuf_iterator<char> (templ)),
- (std::istreambuf_iterator<char> ()));
-
+ std::string NavigationBit::to_html (Template *t) {
+ std::string templ_str = t->get_navigationbit_tpl ();
std::string output_html = "";
std::string items_str = "";
for (GenericLinkItem item : this->items)
- items_str += item.to_html (templatedir);
+ items_str += item.to_html (t);
if (this->items.size () > 0)
output_html = fmt::format (templ_str, fmt::arg ("items", items_str));