Exemplo n.º 1
0
def integrate_ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        title = form.title.data
        body = form.body.data
        return render_template('post.html', title=title, body=body)
    return render_template('ckeditor.html', form=form)
Exemplo n.º 2
0
def integrate_ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        title = form.title.data
        body = form.body.data
        flash('Your post is published!')
        return render_template('post.html', title=title, body=body)
    return render_template('ckeditor.html', form=form)
Exemplo n.º 3
0
def intergrate_ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        title = form.title.data
        body = form.body.data
        flash('Your post is published!')
        return render_template('post.html', title=title, body=body)
    return render_template('ckeditor.html', form=form)
Exemplo n.º 4
0
def ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        if form.save.data:
            flash("Save successful!")
        elif form.publish.data:
            flash("Publish successful!")
        return redirect(url_for('index'))
    return render_template('richtextform.html', form=form)
Exemplo n.º 5
0
def test_ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        if form.publish.data:
            title = form.title.data
            body = form.body.data
            return render_template("post_rich.html", title=title, body=body)
        elif form.save.data:
            print("dianjilesave")

    return render_template("ckeditor.html", form=form)
Exemplo n.º 6
0
def question():
    form = RichTextForm()
    if request.method == 'GET':
        return render_template('question.html', form=form)
    else:
        #title = request.form.get('title')
        #content = request.form.get('content')
        if form.validate_on_submit():
            title = form.title.data
            content = form.body.data
            question = Question(title=title, content=content)
            question.author = g.user
            db.session.add(question)
            db.session.commit()
            return redirect(url_for('index'))
            return render_template('post.html', title=title, body=content)
    return render_template('question.html', form=form)
Exemplo n.º 7
0
def ckeditor():
    form = RichTextForm()
    #if form.submit():
    if form.submit.data:
        title = form.title.data
        body = form.body.data
        print(title)
        print(body)
        return render_template('post.html', title=title, body=body)
    return render_template('ckeditor.html', form=form)
Exemplo n.º 8
0
def richtext():
    form = RichTextForm()
    return render_template('ckeditor.html', form=form)
Exemplo n.º 9
0
def ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        pass
    return render_template('ckeditor.html', form=form)
Exemplo n.º 10
0
def editor():
    form = RichTextForm()
    return render_template('editor.html', form=form)