mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2024-11-27 00:43:47 +00:00
Add a pastie_page mustache token.
This commit is contained in:
parent
543b3bdfee
commit
17a5009f1f
3 changed files with 5 additions and 1 deletions
|
@ -37,6 +37,7 @@ namespace kamokan {
|
||||||
virtual std::string on_mustache_retrieve() override;
|
virtual std::string on_mustache_retrieve() override;
|
||||||
virtual tawashi::HttpHeader on_general_pastie_process() override;
|
virtual tawashi::HttpHeader on_general_pastie_process() override;
|
||||||
virtual void on_general_mustache_prepare (std::string&& parPastie, mstch::map& parContext) override;
|
virtual void on_general_mustache_prepare (std::string&& parPastie, mstch::map& parContext) override;
|
||||||
|
virtual bool is_pastie_page() const override { return false; }
|
||||||
|
|
||||||
std::string m_lang_file;
|
std::string m_lang_file;
|
||||||
std::string m_langmap_dir;
|
std::string m_langmap_dir;
|
||||||
|
|
|
@ -178,12 +178,14 @@ namespace kamokan {
|
||||||
statuslog->info("Sending response");
|
statuslog->info("Sending response");
|
||||||
SPDLOG_TRACE(statuslog, "Preparing mustache dictionary");
|
SPDLOG_TRACE(statuslog, "Preparing mustache dictionary");
|
||||||
const bool is_submit_page = this->is_submit_page();
|
const bool is_submit_page = this->is_submit_page();
|
||||||
|
const bool is_pastie_page = this->is_pastie_page();
|
||||||
mstch::map mustache_context {
|
mstch::map mustache_context {
|
||||||
{"submit_page", is_submit_page},
|
{"submit_page", is_submit_page},
|
||||||
{"version", boost::string_view{STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH)}},
|
{"version", boost::string_view{STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH)}},
|
||||||
{"tawashi_version", tawashi::version()},
|
{"tawashi_version", tawashi::version()},
|
||||||
{"base_uri", base_uri()},
|
{"base_uri", base_uri()},
|
||||||
{"host_path", make_host_path(this->settings())}
|
{"host_path", make_host_path(this->settings())},
|
||||||
|
{"pastie_page", is_pastie_page}
|
||||||
};
|
};
|
||||||
|
|
||||||
m_storage.finalize_connection();
|
m_storage.finalize_connection();
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace kamokan {
|
||||||
virtual std::string on_mustache_retrieve();
|
virtual std::string on_mustache_retrieve();
|
||||||
virtual std::string default_pastie_lang();
|
virtual std::string default_pastie_lang();
|
||||||
virtual bool is_submit_page() { return false; }
|
virtual bool is_submit_page() { return false; }
|
||||||
|
virtual bool is_pastie_page() const { return false; }
|
||||||
|
|
||||||
Storage m_storage;
|
Storage m_storage;
|
||||||
Kakoune::SafePtr<cgi::Env> m_cgi_env;
|
Kakoune::SafePtr<cgi::Env> m_cgi_env;
|
||||||
|
|
Loading…
Reference in a new issue