Commit 2da7e63d916dadf21baae04f11e5feb4f42c12c4
Modularizing the code
- In the templating environment, flask provides url_for, etc helper functions, so we should leverage that as that makes code beautiful and modular.
| | | | 10 | <h3> JSON history </h3> | 10 | <h3> JSON history </h3> |
---|
11 | <ul> | 11 | <ul> |
---|
12 | {% for file in ls %} | 12 | {% for file in ls %} |
---|
13 | <li><a href="/editor?{{ file }}">{{ file }}</a></li> | | <li><a href="/editor?{{ file }}">{{ file }}</a></li> |
---|
| | 13 | <li><a href=" {{ url_for('editor') }}?{{ file }}">{{ file }}</a></li> | 14 | {% endfor %} | 14 | {% endfor %} |
---|
15 | </ul> | 15 | </ul> |
---|
16 | </div> | | </div> |
---|
| | 16 | </div> | 17 | </body> | 17 | </body> |
---|
18 | </html> | 18 | </html> |
---|