def display_news(): '''This routine displays the main news list page.''' return display_content( breadcrumbs=get_breadcrumbs('news'), title='Computing News', primaryList=create_full_news_list(News.read_units()), primaryListHr=True, editable=True, editableUrl=url_for('web.display_admin_news') )
def display_admin_news(): '''This routine displays the administration tools for news. We'll eventually use CIT's news tools. ''' return display_content( breadcrumbs=get_breadcrumbs('admin', 'news'), title='Administration: News Articles', primary=create_hyperlink(url_for('web.create_news_article'), 'Create a news article'), primaryList=create_newsarticle_list(News.read_units()), primaryListHr=True, editable=False )
def display_index(): '''Configure and display the main index page, with an appropriate image, the department short description and a list of current news articles. ''' department = check_unit(Departments.read_unit('cs')) return display_content( image=Images.read_tagged_unit('departments.cs'), title=department.get('title'), subtitle=department.get('tagline'), primary=department.get('shortDescription'), sideTitle='Computing News', sideList=create_brief_news_list(News.read_units(limit=2 + TechNews.TECH_NEWS_LIMIT)), editable=True, editableUrl=url_for('web.update_department', name='cs') )