diff --git a/app/templates/pages/student/projects.html b/app/templates/pages/student/projects.html index 661844f3f897ae310952bd1f3df28bad023e3559..29e64e486c5af81f0ec87e46138cc93a8a9babe8 100644 --- a/app/templates/pages/student/projects.html +++ b/app/templates/pages/student/projects.html @@ -1,24 +1,30 @@ {% extends "components/layout.html" %} +{% macro project_list(title, projects) %} + <section class="w3-section"> + <h1 class="w3-center w3-text-blue">{{ title }}</h1> + <ul class="w3-ul"> + {% for project in projects %} + <li class="w3-display-container"> + {{ project.title }} + <div class="w3-display-right"> + <a href="{{ url_for("student.view_project", project_id=project.id) }}" + class="w3-button w3-hover-blue">View</a> + <a href="" + class="w3-button w3-hover-blue">Shortlist</a> + </div> + </li> + {% endfor %} + </ul> + </section> +{% endmacro %} + {% block content %} <div class="w3-content"> <div class="w3-container"> - <h1 class="w3-center w3-text-blue">All project proposals</h1> - <section class="w3-section"> - <ul class="w3-ul"> - {% for project in projects %} - <li class="w3-display-container"> - {{ project.title }} - <div class="w3-display-right"> - <a href="{{ url_for("student.view_project", project_id=project.id) }}" class="w3-button w3-hover-blue">View</a> - <a href="" - class="w3-button w3-hover-blue">Shortlist</a> - </div> - </li> - {% endfor %} - </ul> - </section> + {{ project_list("All project proposals", projects | selectattr("on_behalf", "ne", current_user.username)) }} + {{ project_list("Your own project proposals", projects | selectattr("on_behalf", "eq", current_user.username)) }} </div> </div>