Exemplo n.º 1
0
    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')
Exemplo n.º 2
0
 def settings(self):
     c.tabs = [
         ('info', 'Information'),
         ('modules', 'Modules'),
         ('members', 'Members'),
         ('versions', 'Versions')
     ]
     return render('/projects/settings.mao')
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
 def activity(self):
     return render('/projects/activity.mao')
Exemplo n.º 5
0
 def show(self):
     return render('/projects/show.mao')
Exemplo n.º 6
0
 def index(self):
     c.projects = db.query(Project).all()
     return render('/projects/index.mao')
Exemplo n.º 7
0
 def index(self):
     c.latest_projects = db.query(Project)[-5:]
     return render("/main/index.mao")
Exemplo n.º 8
0
 def projects(self):
     return render('/admin/projects.mao')
Exemplo n.º 9
0
 def index(self):
     return render('/admin/index.mao')
Exemplo n.º 10
0
 def login(self):
     return render('/account/login.mao')