mirror of
https://github.com/ipnet-mesh/meshcore-hub.git
synced 2026-08-07 01:13:11 +02:00
Link adopted-by user name to profile page on node detail
Add profile_id to AdoptedByUser API schema and populate it from
the backend so the SPA can link the adopter's name to their
/profile/{id} page. Style the link with text-primary to stand out
from the surrounding opacity-70 text.
This commit is contained in:
@@ -22,6 +22,7 @@ def _get_adopted_by(node: Node) -> Optional[AdoptedByUser]:
|
||||
user_id=profile.user_id,
|
||||
name=profile.name,
|
||||
callsign=profile.callsign,
|
||||
profile_id=profile.id,
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ class AdoptedByUser(BaseModel):
|
||||
user_id: str = Field(..., description="OIDC subject identifier")
|
||||
name: Optional[str] = Field(default=None, description="User display name")
|
||||
callsign: Optional[str] = Field(default=None, description="Amateur radio callsign")
|
||||
profile_id: str = Field(..., description="User profile UUID for profile links")
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
@@ -303,7 +303,10 @@ function renderAdoptionSection(node, config) {
|
||||
return html`<div class="card bg-base-100 shadow-xl h-full">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">${t('nodes.ownership')}</h2>
|
||||
<p class="text-sm opacity-70">${t('nodes.adopted_by', { name: ownerName })}</p>
|
||||
<p class="text-sm opacity-70">
|
||||
${t('nodes.adopted_by_prefix')}
|
||||
<a href="/profile/${node.adopted_by.profile_id}" class="link link-hover text-primary">${ownerName}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
@@ -323,7 +326,10 @@ function renderAdoptionSection(node, config) {
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">${t('nodes.ownership')}</h2>
|
||||
<div class="flex items-center justify-between">
|
||||
<p class="text-sm opacity-70">${t('nodes.adopted_by', { name: ownerName })}</p>
|
||||
<p class="text-sm opacity-70">
|
||||
${t('nodes.adopted_by_prefix')}
|
||||
<a href="/profile/${node.adopted_by.profile_id}" class="link link-hover text-primary">${ownerName}</a>
|
||||
</p>
|
||||
${releaseBtnHtml}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -155,6 +155,7 @@
|
||||
"adopt": "Adopt",
|
||||
"release": "Release",
|
||||
"adopted_by": "Adopted by {{name}}",
|
||||
"adopted_by_prefix": "Adopted by",
|
||||
"not_adopted": "This node has not been adopted by any operator.",
|
||||
"adopt_success": "Node adopted successfully",
|
||||
"release_success": "Node released successfully",
|
||||
|
||||
Reference in New Issue
Block a user