|
4 | 4 | "strconv" |
5 | 5 | "strings" |
6 | 6 | "time" |
| 7 | + |
| 8 | + "chain/runtime" |
7 | 9 | ) |
8 | 10 |
|
9 | 11 | // Renderer handles the display and formatting of geographic data for web interface |
@@ -48,6 +50,16 @@ func (r *Renderer) RenderMainPage() string { |
48 | 50 | createEventGenericLink := GetCreateEventTxLink("", "", "", 0, 0, 0) |
49 | 51 | sb.WriteString("- [🎯 Create Event](" + createEventGenericLink + ")\n\n") |
50 | 52 |
|
| 53 | + // Owner-only actions: add/remove trusted verifiers |
| 54 | + // Use runtime.PreviousRealm() to detect the current caller for the web UI. |
| 55 | + caller := runtime.PreviousRealm().Address() |
| 56 | + if authManager.IsAdmin(caller.String()) { |
| 57 | + addTrusted := GetAddTrustedVerifierTxLink("") |
| 58 | + removeTrusted := GetRemoveTrustedVerifierTxLink("") |
| 59 | + sb.WriteString("- [🔐 Add Trusted Verifier](" + addTrusted + ") (owner only)\n\n") |
| 60 | + sb.WriteString("- [🔓 Remove Trusted Verifier](" + removeTrusted + ") (owner only)\n\n") |
| 61 | + } |
| 62 | + |
51 | 63 | // Recent activity |
52 | 64 | sb.WriteString("## 🔥 Recent Activity\n") |
53 | 65 | recentVisits := visitManager.GetRecentVisits(5) |
@@ -308,6 +320,15 @@ func (r *Renderer) RenderEvent(eventID string) string { |
308 | 320 | verifyLink := GetVerifyPresenceTxLink(event.ID, "", "") |
309 | 321 | sb.WriteString("- [✅ Verify Attendee (organizer)](" + verifyLink + ")\n\n") |
310 | 322 |
|
| 323 | + // Owner-only: add/remove trusted verifier links (prefill target addr with owner as a convenience) |
| 324 | + caller := runtime.PreviousRealm().Address() |
| 325 | + if authManager.IsAdmin(caller.String()) { |
| 326 | + addTrusted := GetAddTrustedVerifierTxLink(caller.String()) |
| 327 | + removeTrusted := GetRemoveTrustedVerifierTxLink(caller.String()) |
| 328 | + sb.WriteString("- [🔐 Add Trusted Verifier](" + addTrusted + ") (owner only)\n\n") |
| 329 | + sb.WriteString("- [🔓 Remove Trusted Verifier](" + removeTrusted + ") (owner only)\n\n") |
| 330 | + } |
| 331 | + |
311 | 332 | // Verification Statistics |
312 | 333 | totalParticipants := len(event.Participants) |
313 | 334 | verifiedCount := len(event.VerifiedAttendees) |
|
0 commit comments