Beispiel #1
0
def create_app():
    form = CreateAppForm(request.form)
    if form.validate_on_submit():
        app = Application.create(form.name.data,
                          form.domain.data,
                          form.description.data,
                          warden.current_user())
        return redirect(url_for('developer.app_details', domain=app.domain))
    return render_template('developer/create_app.html', form=form)
Beispiel #2
0
def edit_app(domain):
    app = Application.get(domain=domain, author=warden.current_user())
    form = EditAppForm(request.form, name=app.domain, description=app.description)
    if form.validate_on_submit():
        file = request.files['zipfile']
        if zipfile.is_zipfile(file):
            with zipfile.ZipFile(file) as _zipfile:
                os.umask(022)
                path2appfiles = apps_files_path(app.author.nickname, app.domain)
                _zipfile.extractall(path2appfiles)
    return render_template('developer/edit_app.html', form=form)
Beispiel #3
0
def app_details(domain):
    app = Application.get(domain=domain, author=warden.current_user())
    return render_template('developer/app_details.html', app=app)
Beispiel #4
0
def index():
    developers_app = Application.find(author=warden.current_user())
    return render_template('developer/index.html', apps=developers_app)
Beispiel #5
0
 def validate_domain(self, field):
     app = Application.get(domain=field.data, author=warden.current_user())
     if app:
         raise ValidationError("Domain already taken")
Beispiel #6
0
def details(nickname, domain):
    app = Application.get(domain, nickname)
    return render_template('appstore/details.html', app=app)
Beispiel #7
0
def by_author(nickname):
    author = User.get(nickname)
    apps = Application.find(author)
    return render_template('appstore/by_author.html', apps=apps, author=author)
Beispiel #8
0
def index():
    apps = Application.all()
    return render_template('appstore/index.html', apps=apps)