From 6e3ac343e67adea503afef98651ea134526e0453 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Sun, 19 Jul 2020 22:06:00 -0300 Subject: Partially restore cron-target functionality Restored functionality: - Can use `config`, `project-list` and `index` targets Still broken: - `cron-target` with a project doesn't work yet --- ganarchy/templating/templates.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'ganarchy/templating/templates.py') diff --git a/ganarchy/templating/templates.py b/ganarchy/templating/templates.py index 0f691e0..213a7fa 100644 --- a/ganarchy/templating/templates.py +++ b/ganarchy/templating/templates.py @@ -53,9 +53,9 @@ def get_template_loader():

{{ ganarchy.title|e }}

This is {{ ganarchy.title|e }}. Currently tracking the following projects:

Powered by GAnarchy. AGPLv3-licensed. Source Code.

@@ -67,11 +67,10 @@ def get_template_loader(): ## index.toml 'index.toml': """# Generated by GAnarchy -{%- for project, repos in config.projects.items() %} +{%- for project in database.list_projects() %} [projects.{{project}}] -{%- for repo_url, branches in repos.items() %}{% for branch, options in branches.items() %}{% if options.active %} -"{{repo_url|tomle}}".{% if branch %}"{{branch|tomle}}"{% else %}HEAD{% endif %} = { active=true } -{%- endif %}{% endfor %} +{%- for repo_url, branch, _head_commit in database.list_repobranches(project) %} +"{{repo_url|tomle}}".{% if branch == "HEAD" %}HEAD{% else %}"{{branch|tomle}}"{% endif %} = { active=true } {%- endfor %} {% endfor -%} """, -- cgit 1.4.1