forked from gergely/calendar-social
Update the welcome page with actual numbers
This commit is contained in:
@@ -164,6 +164,7 @@ class CalendarSocialApp(Flask):
|
||||
"""
|
||||
|
||||
from .calendar_system.gregorian import GregorianCalendar
|
||||
from .models import User, Event
|
||||
|
||||
try:
|
||||
timestamp = datetime.fromtimestamp(float(request.args.get('date')))
|
||||
@@ -175,10 +176,15 @@ class CalendarSocialApp(Flask):
|
||||
if not current_user.is_authenticated:
|
||||
login_form_class = current_app.extensions['security'].login_form
|
||||
login_form = login_form_class()
|
||||
user_count = User.query.count()
|
||||
event_count = Event.query.count()
|
||||
|
||||
return render_template('welcome.html',
|
||||
calendar=calendar,
|
||||
user_only=False,
|
||||
login_form=login_form)
|
||||
login_form=login_form,
|
||||
user_count=user_count,
|
||||
event_count=event_count)
|
||||
|
||||
return render_template('index.html', calendar=calendar, user_only=True)
|
||||
|
||||
|
Reference in New Issue
Block a user