mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-02 07:52:15 +02:00
Sortable table and dashboard_view styling
This commit is contained in:
parent
5dd4da2d5f
commit
69533a2f80
4 changed files with 31 additions and 8 deletions
|
@ -130,7 +130,7 @@ section.dashboard {
|
|||
}
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
#wrapper.dashboard {
|
||||
background-color: color('primary-lightest');
|
||||
}
|
||||
|
||||
|
|
|
@ -128,11 +128,13 @@
|
|||
<div class="usa-navbar">
|
||||
{% block logo %}
|
||||
<div class="usa-logo" id="extended-logo">
|
||||
<a href="{% url 'home' %}">
|
||||
<img
|
||||
src="{% static 'img/dottedgov-round.svg' %}"
|
||||
alt="Home"
|
||||
width="48px"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
<button type="button" class="usa-menu-btn">Menu</button>
|
||||
|
@ -162,7 +164,7 @@
|
|||
</div>
|
||||
</header>
|
||||
{% endblock banner %}
|
||||
<div id="wrapper">
|
||||
<div id="wrapper" {% if dashboard_view %}class="dashboard"{% endif %}>
|
||||
{% block messages %}
|
||||
{% if messages %}
|
||||
<ul class="messages">
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
{% extends 'base.html' %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block title %} Hello {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -30,19 +32,36 @@
|
|||
<caption class="sr-only">Your domain applications</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th data-sortable scope="col" role="columnheader">Domain name</th>
|
||||
<th data-sortable scope="col" role="columnheader">Date created</th>
|
||||
<th data-sortable scope="col" role="columnheader">Status</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for application in domain_applications %}
|
||||
<tr>
|
||||
<th>
|
||||
<a href="{% url 'edit-application' application.pk %}">
|
||||
<th th scope="row" role="rowheader">
|
||||
{{ application.requested_domain.name|default:"New domain request" }}
|
||||
</a>
|
||||
</th>
|
||||
<td>{{ application.status }}</td>
|
||||
<td data-sort-value="{{ application.created_at|date:"U" }}">{{ application.created_at|date }}</td>
|
||||
<td>{{ application.status|title }}</td>
|
||||
<td>
|
||||
<a href="{% url 'edit-application' application.pk %}">
|
||||
{% if application.status == "started" %}
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#edit"></use>
|
||||
</svg>
|
||||
Edit
|
||||
|
||||
{% else %}
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#settings"></use>
|
||||
</svg>
|
||||
Manage
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
@ -7,6 +7,8 @@ def index(request):
|
|||
"""This page is available to anyone without logging in."""
|
||||
context = {}
|
||||
if request.user.is_authenticated:
|
||||
# the logged-in index view IS the dashboard
|
||||
context["dashboard_view"] = True
|
||||
applications = DomainApplication.objects.filter(creator=request.user)
|
||||
context["domain_applications"] = applications
|
||||
return render(request, "home.html", context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue