def add(self): if request.POST: c.name = request.POST.get('name') c.description = request.POST.get('description') c.identifier = request.POST.get('identifier') c.homepage = request.POST.get('homepage') c.is_public = request.POST.get('is_public') or False if not c.name: c.error = 'You must enter a name' return render('/projects/add.mao') if not c.identifier: c.error = 'You must enter an identifier' return render('/projects/add.mao') project = Project() project.name = c.name project.description = c.description project.homepage = c.homepage project.is_public = c.is_public project.identifier = c.identifier db.add(project) db.commit() redirect_to(action='show', id=c.identifier) return render('/projects/add.mao')
def settings(self): c.tabs = [ ('info', 'Information'), ('modules', 'Modules'), ('members', 'Members'), ('versions', 'Versions') ] return render('/projects/settings.mao')
def view(self): title = request.urlvars.get('page') if not title: title = c.project.wiki.start_page page = db.query(WikiPage).filter_by(title=title, wiki_id=c.project.wiki.id).first() c.page = page c.title = title if not page: c.contents = DEFAULT % {'title': title} return render('/wiki/view.mao')
def activity(self): return render('/projects/activity.mao')
def show(self): return render('/projects/show.mao')
def index(self): c.projects = db.query(Project).all() return render('/projects/index.mao')
def index(self): c.latest_projects = db.query(Project)[-5:] return render("/main/index.mao")
def projects(self): return render('/admin/projects.mao')
def index(self): return render('/admin/index.mao')
def login(self): return render('/account/login.mao')