def home():
    """
    Homepage.  The main traffic control page.  This page includes the following
    dynamic modules:

    :return:
    """
    # Introduction to CtK
    # Upcoming church events
    # Service information
    # Latest Sermon (pending) with links to sermon list
    # Links to
    # Plan your visit
    # Daily devotions
    # Questions? Answers from God’s Word
    # Pastor and Staff information
    # calendar = EventsList(CONST.CALENDAR_CHURCH)
    calendar = EventsList(CONST.CALENDAR_CHURCH)

    _data = cms.read_home_page('church')
    _events = calendar.get_events(5)
    _context = 'church'
    _meta = {
        "title": _data['meta_title'],
        "description": _data['meta_description']
    }

    return render_template('layouts/page_home_church.html', **locals())
def school_news():
    """
    :return:
    """
    _data = cms.read_news_index(section='school')
    calendar = EventsList(CONST.CALENDAR_SCHOOL)
    _events = calendar.get_events(1)

    _meta = {
        "title": 'NEWS'
    }
    return render_template('layouts/page_school_news_index.html', **locals())
def church_news():
    """
    :return:
    """
    _data = cms.read_news_index(section='church')
    calendar = EventsList(CONST.CALENDAR_CHURCH)
    _events = calendar.get_events(1)

    _meta = {
        "title": 'News Updates'
    }
    return render_template('layouts/page_church_news_index.html', **locals())
def events():
    _context = 'church'
    calendar = EventsList(CONST.CALENDAR_CHURCH)

    _events_calendar = calendar.group_events()
    _events = calendar.get_events(1)
    _calendar_id = CONST.CALENDAR_CHURCH
    _meta = {
        "title": "Church Events",
        "description": ""
    }
    return render_template('layouts/events.html', **locals())
def events():
    _data = cms.read_home_page('school')

    calendar = EventsList(CONST.CALENDAR_SCHOOL)
    _events_calendar = calendar.group_events()
    _context = 'school'
    _events = calendar.get_events(1)
    _calendar_id = CONST.CALENDAR_SCHOOL
    _meta = {
        "title": "School Events",
        "description": ""
    }
    return render_template('layouts/events.html', **locals())
def school_cms_page(slug):
    """
    :return:
    """

    _data = cms.read_page_by_slug(section='school', slug=slug)[0]
    calendar = EventsList(CONST.CALENDAR_SCHOOL)
    _events = calendar.get_events(1)
    _context = 'school'
    _meta = {
        "title": _data['meta_title'],
        "description": _data['meta_description']
    }
    return render_template('layouts/page_standard.html', **locals())
def school_staff_all():
    """
    Homepage.  The main traffic control page.  This page includes the following
    dynamic modules:

    :return:
    """
    _data = cms.read_people('school')
    calendar = EventsList(CONST.CALENDAR_SCHOOL)
    _events = calendar.get_events(1)
    _meta = {
        "title": "School Staff",
        "description": ""
    }

    return render_template('layouts/page_staff_school.html', **locals())
def home():
    """
    Homepage.  The main traffic control page.  This page includes the following
    dynamic modules:

    :return:
    """

    _data = cms.read_home_page('school')
    _staff = cms.read_people('school')
    calendar = EventsList(CONST.CALENDAR_SCHOOL)
    _events = calendar.get_events(5)

    _meta = {
        "title": _data['meta_title'],
        "description": _data['meta_description']
    }

    return render_template('layouts/page_home_school.html', **locals())