def studentships(context, entity=None, max_items=20):
    """
    Publishes a date-ordered list of studentships
    """
    entity = work_out_entity(context, entity)
    studentships = gather_studentships(entity)
    return {"studentships": studentships}
def vacancies(context, entity=None, max_items=20):
    """
    Publishes a date-ordered list of vacancies
    """
    entity = work_out_entity(context, entity)
    vacancies = gather_vacancies(entity)
    return {"vacancies": vacancies}
def vacancies_and_studentships(context,
                               heading=3,
                               format=0,
                               max_items=20,
                               entity=None):
    """
    Depends on Cardiff's row/column CSS
    Publishes a date-ordered list of vacancies and studentships
    {% vacancies_and_studentships format max_items %}
    """
    instance = VacanciesPlugin()

    if not entity:
        entity = work_out_entity(context, entity)

    instance.entity = entity
    instance.heading_level = heading
    instance.display = 0
    instance.limit_to = max_items
    instance.format = format

    nep = CMSVacanciesPlugin()

    nep.render(context, instance, None)

    return context
    """
def studentships(context, entity=None, max_items=20):
    """
    Publishes a date-ordered list of studentships
    """
    entity = work_out_entity(context, entity)
    studentships = gather_studentships(entity)
    return {
        'studentships': studentships,
    }
def vacancies(context, entity=None, max_items=20):
    """
    Publishes a date-ordered list of vacancies
    """
    entity = work_out_entity(context, entity)
    vacancies = gather_vacancies(entity)
    return {
        'vacancies': vacancies,
    }
def news_and_events(context, display = "news-and-events", heading = 3, format = "details", current_or_archive = "current", max_items = None, order_by = "importance/date", entity = None):
    """
    Depends on Cardiff's row/column CSS
    Publishes a date-ordered list of news and events
    """
    print "news_and_events_tags.news_and_events"
    instance = NewsAndEventsPlugin()
    if not entity:
        entity = work_out_entity(context, entity)
    instance.order_by = order_by
    instance.entity = entity
    instance.heading_level = heading
    instance.display = display
    print "instance.display", instance.display
    instance.limit_to = max_items
    instance.format = format
    instance.layout = "sidebyside"
    instance.current_or_archive = current_or_archive
    instance.show_more_items = False # because we know that these hardcoded lists don't require it
    CMSNewsAndEventsPlugin().render(context, instance, None)
    return context
def vacancies_and_studentships(context, heading=3, format=0, max_items=20, entity=None):
    """
    Depends on Cardiff's row/column CSS
    Publishes a date-ordered list of vacancies and studentships
    {% vacancies_and_studentships format max_items %}
    """        
    instance = VacanciesPlugin()
        
    if not entity:
        entity = work_out_entity(context, entity)
    
    instance.entity = entity
    instance.heading_level = heading
    instance.display = 0
    instance.limit_to = max_items
    instance.format = format
    
    nep = CMSVacanciesPlugin()
    
    nep.render(context, instance, None)
    
    return context
    """