projects.html (1169B)
1 {% import "elements/authors.html" as authors %} {% macro view(project) -%} 2 <h2>{{ project.name }}</h2> 3 {% if project.description %} 4 <p>{{ project.description }}</p> 5 {% endif %} {% if project.source %} 6 <a target="_blank" href="{{ project.source }}">Source Code</a> 7 <br /> 8 {% endif %} {{ authors.list(project.authors) }} {% if project.images %} {% for 9 image in project.images %} 10 <img src="{{ image }}" /> 11 {% endfor %} {% endif %} {%- endmacro %} {% macro list(projects) -%} {% for 12 project in projects %} 13 <div> 14 {{ view(project) }} 15 <br /> 16 </div> 17 {% endfor %} {%- endmacro %} {% macro new() -%} 18 <center> 19 <h1>Add New Project</h1> 20 <form method="post" enctype="multipart/form-data"> 21 <label for="name">Name:</label> 22 <input name="name" id="name" required /> 23 <br /> 24 <label for="description">Description:</label> 25 <textarea name="description" id="description"></textarea> 26 <br /> 27 <label for="authors">Authors:</label> 28 <input name="authors" id="authors" required /> 29 <br /> 30 <label for="source">Source:</label> 31 <input name="source" id="source" /> 32 <br /> 33 <input type="submit" value="Add" /> 34 </form> 35 </center> 36 {%- endmacro %}