Example #1
0
def printMainDiv():
	algaeHtmlBlocks.titleBlock()
	algaeHtmlBlocks.displayNav()
	print '<div id="thePosts" class="normalContent">'
	form = cgi.FieldStorage()
	pageNum = int(form.getfirst("page", 0))
	algaeHtmlBlocks.getPostsContent(algaeUserConfig.postsPerPage, pageNum*algaeUserConfig.postsPerPage)
	print "</div>"
	postsCount = algaePython.getPostsCount()
	if postsCount > algaeUserConfig.postsPerPage or pageNum > 0:
		print "<div id='prevNextPage'>"
		if pageNum > 1:
			print '<div id="prevPage"><a href="/?page=' + str(pageNum - 1) + '">Previous Page</a></div>'
		elif pageNum == 1:
			print '<div id="prevPage"><a href="/">Previous Page</a></div>'
		if postsCount > algaeUserConfig.postsPerPage*pageNum + algaeUserConfig.postsPerPage:
			print '<div id="nextPage"><a href="/?page=' + str(pageNum + 1) + '">Next Page</a></div>'
		print "</div>"
Example #2
0
import os
import algaeHtmlBlocks
import algaeModels
import algaePython

pathInfo = os.environ.get("PATH_INFO")
postRequested = pathInfo[7:]
thePost = algaeModels.getContentFromCleanURL(postRequested, "blogPost")

print "Content-Type: text/html \n"
print "<!DOCTYPE html>"
print '<html lang="en">'
if thePost:
    algaeHtmlBlocks.commonHeader(thePost.postTitle)
else:
    algaeHtmlBlocks.commonHeader("Content Not Found")
print "<body>"
print '<div id="mainDiv">'
algaeHtmlBlocks.titleBlock()
algaeHtmlBlocks.displayNav()
print '<div id="thePost" class="normalContent">'
if thePost:
    thePost.printArticle(link=False)
else:
    print "<h1>Content not found.</h1>"
print "</div>"
print "</div>"
print "</body>"
print "</html>"
Example #3
0
def printMainDiv():
	algaeHtmlBlocks.titleBlock("Admin Page")
	if loggedIn():
		printAdminPage()
	else:
		printLoginForm()
Example #4
0
# License: MIT (http://www.opensource.org/licenses/mit-license.php)

import os
import algaeHtmlBlocks
import algaeModels
import algaePython

pathInfo = os.environ.get('PATH_INFO')
postRequested = pathInfo[7:]
thePost = algaeModels.getContentFromCleanURL(postRequested, 'blogPost')

print 'Content-Type: text/html \n'
print '<!DOCTYPE html>'
print '<html lang="en">'
if thePost:
    algaeHtmlBlocks.commonHeader(thePost.postTitle)
else:
    algaeHtmlBlocks.commonHeader('Content Not Found')
print '<body>'
print '<div id="mainDiv">'
algaeHtmlBlocks.titleBlock()
algaeHtmlBlocks.displayNav()
print '<div id="thePost" class="normalContent">'
if thePost:
    thePost.printArticle(link=False)
else:
    print '<h1>Content not found.</h1>'
print '</div>'
print '</div>'
print '</body>'
print '</html>'