mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-14 16:47:02 +02:00
Domain detail view
This commit is contained in:
parent
bd897695d7
commit
b8f3d9bc5d
6 changed files with 30 additions and 2 deletions
|
@ -62,6 +62,7 @@ urlpatterns = [
|
||||||
lambda r: always_404(r, "We forgot to include this link, sorry."),
|
lambda r: always_404(r, "We forgot to include this link, sorry."),
|
||||||
name="todo",
|
name="todo",
|
||||||
),
|
),
|
||||||
|
path("domain/<int:pk>", views.DomainView.as_view(), name="domain"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
14
src/registrar/templates/domain_detail.html
Normal file
14
src/registrar/templates/domain_detail.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{% extends "dashboard_base.html" %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block title %}Domain {{ domain.name }}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<main id="main-content" class="grid-container">
|
||||||
|
<div class="tablet:grid-offset-1 desktop:grid-offset-2">
|
||||||
|
<h1>{{ domain.name }}</h1>
|
||||||
|
|
||||||
|
<p>Active: {% if domain.is_active %}Yes{% else %}No{% endif %}</p>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
{% endblock %} {# content #}
|
|
@ -36,7 +36,7 @@
|
||||||
<td data-sort-value="{{ domain.created_time|date:"U" }}" data-label="Date created">{{ domain.created_time|date }}</td>
|
<td data-sort-value="{{ domain.created_time|date:"U" }}" data-label="Date created">{{ domain.created_time|date }}</td>
|
||||||
<td data-label="Status">{{ domain.application_status|title }}</td>
|
<td data-label="Status">{{ domain.application_status|title }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url "todo" %}">
|
<a href="{% url "domain" pk=domain.pk %}">
|
||||||
Edit <span class="usa-sr-only">{{ domain.name }}</span>
|
Edit <span class="usa-sr-only">{{ domain.name }}</span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from .application import *
|
from .application import *
|
||||||
|
from .domain import *
|
||||||
from .health import *
|
from .health import *
|
||||||
from .index import *
|
from .index import *
|
||||||
from .profile import *
|
from .profile import *
|
||||||
|
|
11
src/registrar/views/domain.py
Normal file
11
src/registrar/views/domain.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
"""View for a single Domain."""
|
||||||
|
|
||||||
|
from django.views.generic import DetailView
|
||||||
|
|
||||||
|
from registrar.models import Domain
|
||||||
|
|
||||||
|
class DomainView(DetailView):
|
||||||
|
|
||||||
|
model = Domain
|
||||||
|
template_name = "domain_detail.html"
|
||||||
|
context_object_name = "domain"
|
|
@ -13,6 +13,7 @@ def index(request):
|
||||||
|
|
||||||
domains = request.user.permissions.values(
|
domains = request.user.permissions.values(
|
||||||
"role",
|
"role",
|
||||||
|
pk=F("domain__id"),
|
||||||
name=F("domain__name"),
|
name=F("domain__name"),
|
||||||
created_time=F("domain__created_at"),
|
created_time=F("domain__created_at"),
|
||||||
application_status=F("domain__domain_application__status"),
|
application_status=F("domain__domain_application__status"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue