better reader for mails
This commit is contained in:
Binary file not shown.
@@ -655,6 +655,16 @@ def init_routes(main_bp):
|
||||
# Get email templates for the email templates tab
|
||||
email_templates = EmailTemplate.query.filter_by(is_active=True).all()
|
||||
|
||||
# Get mails for the mails tab
|
||||
mails = None
|
||||
if active_tab == 'mails':
|
||||
page = request.args.get('page', 1, type=int)
|
||||
per_page = 10
|
||||
mails = Mail.query.order_by(Mail.created_at.desc()).paginate(page=page, per_page=per_page)
|
||||
total_pages = mails.pages
|
||||
current_page = mails.page
|
||||
users = User.query.order_by(User.username).all()
|
||||
|
||||
if request.method == 'GET':
|
||||
company_form.company_name.data = site_settings.company_name
|
||||
company_form.company_website.data = site_settings.company_website
|
||||
@@ -674,6 +684,7 @@ def init_routes(main_bp):
|
||||
active_tab=active_tab,
|
||||
site_settings=site_settings,
|
||||
events=events.items if events else None,
|
||||
mails=mails,
|
||||
total_pages=total_pages,
|
||||
current_page=current_page,
|
||||
users=users,
|
||||
|
||||
Reference in New Issue
Block a user