From 04558af18a7009ce2fd0d51b54f5268008178413 Mon Sep 17 00:00:00 2001
From: Michael Kohlhase <m.kohlhase@jacobs-university.de>
Date: Fri, 16 Jun 2017 11:53:07 +0200
Subject: [PATCH] projects

---
 _includes/projects_list.html | 27 +++++++++++++++++++++++++++
 projects/index.html          |  9 +++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 _includes/projects_list.html
 create mode 100644 projects/index.html

diff --git a/_includes/projects_list.html b/_includes/projects_list.html
new file mode 100644
index 0000000..456e4c4
--- /dev/null
+++ b/_includes/projects_list.html
@@ -0,0 +1,27 @@
+{% comment %}
+    Generates a list of projects.
+    Expects 'projects' as an argument, representing the list of projects to show. 
+{% endcomment %}
+
+{% for role in site.roles %}
+    {% assign rollers = projects | where: "role", role.id %}
+    
+    {% if rollers.size > 0 %}
+        <ul class="collection with-header">
+            <li class="collection-header"><h4>{{role.name}}</h4></li>
+            {% for project in rollers %}
+                <li class="collection-item avatar">
+                  <a href="{{project.url}}" class="title">{{project.fullname}}</a>
+                  <p>
+                    {% if project.start_date %}
+                        from {{project.start_date}} <br/>
+                    {% endif %}
+                    {% if project.end_date %}
+                        until {{project.end_date}} <br/>
+                    {% endif %}
+                  </p>
+                </li>
+            {% endfor %}
+        </ul>
+    {% endif %}
+{% endfor %}
diff --git a/projects/index.html b/projects/index.html
new file mode 100644
index 0000000..80b93a0
--- /dev/null
+++ b/projects/index.html
@@ -0,0 +1,9 @@
+---
+layout: default
+title: KWARC Projects
+---
+
+<h2>Current Projects of the KWARC Group</h2>
+
+{% assign projects = site.pages | where: "layout", "project" | where_exp: "project", "project.end_date == null" | sort: "start_date" %}
+{% include projects_list.html %}
-- 
GitLab