mirror of https://github.com/snachodog/mybuddy.git
Add dashboard link to child list.
This commit is contained in:
parent
502964e070
commit
f30ef88d1b
|
@ -26,6 +26,12 @@
|
|||
<td class="text-center">
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="Actions">
|
||||
|
||||
{% if perms.core.change_child %}
|
||||
<a href="{% url 'dashboard-child' child.slug %}" class="btn btn-success">
|
||||
<i class="fa fa-tachometer" aria-hidden="true"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if perms.core.change_child %}
|
||||
<a href="{% url 'child-update' child.slug %}" class="btn btn-primary">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i>
|
||||
|
|
|
@ -9,5 +9,5 @@ urlpatterns = [
|
|||
url(r'^$', views.DashboardRedirect.as_view(), name='dashboard'),
|
||||
url(r'^dashboard/$', views.Dashboard.as_view(), name='dashboard'),
|
||||
url(r'children/(?P<slug>[^/.]+)/dashboard/$',
|
||||
views.ChildDashboard.as_view(), name='child-dashboard'),
|
||||
views.ChildDashboard.as_view(), name='dashboard-child'),
|
||||
]
|
||||
|
|
|
@ -15,7 +15,7 @@ class DashboardRedirect(LoginRequiredMixin, RedirectView):
|
|||
def get(self, request, *args, **kwargs):
|
||||
if Child.objects.count() == 1:
|
||||
child_instance = Child.objects.first()
|
||||
self.url = reverse('child-dashboard', args={child_instance.slug})
|
||||
self.url = reverse('dashboard-child', args={child_instance.slug})
|
||||
else:
|
||||
self.url = reverse('dashboard')
|
||||
return super(DashboardRedirect, self).get(request, *args, **kwargs)
|
||||
|
|
Loading…
Reference in New Issue