예제 #1
0
파일: tag.py 프로젝트: manumilou/chezwam
    def view(self, id=None):
		if id is None:
			abort(404)
		tag_q = model.meta.Session.query(model.Tag)
		c.tag = tag_q.get(int(id))
		if c.tag is None:
			abort(404)
		return render('/derived/tag/view.html')
예제 #2
0
    def view(self, id=None):
		if id is None:
			abort(404)
		comment_q = model.meta.Session.query(model.Comment)
		c.comment = comment_q.filter_by(pageid=c.page.id, id=int(id)).first()
		if c.comment is None:
			abort(404)
		return render('/derived/comment/view.html')
예제 #3
0
    def delete(self, id=None):
		if id is None:
			abort(404)
		section_q = meta.Session.query(model.Section)
		section = section_q.filter_by(id=id).first()
		if section is None:
			abort(404)
		nav_q = meta.Session.query(model.Nav)
		existing = nav_q.filter_by(section=id, type='section').filter(model.Page.path != 'index').first()
		if existing is not None:
			return render('/derived/section/cannot_delete.html')
		index_page = nav_q.filter_by(section=id, path='index', type='page').first()
		if index_page is not None:
			model.Nav.remove_navigation_node(index_page)
			meta.Session.delete(index_page)
		model.Nav.remove_navigation_node(section)
		meta.Session.delete(section)
		meta.Session.commit()
		return render('/derived/section/deleted.html')
예제 #4
0
파일: tag.py 프로젝트: manumilou/chezwam
 def list(self):
 	tag_q = meta.Session.query(model.Tag)
 	c.paginator = paginate.Page(
     	tag_q,
     	page=int(request.params.get('page', 1)),
     	items_per_page = 10,
     	controller='tag',
     	action='list'
 	)
 	return render('/derived/tag/list.html')
예제 #5
0
    def delete(self, id=None):
		if id is None:
			abort(404)
		comment_q = meta.Session.query(model.Comment)
		comment = comment_q.filter_by(pageid=c.page.id, id=id).first()
		if comment is None:
			abort(404)
		meta.Session.delete(comment)
		meta.Session.commit()
		return render('/derived/comment/deleted.html')	
예제 #6
0
파일: tag.py 프로젝트: manumilou/chezwam
    def delete(self, id=None):
		if id is None:
			abort(404)
		tag_q = meta.Session.query(model.Tag)
		tag = tag_q.filter_by(id=id).first()
		if tag is None:
			abort(404)
		meta.Session.execute(delete(model.pagetag_table, model.pagetag_table.c.tagid==tag.id))
		meta.Session.delete(tag)
		meta.Session.commit()
		return render('/derived/tag/deleted.html')	
예제 #7
0
 def list(self):
 	comments_q = meta.Session.query(model.Comment).filter_by(pageid=c.page.id)
 	comments_q = comments_q.order_by(model.comment_table.c.created.asc())	
 	c.paginator = paginate.Page(
     	comments_q,
  	   	page=int(request.params.get('page', 1)),
    	 	items_per_page=10,
     	pageid=c.page.id,
     	controller='comment',
     	action='list'
 	)
 	return render('/derived/comment/list.html')
예제 #8
0
파일: tag.py 프로젝트: manumilou/chezwam
    def edit(self, id=None):
		if id is None:
			abort(404)
		tag_q = meta.Session.query(model.Tag)
		tag = tag_q.filter_by(id=id).first()
		if tag is None:
			abort(404)
		values = {
        	'name': tag.name,
   	 	}
		c.title = tag.title
		return htmlfill.render(render('/derived/tag/edit.html'), values)
예제 #9
0
파일: page.py 프로젝트: manumilou/chezwam
    def delete(self, id=None):
		if id is None:
			abort(404)
		page_q = meta.Session.query(model.Page)
		page = page_q.filter_by(id=id).first()
		if page is None:
			abort(404)
		meta.Session.execute(delete(model.pagetag_table, model.pagetag_table.c.pageid==page.id))
		model.Nav.remove_navigation_node(page)
		meta.Session.delete(page)
		meta.Session.commit()
		return render('/derived/page/deleted.html')	
예제 #10
0
    def edit(self, id=None):
		if id is None:
			abort(404)
		comment_q = meta.Session.query(model.Comment)
		comment = comment_q.filter_by(pageid=c.page.id, id=id).first()
		if comment is None:
			abort(404)
		values = {
			'name': comment.name,
			'email': comment.email,
			'content': comment.content,
   	 	}
		c.title = comment.title
		return htmlfill.render(render('/derived/comment/edit.html'), values)
예제 #11
0
    def edit(self, id=None):
		if id is None:
			abort(404)
		section_q = meta.Session.query(model.Section)
		section = section_q.filter_by(id=id).first()
		if section is None:
			abort(404)
		values = {
			'name': section.name,
   			 'path': section.path,
    		'section': section.section,
    		'before': section.before,
   	 	}
		c.title = section.title
		return htmlfill.render(render('/derived/section/edit.html'), values)
예제 #12
0
파일: page.py 프로젝트: manumilou/chezwam
    def view(self, id=None):
		if id is None:
			abort(404)
		page_q = model.meta.Session.query(model.Page)
		c.page = page_q.get(int(id))
		if c.page is None:
			abort(404)
		c.comment_count =  meta.Session.query(model.Comment).filter_by(pageid=id).count()
		tag_q = meta.Session.query(model.Tag)
		c.available_tags = [(tag.id, tag.name) for tag in tag_q]
		c.selected_tags = {'tags':[str(tag.id) for tag in c.page.tags]}
		c.menu = request.environ['chezwam.navigation']['menu']
		c.tabs = request.environ['chezwam.navigation']['tabs']
		c.breadcrumbs = request.environ['chezwam.navigation']['breadcrumbs']
		return render('/derived/page/view.html')
예제 #13
0
파일: page.py 프로젝트: manumilou/chezwam
    def edit(self, id=None):
		if id is None:
			abort(404)
		page_q = meta.Session.query(model.Page)
		page = page_q.filter_by(id=id).first()
		if page is None:
			abort(404)
		values = {
			'name': page.name,
    		'path': page.path,
    		'section': page.section,
    		'before': page.before,
    		'title': page.title,
    		'heading': page.heading,
    		'content': page.content,
   	 	}
		c.title = page.title
		return htmlfill.render(render('/derived/page/edit.html'), values)
예제 #14
0
파일: tag.py 프로젝트: manumilou/chezwam
    def new(self):
		return render('/derived/tag/new.html')
예제 #15
0
    def new(self):
		return render('/derived/comment/new.html')
예제 #16
0
    def list(self):
		c.sections=meta.Session.query(model.Section).all()
		return render('/derived/section/list.html')
예제 #17
0
 def view(self):
     return render('/derived/photostream/view.html');
예제 #18
0
파일: page.py 프로젝트: manumilou/chezwam
    def new(self):
		return render('/derived/page/new.html')
예제 #19
0
파일: nav.py 프로젝트: manumilou/chezwam
    def nosection(self, section, path):
		return render('/derived/nav/create_section.html')
예제 #20
0
파일: page.py 프로젝트: manumilou/chezwam
    def list(self):
		c.pages=meta.Session.query(model.Page).all()
		return render('/derived/page/list.html')
예제 #21
0
    def new(self):
		values = {}
		values.update(request.params)
		if values.has_key('before') and values['before'] == u'None':
			del values['before']
		return htmlfill.render(render('/derived/section/new.html'), values)
예제 #22
0
파일: nav.py 프로젝트: manumilou/chezwam
    def nopage(self, section, path):
		return render('/derived/nav/create_page.html')