feat: add variable gitea_extra_links to customize nav bar
All checks were successful
continuous-integration/drone/push Build is passing

BREAKING CHANGE: The variable `gitea_footer_custom_links` was renamed to `gitea_extra_links_footer`.
This commit is contained in:
Robert Kaussow 2021-03-14 15:00:00 +01:00
parent 7cdd220b84
commit b3b77eca5d
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
4 changed files with 18 additions and 12 deletions

View File

@ -197,9 +197,7 @@ gitea_markdown_file_ext:
gitea_lfs_enabled: False
gitea_lfs_jwt_secret: gitea_lfs_jwt_secret
# @var gitea_org_creation_enabled: description: >
# Allow regular (non-admin) users to create organizations.
# @end
# @var gitea_org_creation_enabled: description: Allow regular (non-admin) users to create organizations.
gitea_org_creation_enabled: True
gitea_gravatar_enabled: False
@ -238,20 +236,21 @@ gitea_api_default_git_trees_per_page: 1000
gitea_footer_show_branding: False
gitea_footer_show_version: False
gitea_footer_show_template_load_time: False
# @var gitea_footer_custom_links:description: >
# Add custom links e.g. legal notice to gitea footer.
# @end
# @var gitea_footer_custom_links:example: >
# gitea_footer_custom_links:
# @var gitea_extra_links_footer:description: Add custom links e.g. legal notice to gitea footer.
# @var gitea_extra_links_footer:example: >
# gitea_extra_links_footer:
# - name: Legal Notice
# href: https://example.com/legal_notice
# @end
gitea_footer_custom_links: []
gitea_extra_links_footer: []
gitea_extra_links: []
gitea_oauth_provider_enabled: False
gitea_access_token_expiration_time: 3600
gitea_refresh_token_expiration_time: 730
gitea_invalidate_refresh_tokens: False
# @bar gitea_jwt_secret:description: >
# OAuth2 authentication secret for access and refresh tokens.
# Should be replaced by your own secret.

View File

@ -40,9 +40,12 @@
- name: Copy template files
template:
src: "templates/custom/templates/custom/extra_links_footer.tmpl.j2"
dest: "{{ gitea_template_dir }}/custom/extra_links_footer.tmpl"
src: "templates/custom/templates/custom/{{ item }}.tmpl.j2"
dest: "{{ gitea_template_dir }}/custom/{{ item }}.tmpl"
mode: 0600
loop:
- extra_links_footer
- extra_links
notify: __gitea_restart
become: True
become_user: "{{ gitea_user }}"

View File

@ -0,0 +1,4 @@
#jinja2: lstrip_blocks: True
{% for link in gitea_extra_links %}
<a class="item" href="{{ link.href }}">{{ link.name }}</a>
{% endfor %}

View File

@ -1,4 +1,4 @@
#jinja2: lstrip_blocks: True
{% for link in gitea_footer_custom_links %}
{% for link in gitea_extra_links_footer %}
<a class="item" href="{{ link.href }}">{{ link.name }}</a>
{% endfor %}