fix: some template files were not pre-loaded

This commit is contained in:
moneroexamples 2017-03-13 16:38:57 +08:00
parent c0b19625ef
commit 05a843d6f3
1 changed files with 9 additions and 18 deletions

View File

@ -351,6 +351,9 @@ public:
template_file["checkoutputkeys"] = get_full_page(xmreg::read(TMPL_MY_CHECKRAWOUTPUTKEYS));
template_file["address"] = get_full_page(xmreg::read(TMPL_ADDRESS));
template_file["search_results"] = get_full_page(xmreg::read(TMPL_SEARCH_RESULTS));
template_file["tx_details"] = xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_details.html");
template_file["tx_table_head"] = xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_table_head.html");
template_file["tx_table_row"] = xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_table_row.html");
}
@ -968,19 +971,13 @@ public:
boost::get<mstch::array>(context["txs"]).push_back(tx_context);
map<string, string> partials {
{"tx_details", xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_details.html")},
{"tx_details", template_file["tx_details"]},
};
// read tx.html
string tx_html = xmreg::read(TMPL_TX);
add_css_style(context);
// add header and footer
string full_page = get_full_page(tx_html);
// render the page
return mstch::render(full_page, context, partials);
return mstch::render(template_file["tx"], context, partials);
}
string
@ -2053,16 +2050,10 @@ public:
{"tx_details", xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_details.html")},
};
// read checkrawtx.html
string checkrawtx_html = xmreg::read(TMPL_MY_CHECKRAWTX);
// add header and footer
string full_page = get_full_page(checkrawtx_html);
add_css_style(context);
// render the page
return mstch::render(full_page, context, partials);
return mstch::render(template_file["checkrawtx"], context, partials);
} // if (strncmp(decoded_raw_tx_data.c_str(), SIGNED_TX_PREFIX, magiclen) != 0)
@ -2305,7 +2296,7 @@ public:
}
map<string, string> partials {
{"tx_details", xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_details.html")},
{"tx_details", template_file["tx_details"]},
};
add_css_style(context);
@ -3910,8 +3901,8 @@ public:
// read partial for showing details of tx(s) found
map<string, string> partials {
{"tx_table_head", xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_table_header.html")},
{"tx_table_row" , xmreg::read(string(TMPL_PARIALS_DIR) + "/tx_table_row.html")}
{"tx_table_head", template_file["tx_table_head"]},
{"tx_table_row" , template_file["tx_table_row"]}
};
add_css_style(context);