diff --git a/config/accounts.json.example b/config/accounts.json.example index 4286559..8410a87 100644 --- a/config/accounts.json.example +++ b/config/accounts.json.example @@ -4,13 +4,18 @@ "name": "markus", "apple_email": "markus@icloud.com", "apple_app_password": "xxxx-xxxx-xxxx-xxxx", - "authelia_user": "mmustermann" + "authelia_user": "mmustermann", + "custom_links": [ + {"label": "Google Suche", "url": "https://www.google.com/search?q=[fullname]"}, + {"label": "LinkedIn", "url": "https://www.linkedin.com/search/results/all/?keywords=[fullname]"} + ] }, { "name": "partner", "apple_email": "partner@icloud.com", "apple_app_password": "yyyy-yyyy-yyyy-yyyy", - "authelia_user": "partner.user" + "authelia_user": "partner.user", + "custom_links": [] } ], "admins": [ diff --git a/src/api/main.py b/src/api/main.py index 139637e..2842cc4 100644 --- a/src/api/main.py +++ b/src/api/main.py @@ -354,6 +354,15 @@ def web_contact( contact = _row_to_contact_out(row) + custom_links = [] + contact_account = contact.get("account") + if contact_account: + accounts = Config.load_accounts() + for acc in accounts: + if acc.name == contact_account: + custom_links = acc.custom_links + break + return templates.TemplateResponse( "contact.html", { @@ -363,5 +372,6 @@ def web_contact( "show_all": show_all, "contact": contact, "search": search or "", + "custom_links": custom_links, }, ) diff --git a/src/api/templates/contact.html b/src/api/templates/contact.html index 8f8c8d0..28dec30 100644 --- a/src/api/templates/contact.html +++ b/src/api/templates/contact.html @@ -48,11 +48,48 @@ text-decoration: underline; } + .contact-layout { + display: flex; + gap: 1.5rem; + align-items: flex-start; + } + .contact-card { background: #fff; border-radius: 8px; padding: 1rem 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); + flex: 1; + min-width: 0; + } + + .custom-links-box { + width: 280px; + flex-shrink: 0; + background: #fff; + border-radius: 8px; + padding: 1rem 1.25rem; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + } + + .links-spacer { + flex: 1; + } + + .quicklink-item { + display: block; + padding: 0.75rem; + background: #f8f9fa; + border-radius: 6px; + color: #0066cc; + text-decoration: none; + font-size: 0.875rem; + transition: background 0.15s ease; + } + + .quicklink-item:hover { + background: #e7f3ff; + text-decoration: underline; } .contact-header { @@ -224,6 +261,17 @@ .contact-photo:hover { transform: scale(1.03); } + + @media (max-width: 1100px) { + .custom-links-box, + .links-spacer { + display: none; + } + + .contact-layout { + display: block; + } + }
@@ -231,127 +279,144 @@