Skip to content

chore: Updated template to account for real JSON Attributes #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions commons/static_site_generator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from jinja2 import Environment, FileSystemLoader

def render_kanban_board(data, output_file='./_site/index.html'):
def generate_site(data, output_file='./_site/index.html'):
env = Environment(loader=FileSystemLoader('templates'))
template = env.get_template('kaban_board.html')
output = template.render(data)
Expand All @@ -15,23 +15,40 @@ def render_kanban_board(data, output_file='./_site/index.html'):
'team': 'Platform Engineering',
'tasks': {
'Backlog': [
{'title': 'Research competitors', 'description': 'Analyze feature set'},
{'title': 'Set up project repo', 'description': 'Initialize GitHub repo'},
],
'New': [
{'title': 'Design wireframes', 'description': 'Homepage + Dashboard'},
{
"assignees": [
"coolAssignee"
],
"content": {
"body": "https://dummy_url/test#L42\n\nRename from `X` to `Y`",
"number": 241,
"repository": "pandas/coolrepo",
"title": "cool title",
"type": "Issue",
"url": "https://github.com/pandas/coolrepo/issues/241"
},
"id": "PVTI_lADOBgkjhkjhjjh",
"labels": [
"Bug"
],
"linked pull requests": [
"https://github.com/pandas/coolrepo/pull/242"
],
"repository": "https://github.com/pandas/coolrepo",
"status": "Done",
"title": "Cool Pandas Task"
}
],
'In-Progress': [
{'title': 'Implement auth', 'description': 'Login + Register'},
],
'Blocked': [
{'title': 'API integration', 'description': 'Waiting for backend team'},
],
'Done': [
{'title': 'Project kickoff', 'description': 'Team intro & planning'},
]
}
}


render_kanban_board(data)
generate_site(data)
56 changes: 50 additions & 6 deletions templates/kaban_board.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>{{ title }}</title>
<link rel="icon" href="../images/favicon_io/favicon.ico" type="image/x-icon">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
Expand Down Expand Up @@ -33,27 +34,68 @@ <h1 class="mb-3 text-center">{{ title }}</h1>

<!-- Metadata and search -->
<div class="row mb-4 align-items-center">
<div class="col-md-4">
<p><strong>GitHub User:</strong> {{ github_user }}</p>
<div class="col-md-8">
<p><strong>🧑‍💻 GitHub User:</strong> {{ github_user }}</p>
<p><strong>♣️ Team:</strong> {{ team }}</p>
</div>
<div class="col-md-4">
<!-- <div class="col-md-4">
<p><strong>Team:</strong> {{ team }}</p>
</div>
</div> -->
<div class="col-md-4">
<input type="text" id="searchBox" class="form-control" placeholder="Search tasks...">
</div>
</div>
</div>

<div class="container-fluid py-4">
<!-- Kanban Board -->
<div class="row row-cols-1 row-cols-md-5 g-3">
{% set counter = 0 %}
{% for status in ["Backlog", "New", "In-Progress", "Blocked", "Done"] %}
<div class="col">
<div class="kanban-column">
<div class="kanban-header text-primary text-center">{{ status }}</div>
{% for task in tasks[status] %}

<div class="kanban-card">
<strong>{{ task.title }}</strong><br>
<small>{{ task.description }}</small>
{% set card_id = "card-" ~ counter %}
{% set counter = counter + 1 %}
<div class="d-flex align-items-start gap-2">
<a
href="{{ task.content.url }}"
target="_blank"
class="text-primary text-decoration-none fw-bold"
>
🟢 #{{ task.content.number }}
</a>
<a
class="text-dark text-decoration-none fw-bold flex-grow-1"
data-bs-toggle="collapse"
href="#{{ card_id }}"
role="button"
aria-expanded="false"
aria-controls="{{ card_id }}"
>
{{ task.title }}
</a>
</div>
<div class="collapse mt-2" id="{{ card_id }}">
<!-- <div><small><strong>Issue #:</strong> {{ task.content.number }}</small></div> -->
<div>
<small>
<strong>📦 Repository:</strong>
<a href="{{ task.repository }}" target="_blank">
{{ task.content.repository }}
</a>
</small>
</div>
<div><small><strong>👤 Assignee:</strong> {{ task.assignees | join(', ') }}</small></div>
<div><small><strong>🏷️ Labels:</strong> {{ task.labels | join(', ') }}</small></div>
<div><small><strong>📌 Status:</strong> {{ task.status }}</small></div>
<div class="text-center">
<a href="{{ task.content.url }}" target="_blank" class="btn btn-sm btn-outline-primary mt-2">View Issue</a>
</div>
</div>
</div>
{% endfor %}
</div>
Expand Down Expand Up @@ -86,6 +128,8 @@ <h1 class="mb-3 text-center">{{ title }}</h1>
});
});
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>


</body>
</html>