Skip to content

Commit

Permalink
Add some basic terms
Browse files Browse the repository at this point in the history
  • Loading branch information
Sumukh committed Jun 9, 2024
1 parent ab116ab commit 1a10e4a
Show file tree
Hide file tree
Showing 8 changed files with 480 additions and 10 deletions.
2 changes: 0 additions & 2 deletions appname/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@
PASSWORD_RESET_VALIDITY_SECONDS = 86400

TEAM_MEMBER_ROLES = ['team member', 'administrator']
# Actually, look at services/branding.py wherever possible.
SUPPORT_EMAIL = os.getenv('HELP_EMAIL', 'help@example.com')
MAX_TEAM_SIZE = 50
8 changes: 8 additions & 0 deletions appname/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ def home():
return redirect(url_for('dashboard_home.index'))
return render_template('lander/index.html', stripe_publishable_key=stripe.publishable_key)

@main.route('/terms')
def terms():
return render_template('lander/terms.html')

@main.route('/privacy')
def privacy():
return render_template('lander/terms.html')

@main.route('/beta')
@cache.cached(timeout=1000, unless=lambda: current_user.is_authenticated)
def beta():
Expand Down
5 changes: 2 additions & 3 deletions appname/controllers/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from flask_login import login_required, current_user


from appname.constants import SUPPORT_EMAIL
from appname.extensions import stripe
from appname.models import db
from appname.forms import SimpleForm
Expand All @@ -12,7 +11,7 @@
from appname.utils.token import generate_api_secret
from appname.billing_plans import plans_by_name

from appname.extensions import stripe
from appname.extensions import stripe, branding

settings_blueprint = Blueprint('user_settings', __name__)

Expand Down Expand Up @@ -119,7 +118,7 @@ def account_deletion():
form = SimpleForm()
if form.validate_on_submit():
# TODO: Actual deletion scheduling
flash("Please email {0} to delete your account".format(SUPPORT_EMAIL), 'warning')
flash("Please email {0} to delete your account".format(branding.support_email), 'warning')
else:
flash('Please try submitting the form again', 'warning')
return redirect(url_for("user_settings.legal_compliance"))
18 changes: 17 additions & 1 deletion appname/services/branding.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import os
class Branding:
def __init__(self):
self.environment = "prod"
self.config = {}

def init_app(self, app):
self.config = app.config
self.environment = app.config.get('ENV', 'prod')

@property
Expand All @@ -13,12 +16,25 @@ def name(self):

@property
def support_email(self):
return "appname@example.com"
email = self.config.get('support_email', 'help@example.com')
return email

@property
def icon_path(self):
return "public/ignite/ignite-logo@2x.png"

@property
def website_domain(self):
return "appname.com"

@property
def legal_name(self):
return "appname.com"

@property
def corporate_jurisdiction(self):
return "United States"

@property
def full_logo_path(self):
return "public/ignite/ignite-logo@2x.png"
Expand Down
2 changes: 1 addition & 1 deletion appname/templates/lander/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ <h6 class="card-price text-center">$1999</h6>
</ul>
<hr>

<a href="mailto:{{ constants.SUPPORT_EMAIL }}" class="btn btn-block btn-secondary text-uppercase">Contact Us</a>
<a href="mailto:{{ branding.support_email }}" class="btn btn-block btn-secondary text-uppercase">Contact Us</a>
</div>
</div>
</div>
Expand Down
449 changes: 449 additions & 0 deletions appname/templates/lander/terms.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion appname/templates/settings/legal_compliance.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3 class="card-title">Legal Compliance</h3>
</div>
<div class="card-body">
Here's a copy of our standard terms & privacy policies. Questions about our policies, as well info about
our GDPR policies can be directed over email to {{ constants.SUPPORT_EMAIL }}
our GDPR policies can be directed over email to {{ branding.support_email }}
</div>
<div class="card-footer">
<div class="btn-list text-center">
Expand Down
4 changes: 2 additions & 2 deletions appname/templates/tabler/_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</a>
<div class="d-flex order-lg-2 ml-auto">
<div class="nav-item d-none d-md-flex">
<a href="mailto://{{ constants.SUPPORT_EMAIL }}" class="btn btn-sm btn-outline-primary" target="_blank">Get help</a>
<a href="mailto:{{ branding.support_email }}" class="btn btn-sm btn-outline-primary" target="_blank">Get help</a>
</div>
{% if current_user.is_authenticated %}
<div class="dropdown">
Expand All @@ -32,7 +32,7 @@
<i class="dropdown-icon fe fe-settings"></i> Account Settings
</a>

<a class="dropdown-item" href="mailto://{{ constants.SUPPORT_EMAIL }}">
<a class="dropdown-item" href="mailto:{{ branding.support_email }}">
<i class="dropdown-icon fe fe-help-circle"></i> Need help?
</a>
<a class="dropdown-item" href="{{ url_for('auth.logout') }}">
Expand Down

0 comments on commit 1a10e4a

Please sign in to comment.