diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2015-03-21 20:25:11 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2015-03-21 20:25:11 -0400 |
| commit | c8672196cd4f8e45667052274783a012e166923d (patch) | |
| tree | 5a9cbe582de4c25e71e37f9581b28a144c449202 | |
| parent | cd2706b1a432f1b5641fd24212d1b0b0a55e17ab (diff) | |
| download | wedding-website-c8672196cd4f8e45667052274783a012e166923d.tar.gz | |
hook everything up
| -rw-r--r-- | templates/en/rsvp.htm | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/templates/en/rsvp.htm b/templates/en/rsvp.htm index fd1ea67..f258b41 100644 --- a/templates/en/rsvp.htm +++ b/templates/en/rsvp.htm @@ -2,6 +2,17 @@ {% block content%} <form id="rsvp" action="/rsvp/" role="form" class="form-horizontal" method="post"> + {% with messages = get_flashed_messages() %} + {% if messages %} + {% for message in messages %} + <div class="row"> + <div class="alert alert-success col-md-9"> + <strong>Success! </strong>{{message}} + </div> + {% endfor %} + </div> + {% endif %} + {% endwith %} <div class="form-group"> <label for="name" class="col-md-2 control-label">Username:</label> <div class="col-md-5"> @@ -12,7 +23,7 @@ <label for="fullname" class="col-md-2 control-label">Full Name:</label> <div class="col-md-5"> <input type="text" id="fullname" class="form-control" - name="username" placeholder="{{form['full_name']}}"/> + name="fullname" placeholder="Your full name" value="{{form['full_name'] if form['full_name']}}"/> </div> </div> <p style="text-indent:3em"> @@ -22,11 +33,11 @@ <label for="answer" class="col-md-2 control-label">RSVP:</label> <div class="col-md-9"> <label class="radio-inline"> - <input type="radio" value="yes" name="rsvp" + <input type="radio" value="1" name="answer" {%if form['rsvp'] %}checked {% endif %}>Yes </label> <label class="radio-inline"> - <input type="radio" value="no" name="rsvp" + <input type="radio" value="0" name="answer" {%if not form['rsvp'] %}checked {% endif %}>No </label> </div> @@ -35,17 +46,16 @@ <label for="email" class="col-md-2 control-label">Email:</label> <div class="col-md-5"> <input type="email" id="email" class="form-control" - name="email" placeholder= - "{{form['email'] if form['email'] is not none else 'email'}}"/> + name="email" placeholder="email" value="{{form['email'] if form['email']}}" /> </div> </div> <div class="form-group"> <label for="mailing" class="col-md-2 control-label">Mailing Address:</label> <div class="col-md-5"> <textarea id="mailing" name="mailing" - placeholder="{{mailing if form['mailing'] is not none - else 'Your mailing address'}}" - class="form-control" rows="3"></textarea> + placeholder="Your mailing address" + value="{{form['mailing'] if form['mailing']}}" + class="form-control" rows="3" {% if not form['rsvp'] %}disabled {%endif%}></textarea> </div> </div> <p style="text-indent:3em"> @@ -55,11 +65,11 @@ <label for="plusone" class="col-md-2 control-label">+1:</label> <div class="col-md-9"> <label class="radio-inline"> - <input type="radio" value="yes" name="plusone" - {%if form['plusone'] %}checked {% endif %}>Yes + <input id="plusoneyes" type="radio" value="1" name="plusone" + {%if form['plusone'] %}checked {% endif %} >Yes </label> <label class="radio-inline"> - <input type="radio" value="no" name="plusone" + <input id="plusoneno" type="radio" value="0" name="plusone" {%if not form['plusone'] %}checked {% endif %}>No </label> </div> @@ -68,7 +78,9 @@ <label for="mailing" class="col-md-2 control-label">+1's Full Name:</label> <div class="col-md-5"> <input type="text" id="plusonename" class="form-control" - name="plusonename" placeholder="{{form['plusonename']}}"/> + name="plusonename" placeholder="+1's Name" + value="{{form['plusonename'] if form['plusonename']}}" + {% if not form['plusone']%}disabled{% endif %}/> </div> </div> <p style="text-indent:3em"> @@ -78,11 +90,11 @@ <label for="plusone" class="col-md-2 control-label">Kids:</label> <div class="col-md-9"> <label class="radio-inline"> - <input type="radio" value="yes" name="kids" + <input id="kidsyes" type="radio" value="1" name="kids" {%if form['kids'] %}checked {% endif %}>Yes </label> <label class="radio-inline"> - <input type="radio" value="no" name="kids" + <input id="kidsno" type="radio" value="0" name="kids" {%if not form['kids'] %}checked {% endif %}>No </label> </div> @@ -91,7 +103,8 @@ <label for="mailing" class="col-md-2 control-label">Kids' names:</label> <div class="col-md-5"> <textarea id="kidsnames" name="kidsnames" placeholder="Your kids' names" - class="form-control" rows="3"></textarea> + class="form-control" rows="3" + {%if not form['kids']%} disabled{% endif %}></textarea> </div> </div> <p style="text-indent:3em"> @@ -102,8 +115,15 @@ <label for="mailing" class="col-md-2 control-label">Comments:</label> <div class="col-md-5"> <textarea id="comments" name="comments" placeholder="Your comments" - class="form-control" rows="3"></textarea> + value="{{form['comments']}}" class="form-control" rows="3"></textarea> </div> </div> + <div class="form-group"> + <div class="col-md-offset-2 col-md-5"> + <button type="submit" class="btn btn-primary" name="rsvp"> + Update + </button> + </div> + </div> </form> {% endblock %} |
