From 3f5d68cc4fb0c367b10a504de5ee27e588fb8fc6 Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sat, 20 Feb 2021 20:30:52 -0600 Subject: [PATCH 1/9] Update new_artist.html Fix broken form. Change text on button to Artist, not venue. Correct facebook_link label. --- .../starter_code/templates/forms/new_artist.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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..4c580be7f13 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,13 @@

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) }}
- + -{% endblock %} \ No newline at end of file +{% endblock %} From 7c8008fc15e6e29db79c2f7b4f71ebf97e4ed871 Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sat, 20 Feb 2021 20:33:04 -0600 Subject: [PATCH 2/9] Add missing fields to new_artist.html --- .../templates/forms/new_artist.html | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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 4c580be7f13..9a180b280fa 100644 --- a/projects/01_fyyur/starter_code/templates/forms/new_artist.html +++ b/projects/01_fyyur/starter_code/templates/forms/new_artist.html @@ -32,6 +32,26 @@

List a new artist

{{ 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) }} +
From 0f888c6e550a3991a65129fd5be5712418aaa509 Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sat, 20 Feb 2021 20:43:26 -0600 Subject: [PATCH 3/9] Add missing fields to forms.py --- projects/01_fyyur/starter_code/forms.py | 29 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) 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 From f21151055819004293c6e3a604dd43336920d7de Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sat, 20 Feb 2021 20:51:02 -0600 Subject: [PATCH 4/9] Fix broken form and add missing fields --- .../templates/forms/new_venue.html | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) 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 %} From a8da1d8c5c40b7dc92b0814259f270d8030a5b3f Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sun, 21 Feb 2021 14:06:03 -0600 Subject: [PATCH 5/9] Fix edit_artist.html Add missing fields and fix the broken ones. --- .../templates/forms/edit_artist.html | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) 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 %} From 5a7a012c0cf31e3142a88761e45eaae949b899ec Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sun, 21 Feb 2021 14:11:44 -0600 Subject: [PATCH 6/9] Fix edit_venue.html Add missing fields and fix the broken ones. --- .../templates/forms/edit_venue.html | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) 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 %} From e0a9e82e32a6d92fb82106ca88382bb5dc2cdcd0 Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sun, 21 Feb 2021 14:18:53 -0600 Subject: [PATCH 7/9] Add edit button to show_artist.html Add missing button connected to the artist//edit endpoint. "Todo" instructions say to complete this endpoint, although the front end parts that are supposed to be complete do not use it. --- projects/01_fyyur/starter_code/templates/pages/show_artist.html | 2 ++ 1 file changed, 2 insertions(+) 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 %} From a67dbf5d326c5117871428c5fd53739e14458b5b Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sun, 21 Feb 2021 14:23:05 -0600 Subject: [PATCH 8/9] Add edit button to show_venue.html Added missing edit button to connect to the /venues//edit endpoint. The instructions say to complete this, but it is not used by the completed front end. This will make it much easier for users to test the endpoint when they complete it. --- projects/01_fyyur/starter_code/templates/pages/show_venue.html | 2 ++ 1 file changed, 2 insertions(+) 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 %} From 25ff47dc6ebeb315187648aef5461e66799ff54c Mon Sep 17 00:00:00 2001 From: Robin Lamb Date: Sun, 21 Feb 2021 14:28:12 -0600 Subject: [PATCH 9/9] Fix format_datetime method Added missing "locale='en'" that causes a crash. --- projects/01_fyyur/starter_code/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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