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)
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())
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())
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)
def list_of_stories(): """This function shows the lists of stories""" return render_template("list_of_stories.html", stories=stories.values())
def home_page(): return render_template('select-story.html', stories=stories.values())
def home(): """Home page where you chose story.""" return render_template("home.html", stories=stories.values())
def ask_story(): """Show list of stories form""" return render_template("select-story.html", stories=stories.values())
def ask_story(): """Show list-of-stories form.""" return render_template("index.html", stories=stories.values())
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())
def showids(): return render_template('selectstory.html', stories=stories.values())
def index(): """Show list of stories""" return render_template('index.html', stories=stories.values())
def get_story(): '''User picks a story''' return render_template('choice.html', stories=stories.values())
def home_page(): """Offer user choice of Madlib Games""" return render_template('index.html', stories=stories.values())
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)