Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #7
0
def ckeditor():
    form = RichTextForm()
    if form.validate_on_submit():
        pass
    return render_template('ckeditor.html', form=form)