make billing section optional

This commit is contained in:
realaravinth
2021-08-04 19:24:35 +05:30
parent 1d759fcb25
commit 6763867cbe
4 changed files with 34 additions and 30 deletions

View File

@@ -1,5 +1,6 @@
debug = true debug = true
source_code = "https://github.com/mCaptcha/mCaptcha" source_code = "https://github.com/mCaptcha/mCaptcha"
commercial = false
[server] [server]
# Please set a unique value, your mCaptcha instance's security depends on this being # Please set a unique value, your mCaptcha instance's security depends on this being

View File

@@ -1,19 +1,19 @@
/* /*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net> * Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
//! App data: redis cache, database connections, etc. //! App data: redis cache, database connections, etc.
use std::sync::Arc; use std::sync::Arc;
use std::thread; use std::thread;

View File

@@ -1,19 +1,19 @@
/* /*
* Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net> * Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
use std::env; use std::env;
use std::path::Path; use std::path::Path;
@@ -98,6 +98,7 @@ pub struct Redis {
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct Settings { pub struct Settings {
pub debug: bool, pub debug: bool,
pub commercial: bool,
pub database: Database, pub database: Database,
pub redis: Option<Redis>, pub redis: Option<Redis>,
pub server: Server, pub server: Server,

View File

@@ -38,6 +38,7 @@
</div> </div>
</a> </a>
</li> </li>
<. if crate::SETTINGS.commercial { .>
<li class="secondary-menu__item"> <li class="secondary-menu__item">
<a class="secondary-menu__item-link" href=""> <a class="secondary-menu__item-link" href="">
<img class="secondary-menu__icon" src="<.= crate::CREDIT_CARD.0 .>" alt="<.= crate::CREDIT_CARD.1 .>" /> <img class="secondary-menu__icon" src="<.= crate::CREDIT_CARD.0 .>" alt="<.= crate::CREDIT_CARD.1 .>" />
@@ -46,6 +47,7 @@
</div> </div>
</a> </a>
</li> </li>
<. } .>
<li class="secondary-menu__item"> <li class="secondary-menu__item">
<a class="secondary-menu__item-link" href=""> <a class="secondary-menu__item-link" href="">
<img class="secondary-menu__icon" src="<.= crate::HELP_CIRCLE.0 .>" alt="<.= crate::HELP_CIRCLE.1 .>" /> <img class="secondary-menu__icon" src="<.= crate::HELP_CIRCLE.0 .>" alt="<.= crate::HELP_CIRCLE.1 .>" />