mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-06-06 20:45:36 +02:00
Add initial architecture
This commit is contained in:
parent
d32d94c548
commit
65363f4e22
2 changed files with 46 additions and 19 deletions
|
@ -382,6 +382,49 @@ class AdminSortFields:
|
||||||
class AuditedAdmin(admin.ModelAdmin):
|
class AuditedAdmin(admin.ModelAdmin):
|
||||||
"""Custom admin to make auditing easier."""
|
"""Custom admin to make auditing easier."""
|
||||||
|
|
||||||
|
# TODO - move this into a helper somewhere, maybe an enum?
|
||||||
|
model_descriptions = {
|
||||||
|
'domainrequest': (
|
||||||
|
"This table contains all domain requests that have been started within the registrar and the "
|
||||||
|
"status of those requests. "
|
||||||
|
"Updating values here will immediately update the corresponding values that users see in the registrar. "
|
||||||
|
"Once a domain request has been adjudicated, the details of that request should not be modified. "
|
||||||
|
"To update attributes (like an organization’s name) after a domain’s approval, go to <a href=\"#\">Domains</a>. "
|
||||||
|
"Similar fields display on each Domain page, but edits made there will not affect the corresponding domain request."
|
||||||
|
),
|
||||||
|
"contact": (
|
||||||
|
"Contacts include anyone who has access to the registrar (known as “users”) and anyone listed in a domain request, "
|
||||||
|
"including other employees and authorizing officials. "
|
||||||
|
"Only contacts who have access to the registrar will have a corresponding record within the "
|
||||||
|
"<a href=\"#\">Users</a> table."
|
||||||
|
# TODO - change this
|
||||||
|
"<br><br>"
|
||||||
|
"Updating someone’s contact information here will not affect that person’s Login.gov information."
|
||||||
|
),
|
||||||
|
"domaininformation": (
|
||||||
|
"Domain information represents the basic metadata for an approved domain and "
|
||||||
|
"the organization that manages it. "
|
||||||
|
"It does not include any information specific to the registry (DNS name servers, security email). "
|
||||||
|
"Registry-related information can be managed within the <a href=\"#\">Domains</a> table. "
|
||||||
|
"Updating values here will immediately update the corresponding values that users see in the registrar."
|
||||||
|
# TODO - change this
|
||||||
|
"<br></br>"
|
||||||
|
"Domain information is similar to <a href=\"#\">Domain requests</a>, and the fields are nearly identical,"
|
||||||
|
"but edits made to one are not made to the other."
|
||||||
|
"Domain information exists so we don’t modify details of an approved request after "
|
||||||
|
"adjudication (since a domain request should be maintained as-adjudicated for records retention purposes). "
|
||||||
|
"Entries are created here upon approval of a domain request. "
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
def changelist_view(self, request, extra_context=None):
|
||||||
|
extra_context = extra_context or {}
|
||||||
|
model_name = self.model._meta.model_name
|
||||||
|
if model_name in self.model_descriptions:
|
||||||
|
extra_context['model_description'] = self.model_descriptions[model_name]
|
||||||
|
|
||||||
|
return super().changelist_view(request, extra_context=extra_context)
|
||||||
|
|
||||||
def history_view(self, request, object_id, extra_context=None):
|
def history_view(self, request, object_id, extra_context=None):
|
||||||
"""On clicking 'History', take admin to the auditlog view for an object."""
|
"""On clicking 'History', take admin to the auditlog view for an object."""
|
||||||
return HttpResponseRedirect(
|
return HttpResponseRedirect(
|
||||||
|
|
|
@ -4,25 +4,9 @@
|
||||||
<h1>{{ title }}</h1>
|
<h1>{{ title }}</h1>
|
||||||
|
|
||||||
{# Adds a model description #}
|
{# Adds a model description #}
|
||||||
{# TODO - this should be stored in context or something, not here. Make this a function. #}
|
<p class="django-admin__model-description text-normal">
|
||||||
{% if opts.model_name == 'domainrequest' %}
|
{{ model_description|safe }}
|
||||||
<p class="django-admin__model-description text-normal">
|
</p>
|
||||||
This table contains all domain requests that have been started within the registrar and the status of those requests.
|
|
||||||
Updating values here will immediately update the corresponding values that users see in the registrar.
|
|
||||||
Once a domain request has been adjudicated, the details of that request should not be modified.
|
|
||||||
To update attributes (like an organization’s name) after a domain’s approval, go to <a href="#">Domains</a>.
|
|
||||||
Similar fields display on each Domain page, but edits made there will not affect the corresponding domain request.
|
|
||||||
</p>
|
|
||||||
{% elif opts.model_name == 'contact' %}
|
|
||||||
<p class="django-admin__model-description text-normal">
|
|
||||||
Contacts include anyone who has access to the registrar (known as “users”) and anyone listed in a domain request,
|
|
||||||
including other employees and authorizing officials.
|
|
||||||
Only contacts who have access to the registrar will have a corresponding record within the <a href="#">Users</a> table.
|
|
||||||
<br>
|
|
||||||
Updating someone’s contact information here will not affect that person’s Login.gov information.
|
|
||||||
</p>
|
|
||||||
{% elif opts.model_name == 'domaininformation' %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
{{ cl.result_count }}
|
{{ cl.result_count }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue