Skip to content

Commit

Permalink
dashboard updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stuchalk committed Jun 23, 2024
1 parent be2bf28 commit 678f926
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.views.decorators.csrf import csrf_exempt
from units.models import Repsystems
from umisconfig.settings import *
from repsystems.scripts import *
# from repsystems.scripts import *
from datetime import datetime
import requests
import mimetypes
Expand Down Expand Up @@ -52,6 +52,14 @@ def getrepsysunits(request, rsid):
scrape the data for this repsystem and store it (as json) in the jsondata field in the repsystems table
format of data for each unit should be
"""
print(rsid) # needed?
exit()


def view(request):
# get data about the different repsystems
reps = Repsystems.objects.all()
return render(request, "../templates/dashboard/view.html", {'reps': reps})


def overview(request):
Expand Down
20 changes: 20 additions & 0 deletions templates/dashboard/view.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends 'base.html' %}
{% block title %} UMIS Dashboard {% endblock %}
{% block header %} UMIS Dashboard {% endblock %}
{% block content %}
<h4>UMIS Dashboard</h4>
<div class="row">
<div class="col-12 col-md-10 offset-1">
<div class="card card-success">
<div class="card-header">
<h5 class="card-title mb-0">Representation Systems</h5>
</div>
<div class="list-group card-responsive">
{% for rep in reps %}
<li class="list-group-item item">{{ rep.name }} - Units: {{ rep.representations.count }}</li>
{% endfor %}
</div>
</div>
</div>
</div>
{% endblock %}
1 change: 1 addition & 0 deletions umisconfig/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
path('api/', include('api.urls')),
path('calculations/', include('calculations.urls')),
path('domains/', include('domains.urls')),
path('dashboard/', include('dashboard.urls')),
path('unitsystems/', include('unitsystems.urls')),
path('quantitysystems/', include('quantitysystems.urls')),
path('quantitykinds/', include('quantitykinds.urls')),
Expand Down

0 comments on commit 678f926

Please sign in to comment.