Skip to content
Open
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
8 changes: 8 additions & 0 deletions apps/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ class Config(object):
# Assets Management
ASSETS_ROOT = os.getenv('ASSETS_ROOT', '/static/assets')

# --- Branding (Logo) ---
# URL of the main brand image (can be absolute or /static/...)
BRAND_LOGO_URL = os.getenv('BRAND_LOGO_URL', '/static/assets/img/hackinsdn.png')
# Alternative text (accessibility)
BRAND_LOGO_ALT = os.getenv('BRAND_LOGO_ALT', 'HackInSDN')
# Destination link when clicking on the tag.
BRAND_HREF = os.getenv('BRAND_HREF', '/')

# Set up the App SECRET_KEY
SECRET_KEY = os.getenv('SECRET_KEY', "")
if not SECRET_KEY:
Expand Down
18 changes: 14 additions & 4 deletions apps/templates/includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
<!-- Main Sidebar Container sidebar-dark-primary / sidebar-light-navy -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="/" class="brand-link">
<img src="/static/assets/img/hackinsdn.png" alt="HackInSDN" class="brand-image img-circle elevation-3" style="opacity: .8">
<span class="brand-text font-weight-light">HackInSDN</span>
<a href="{{ config.BRAND_HREF or '/' }}" class="brand-link">
<img
src="{{ config.BRAND_LOGO_URL or '/static/assets/img/hackinsdn.png' }}"
alt="{{ config.BRAND_LOGO_ALT or 'HackInSDN' }}"
class="brand-image img-circle elevation-3"
style="opacity: .8"
>
<span class="brand-text font-weight-light">
{{ config.BRAND_LOGO_ALT or 'HackInSDN' }}
</span>
</a>
<img src="/static/assets/img/hackersdobem.png" alt="HackInSDN" class="img-fluid">

{% if not config.BRAND_LOGO_URL or config.BRAND_LOGO_URL == '/static/assets/img/hackinsdn.png' %}
<img src="/static/assets/img/hackersdobem.png" alt="HackInSDN" class="img-fluid">
{% endif %}

<!-- Sidebar -->
<div class="sidebar">
Expand Down
12 changes: 12 additions & 0 deletions doc/ui-branding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Branding configuration (logo)

You can customize the sidebar brand logo via config/env vars. Defaults keep the current UI unchanged.

**Env vars**

* `BRAND_LOGO_URL` — image URL (absolute or `/static/...`).
*Default:* `/static/assets/img/hackinsdn.png`
* `BRAND_LOGO_ALT` — alt text / visible brand text.
*Default:* `HackInSDN`
* `BRAND_HREF` — link target when clicking the brand.
*Default:* `/`
6 changes: 5 additions & 1 deletion env-template
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ export MAP_POINTS=xxxx
export TESTBED_TITLE=xxxx

# Enable or disable the Collaborative Labs feature
ENABLE_CLABS=true
ENABLE_CLABS=true

BRAND_LOGO_URL=/static/assets/img/hackinsdn.png
BRAND_LOGO_ALT=HackInSDN
BRAND_HREF=/