def showCategoriesJSON():
    """
	Get the categories in JSON format.
	
	URLs:
		'/catalog/category/JSON/'
	
	Args:
		None
	"""

    categories = readCategories()
    return jsonify(categories=[c.serialize for c in categories])
def showAllCategories():
    """
	Show all categories.
	
	URLs:
		'/catalog/category/all/'
	
	Args:
		None
	"""

    categories = readCategories()
    return render_template('show_all_categories.html', categories=categories)
def showCategoriesJSON():
	"""
	Get the categories in JSON format.
	
	URLs:
		'/catalog/category/JSON/'
	
	Args:
		None
	"""

	categories = readCategories()
	return jsonify(categories=[c.serialize for c in categories])
def showAllCategories():
	"""
	Show all categories.
	
	URLs:
		'/catalog/category/all/'
	
	Args:
		None
	"""

	categories = readCategories()
	return render_template('show_all_categories.html', categories=categories)
def showCategories():
	"""
	Show all categories.
	
	URLs:
		'/'
		'/catalog/'

	Args:
		None
	"""
	
	categories = readCategories()
	latestItems = readLatestItems(10)
	if 'username' not in login_session:
		return render_template('public_catalog.html', categories=categories,
			latestItems=latestItems)
	else:
		return render_template('catalog.html', categories=categories,
			latestItems=latestItems)
def showCategories():
    """
	Show all categories.
	
	URLs:
		'/'
		'/catalog/'

	Args:
		None
	"""

    categories = readCategories()
    latestItems = readLatestItems(10)
    if 'username' not in login_session:
        return render_template('public_catalog.html',
                               categories=categories,
                               latestItems=latestItems)
    else:
        return render_template('catalog.html',
                               categories=categories,
                               latestItems=latestItems)