Skip to content

Commit 47df239

Browse files
committed
Added updated anchor tags to ebook
1 parent 42b613e commit 47df239

File tree

1 file changed

+26
-0
lines changed
  • curriculum/section14/lectures/14_edit_movies_pre_populate_wtform

1 file changed

+26
-0
lines changed

curriculum/section14/lectures/14_edit_movies_pre_populate_wtform/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,32 @@ And then create the `templates/movie_form.html` template:
105105
{% endblock %}
106106
```
107107

108+
Finally we can update the anchor tags in the `templates/movie_details.html` template since we now can edit the fields:
109+
110+
```diff
111+
...
112+
{% else %}
113+
<p><a href="{{ url_for('pages.watch_today', _id=movie._id) }}" class="watched__link">Not watched yet</a></p>
114+
{% endif %}
115+
- <a class="movie__edit" href="#">Edit {{ pencil("pencil") }}</a>
116+
+ <a class="movie__edit" href="{{ url_for('pages.edit_movie', _id=movie._id) }}">Edit {{ pencil("pencil") }}</a>
117+
</div>
118+
</div>
119+
<div class="header__row">
120+
...
121+
```
122+
123+
```diff
124+
...
125+
{% if movie.description %}
126+
<p class="movie__description">{{ movie.description }}</p>
127+
{% else %}
128+
- <p class="movie__description">No description yet. <a class="link" href="#">Add one?</a></p>
129+
+ <p class="movie__description">No description yet. <a class="link" href="{{ url_for('pages.edit_movie', _id=movie._id) }}">Add one?</a></p>
130+
{% endif %}
131+
...
132+
```
133+
108134
Also nothing new here!
109135

110136
Note that our custom WTForm field is identical to the `TextAreaField`, except when it comes to receiving form data and putting it in our Python object. Everything else behaves the same way as the parent class.

0 commit comments

Comments
 (0)