Exemple #1
0
def show_form():
    """Show Form for User Input"""

    story_title = request.args["madlib"]
    for story in stories.values():
        if story.title == story_title:
            story_for_form = story
    
    return render_template('form.html', s=story_for_form, story_title=story_title)
Exemple #2
0
def form():
    story_id = request.args["story_id"]
    story = stories[story_id]
    prompts = story.prompts
    return render_template('form.html',
                           prompts=prompts,
                           title=story.title,
                           story_id=story_id,
                           stories=stories.values())
Exemple #3
0
def show_madlib():
    story_id = request.args["story_id"]
    story = stories[story_id]

    madlib_text = story.generate(request.args)
    return render_template('madlib.html',
                           madlib_text=madlib_text,
                           title=story.title,
                           story_id=story_id,
                           stories=stories.values())
Exemple #4
0
def show_story():
    """Display Madlib Story"""

    answers = request.args
    story_title = request.args["story_title"]
    for story in stories.values():
        if story.title == story_title:
            story_to_gen = story
            
    return render_template("story.html", story_to_gen=story_to_gen, user_answers=answers)
Exemple #5
0
def list_of_stories():
    """This function shows the lists of stories"""
    return render_template("list_of_stories.html", stories=stories.values())
Exemple #6
0
def home_page():
    return render_template('select-story.html', stories=stories.values())
Exemple #7
0
def home():
    """Home page where you chose story."""
    return render_template("home.html", stories=stories.values())
Exemple #8
0
def ask_story():
    """Show list of stories form"""

    return render_template("select-story.html", stories=stories.values())
Exemple #9
0
def ask_story():
    """Show list-of-stories form."""

    return render_template("index.html", stories=stories.values())
Exemple #10
0
def index():
    """List of stories form"""

    return render_template("index.html", stories=stories.values())
def ask_story():
    """Show list of stories options. """
    return render_template('select-story.html', stories=stories.values())
Exemple #12
0
def showids():
    return render_template('selectstory.html', stories=stories.values())
Exemple #13
0
def index():
    """Show list of stories"""
    return render_template('index.html', stories=stories.values())
Exemple #14
0
def get_story():
    '''User picks a story'''
    return render_template('choice.html', stories=stories.values())
Exemple #15
0
def home_page():
    """Offer user choice of Madlib Games"""

    return render_template('index.html', stories=stories.values())
Exemple #16
0
def ask_story():
    """Show list-of-stories form."""
    all_posts = Madlib.query.order_by(Madlib.date_posted).all()
    return render_template("select-story.html",
                           stories=stories.values(),
                           all_posts=all_posts)