Skip to content

Commit

Permalink
Merge pull request hedyorg#3920 from hedyorg/list-commands
Browse files Browse the repository at this point in the history
[feat] Create page to easily find commands of a program
  • Loading branch information
Felienne authored Feb 13, 2023
2 parents d35fb76 + b719898 commit 656e06a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,17 @@ def version_page():
commit=commit)


@app.route('/commands/<id>')
def all_commands(id):
program = DATABASE.program_by_id(id)
code = program.get('code')
level = program.get('level')
lang = program.get('lang')
return render_template(
'commands.html',
commands=hedy.all_commands(code, level, lang))


@app.route('/my-achievements')
def achievements_page():
user = current_user()
Expand Down
9 changes: 9 additions & 0 deletions templates/commands.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<html>
<head>
<title>{% if page_title %}{{page_title}}{% else %}Hedy{% endif %}</title>
</head>
<body>
{{ commands }}
</body>
</html>

0 comments on commit 656e06a

Please sign in to comment.