Skip to content

Commit ec3611b

Browse files
committed
hyperlink
1 parent 2dc4974 commit ec3611b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

commcare_connect/program/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def program_home(request, org_slug):
312312
results = sorted(apps, key=lambda x: (x["date_created"], x["program__start_date"]), reverse=True)
313313
pending_counts = (
314314
UserVisit.objects.filter(status="pending")
315-
.values("opportunity__name", "opportunity__organization__name") # Separate field names
315+
.values("opportunity__id", "opportunity__name", "opportunity__organization__name") # Separate field names
316316
.annotate(count=Count("id"))
317317
)
318318
context = {

commcare_connect/templates/tailwind/components/cards/activity_card.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
{% for row in rows %}
1010
<div class="flex justify-between">
1111
<div>
12-
<p class="font-medium text-gray-900">{{ row.opportunity__name }}</p>
12+
<p class="font-medium text-gray-900">
13+
<a href="{% url 'opportunity:tw_opportunities' org_slug=request.org.slug opp_id=row.opportunity__id %}" class="hover:underline">
14+
{{ row.opportunity__name }}
15+
</a>
16+
</p>
1317
<p class="font-normal text-xs text-gray-400">{{ row.opportunity__name }}</p>
1418
</div>
1519
{% include 'tailwind/components/buttons/button_secondary_rounded.html' with text=row.count %}

commcare_connect/templates/tailwind/layouts/sidenav.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
<div class="flex flex-col flex-grow mt-16">
2222
<nav class="flex flex-col px-2 transition-all duration-300" id="navItems">
2323
<nav class="flex flex-col px-2 transition-all duration-300" id="navItems">
24-
{% include "tailwind/components/sidenav-items.html" with name='Programs' icon='table-columns' state='sidebarOpen' target='/dashboard' %}
24+
{% url 'program:home' request.org.slug as program_home_url %}
25+
{% include "tailwind/components/sidenav-items.html" with name='Programs' icon='table-columns' state=sidebarOpen target=program_home_url %}
2526
{% include "tailwind/components/sidenav-items.html" with name='Opportunities' icon='table-cells-large' state='sidebarOpen' target='/opportunities' %}
2627
{% include "tailwind/components/sidenav-items.html" with name='Analytics' icon='chart-pie' state='sidebarOpen' target='/analytics' %}
2728
{% include "tailwind/components/sidenav-items.html" with name='My Organization' icon='buildings' state='sidebarOpen' target='/organization' %}
@@ -33,4 +34,4 @@
3334
{% include "tailwind/components/sidenav-items.html" with name='Help & FAQ' icon='circle-question' state='sidebarOpen' target='/help & FAQ' %}
3435
{% include "tailwind/components/sidenav-items.html" with name='Settings' icon='buildings' state='sidebarOpen' target='/settings' %}
3536
</div>
36-
</div>
37+
</div>

0 commit comments

Comments
 (0)