diff --git a/projects/01_fyyur/starter_code/app.py b/projects/01_fyyur/starter_code/app.py index b30c04a42a2..7b2192ac3ee 100644 --- a/projects/01_fyyur/starter_code/app.py +++ b/projects/01_fyyur/starter_code/app.py @@ -67,7 +67,7 @@ def format_datetime(value, format='medium'): format="EEEE MMMM, d, y 'at' h:mma" elif format == 'medium': format="EE MM, dd, y h:mma" - return babel.dates.format_datetime(date, format) + return babel.dates.format_datetime(date, format, locale='en') app.jinja_env.filters['datetime'] = format_datetime diff --git a/projects/01_fyyur/starter_code/forms.py b/projects/01_fyyur/starter_code/forms.py index 42771beb5dd..ffd553b6e08 100644 --- a/projects/01_fyyur/starter_code/forms.py +++ b/projects/01_fyyur/starter_code/forms.py @@ -1,6 +1,6 @@ from datetime import datetime from flask_wtf import Form -from wtforms import StringField, SelectField, SelectMultipleField, DateTimeField +from wtforms import StringField, SelectField, SelectMultipleField, DateTimeField, BooleanField from wtforms.validators import DataRequired, AnyOf, URL class ShowForm(Form): @@ -116,6 +116,17 @@ class VenueForm(Form): facebook_link = StringField( 'facebook_link', validators=[URL()] ) + website_link = StringField( + 'website_link' + ) + + seeking_talent = BooleanField( 'seeking_talent' ) + + seeking_description = StringField( + 'seeking_description' + ) + + class ArtistForm(Form): name = StringField( @@ -188,7 +199,6 @@ class ArtistForm(Form): 'image_link' ) genres = SelectMultipleField( - # TODO implement enum restriction 'genres', validators=[DataRequired()], choices=[ ('Alternative', 'Alternative'), @@ -211,10 +221,19 @@ class ArtistForm(Form): ('Soul', 'Soul'), ('Other', 'Other'), ] - ) + ) facebook_link = StringField( # TODO implement enum restriction 'facebook_link', validators=[URL()] - ) + ) + + website_link = StringField( + 'website_link' + ) + + seeking_venue = BooleanField( 'seeking_venue' ) + + seeking_description = StringField( + 'seeking_description' + ) -# TODO IMPLEMENT NEW ARTIST FORM AND NEW SHOW FORM diff --git a/projects/01_fyyur/starter_code/templates/forms/edit_artist.html b/projects/01_fyyur/starter_code/templates/forms/edit_artist.html index 87036546900..703b85d48ae 100644 --- a/projects/01_fyyur/starter_code/templates/forms/edit_artist.html +++ b/projects/01_fyyur/starter_code/templates/forms/edit_artist.html @@ -26,13 +26,34 @@

Edit artist {{ artist.name }}

Ctrl+Click to select multiple - {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', id=form.state, autofocus = true) }} + {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', autofocus = true) }}
- - {{ form.facebook_link(class_ = 'form-control', placeholder='http://', id=form.state, autofocus = true) }} + + {{ form.facebook_link(class_ = 'form-control', placeholder='http://', autofocus = true) }}
+ +
+ + {{ form.image_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.website_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.seeking_venue(class_ = 'form-control', placeholder='Venue', autofocus = true) }} +
+ +
+ + {{ form.seeking_description(class_ = 'form-control', autofocus = true) }} +
+ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/projects/01_fyyur/starter_code/templates/forms/edit_venue.html b/projects/01_fyyur/starter_code/templates/forms/edit_venue.html index 1c3469f1bb9..28028f0bf1a 100644 --- a/projects/01_fyyur/starter_code/templates/forms/edit_venue.html +++ b/projects/01_fyyur/starter_code/templates/forms/edit_venue.html @@ -30,13 +30,34 @@

Edit venue {{ venue.name }} Ctrl+Click to select multiple - {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', id=form.state, autofocus = true) }} + {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', autofocus = true) }}
- - {{ form.facebook_link(class_ = 'form-control', placeholder='http://', id=form.state, autofocus = true) }} + + {{ form.facebook_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.image_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.website_link(class_ = 'form-control', placeholder='http://', autofocus = true) }}
+ +
+ + {{ form.seeking_talent(class_ = 'form-control', placeholder='Venue', autofocus = true) }} +
+ +
+ + {{ form.seeking_description(class_ = 'form-control', autofocus = true) }} +
+ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/projects/01_fyyur/starter_code/templates/forms/new_artist.html b/projects/01_fyyur/starter_code/templates/forms/new_artist.html index 33062fa2777..9a180b280fa 100644 --- a/projects/01_fyyur/starter_code/templates/forms/new_artist.html +++ b/projects/01_fyyur/starter_code/templates/forms/new_artist.html @@ -26,13 +26,33 @@

List a new artist

Ctrl+Click to select multiple - {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', id=form.state, autofocus = true) }} + {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', autofocus = true) }}
- - {{ form.facebook_link(class_ = 'form-control', placeholder='http://', id=form.state, autofocus = true) }} + + {{ form.facebook_link(class_ = 'form-control', placeholder='http://', autofocus = true) }}
- + +
+ + {{ form.image_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.website_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.seeking_venue(class_ = 'form-control', placeholder='Venue', autofocus = true) }} +
+ +
+ + {{ form.seeking_description(class_ = 'form-control', autofocus = true) }} +
+ -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/projects/01_fyyur/starter_code/templates/forms/new_venue.html b/projects/01_fyyur/starter_code/templates/forms/new_venue.html index a0bc91ae27d..9a1a8dc441e 100644 --- a/projects/01_fyyur/starter_code/templates/forms/new_venue.html +++ b/projects/01_fyyur/starter_code/templates/forms/new_venue.html @@ -30,13 +30,34 @@

List a new venue Ctrl+Click to select multiple - {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', id=form.state, autofocus = true) }} + {{ form.genres(class_ = 'form-control', placeholder='Genres, separated by commas', autofocus = true) }} +
- - {{ form.facebook_link(class_ = 'form-control', placeholder='http://', id=form.state, autofocus = true) }} -
+ + {{ form.facebook_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} + + +
+ + {{ form.image_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.website_link(class_ = 'form-control', placeholder='http://', autofocus = true) }} +
+ +
+ + {{ form.seeking_talent(class_ = 'form-control', placeholder='Venue', autofocus = true) }} +
+ +
+ + {{ form.seeking_description(class_ = 'form-control', placeholder='Description', autofocus = true) }} +
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/projects/01_fyyur/starter_code/templates/pages/show_artist.html b/projects/01_fyyur/starter_code/templates/pages/show_artist.html index 1068ad926ce..2c33e52df44 100644 --- a/projects/01_fyyur/starter_code/templates/pages/show_artist.html +++ b/projects/01_fyyur/starter_code/templates/pages/show_artist.html @@ -72,5 +72,7 @@
{{ show.start_time|datetime('full') }}
+
+ {% endblock %} diff --git a/projects/01_fyyur/starter_code/templates/pages/show_venue.html b/projects/01_fyyur/starter_code/templates/pages/show_venue.html index c2c0ac856dc..39d562b0689 100644 --- a/projects/01_fyyur/starter_code/templates/pages/show_venue.html +++ b/projects/01_fyyur/starter_code/templates/pages/show_venue.html @@ -75,5 +75,7 @@

{{ show.start_time|datetime('full') }}
+ + {% endblock %}