Exemple #1
0
def generate_texts_toc_sitemap():
    """
	Creates a sitemap for each text table of contents page.
	"""
    titles = flatten_toc(library.get_toc())
    urls = ["http://www.sefaria.org/" + Ref(title).url() for title in titles]
    write_urls(urls, "text-toc-sitemap.txt")
def generate_texts_toc_sitemap():
	"""
	Creates a sitemap for each text table of contents page.
	"""
	titles = flatten_toc(library.get_toc())
	urls = ["http://www.sefaria.org/" + Ref(title).url() for title in titles]
	write_urls(urls, "text-toc-sitemap.txt")
Exemple #3
0
def dashboard(request):
	"""
	Dashboard page -- table view of all content
	"""
	counts = db.counts.find({"title": {"$exists": 1}}, 
		{"title": 1, "flags": 1, "linksCount": 1, "percentAvailable": 1})
	
	toc = get_toc()
	flat_toc = flatten_toc(toc)

	def toc_sort(a):
		try:
			return flat_toc.index(a["title"])
		except:
			return 9999

	counts = sorted(counts, key=toc_sort)

	return render_to_response('dashboard.html',
								{
									"counts": counts,
								},
								RequestContext(request))