mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-22 20:39:23 +02:00
CSS tweaks to the button layout in django admin (object-tools)
This commit is contained in:
parent
1cb0127dfb
commit
ee49290e98
5 changed files with 59 additions and 12 deletions
|
@ -778,6 +778,8 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
|
|
||||||
urlpatterns = super().get_urls()
|
urlpatterns = super().get_urls()
|
||||||
|
|
||||||
|
#Used to extrapolate a path name, for instance
|
||||||
|
# name="{app_label}_{model_name}_export_data_type"
|
||||||
info = self.model._meta.app_label, self.model._meta.model_name
|
info = self.model._meta.app_label, self.model._meta.model_name
|
||||||
|
|
||||||
my_url = [
|
my_url = [
|
||||||
|
|
|
@ -180,3 +180,48 @@ h1, h2, h3 {
|
||||||
background: var(--primary);
|
background: var(--primary);
|
||||||
color: var(--header-link-color);
|
color: var(--header-link-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Font mismatch issue due to conflicts between django and uswds,
|
||||||
|
// rough overrides for consistency and readability. May want to revise
|
||||||
|
// in the future
|
||||||
|
.object-tools li a,
|
||||||
|
.object-tools p a {
|
||||||
|
font-family: "Source Sans Pro Web", "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
|
||||||
|
text-transform: capitalize!important;
|
||||||
|
font-size: 14px!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For consistency, make the overrided p a
|
||||||
|
// object tool buttons the same size as the ul li a
|
||||||
|
.object-tools p {
|
||||||
|
line-height: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix margins in mobile view
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.object-tools li {
|
||||||
|
// our CSS is read before django's, so need !important
|
||||||
|
// to override
|
||||||
|
margin-left: 0!important;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix height of buttons
|
||||||
|
.object-tools li {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fixing height of buttons breaks layout because
|
||||||
|
// object-tools and changelist are siblings with
|
||||||
|
// flexbox positioning
|
||||||
|
#changelist {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Account for the h2, roughly 90px
|
||||||
|
@include at-media(tablet) {
|
||||||
|
.object-tools {
|
||||||
|
padding-left: 90px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -77,7 +77,7 @@ class ExportDataTest(TestCase):
|
||||||
columns = [
|
columns = [
|
||||||
"Domain name",
|
"Domain name",
|
||||||
"Domain type",
|
"Domain type",
|
||||||
"Federal agency",
|
"Agency",
|
||||||
"Organization name",
|
"Organization name",
|
||||||
"City",
|
"City",
|
||||||
"State",
|
"State",
|
||||||
|
@ -111,7 +111,7 @@ class ExportDataTest(TestCase):
|
||||||
# We expect READY domains,
|
# We expect READY domains,
|
||||||
# sorted alphabetially by domain name
|
# sorted alphabetially by domain name
|
||||||
expected_content = (
|
expected_content = (
|
||||||
"Domain name,Domain type,Federal agency,Organization name,City,State,AO,"
|
"Domain name,Domain type,Agency,Organization name,City,State,AO,"
|
||||||
"AO email,Submitter,Submitter title,Submitter email,Submitter phone,"
|
"AO email,Submitter,Submitter title,Submitter email,Submitter phone,"
|
||||||
"Security Contact Email,Status\n"
|
"Security Contact Email,Status\n"
|
||||||
"adomain2.gov,Interstate,dnsneeded\n"
|
"adomain2.gov,Interstate,dnsneeded\n"
|
||||||
|
@ -134,7 +134,7 @@ class ExportDataTest(TestCase):
|
||||||
|
|
||||||
self.assertEqual(csv_content, expected_content)
|
self.assertEqual(csv_content, expected_content)
|
||||||
|
|
||||||
def test_export_domains_to_writer_2(self):
|
def test_export_domains_to_writer_additional(self):
|
||||||
"""An additional test for filters and multi-column sort"""
|
"""An additional test for filters and multi-column sort"""
|
||||||
# Create a CSV file in memory
|
# Create a CSV file in memory
|
||||||
csv_file = StringIO()
|
csv_file = StringIO()
|
||||||
|
@ -144,7 +144,7 @@ class ExportDataTest(TestCase):
|
||||||
columns = [
|
columns = [
|
||||||
"Domain name",
|
"Domain name",
|
||||||
"Domain type",
|
"Domain type",
|
||||||
"Federal agency",
|
"Agency",
|
||||||
"Organization name",
|
"Organization name",
|
||||||
"City",
|
"City",
|
||||||
"State",
|
"State",
|
||||||
|
@ -173,7 +173,7 @@ class ExportDataTest(TestCase):
|
||||||
# federal only
|
# federal only
|
||||||
# sorted alphabetially by domain name
|
# sorted alphabetially by domain name
|
||||||
expected_content = (
|
expected_content = (
|
||||||
"Domain name,Domain type,Federal agency,Organization name,City,"
|
"Domain name,Domain type,Agency,Organization name,City,"
|
||||||
"State,Security Contact Email\n"
|
"State,Security Contact Email\n"
|
||||||
"cdomain1.gov,Federal - Executive,World War I Centennial Commission\n"
|
"cdomain1.gov,Federal - Executive,World War I Centennial Commission\n"
|
||||||
"ddomain3.gov,Federal,Armed Forces Retirement Home\n"
|
"ddomain3.gov,Federal,Armed Forces Retirement Home\n"
|
||||||
|
|
|
@ -24,7 +24,7 @@ def export_domains_to_writer(writer, columns, sort_fields, filter_condition):
|
||||||
+ domainInfo.get_federal_type_display()
|
+ domainInfo.get_federal_type_display()
|
||||||
if domainInfo.federal_type
|
if domainInfo.federal_type
|
||||||
else domainInfo.get_organization_type_display(),
|
else domainInfo.get_organization_type_display(),
|
||||||
"Federal agency": domainInfo.federal_agency,
|
"Agency": domainInfo.federal_agency,
|
||||||
"Organization name": domainInfo.organization_name,
|
"Organization name": domainInfo.organization_name,
|
||||||
"City": domainInfo.city,
|
"City": domainInfo.city,
|
||||||
"State": domainInfo.state_territory,
|
"State": domainInfo.state_territory,
|
||||||
|
@ -51,7 +51,7 @@ def export_data_type_to_csv(csv_file):
|
||||||
columns = [
|
columns = [
|
||||||
"Domain name",
|
"Domain name",
|
||||||
"Domain type",
|
"Domain type",
|
||||||
"Federal agency",
|
"Agency",
|
||||||
"Organization name",
|
"Organization name",
|
||||||
"City",
|
"City",
|
||||||
"State",
|
"State",
|
||||||
|
@ -78,7 +78,7 @@ def export_data_full_to_csv(csv_file):
|
||||||
columns = [
|
columns = [
|
||||||
"Domain name",
|
"Domain name",
|
||||||
"Domain type",
|
"Domain type",
|
||||||
"Federal agency",
|
"Agency",
|
||||||
"Organization name",
|
"Organization name",
|
||||||
"City",
|
"City",
|
||||||
"State",
|
"State",
|
||||||
|
@ -101,7 +101,7 @@ def export_data_federal_to_csv(csv_file):
|
||||||
columns = [
|
columns = [
|
||||||
"Domain name",
|
"Domain name",
|
||||||
"Domain type",
|
"Domain type",
|
||||||
"Federal agency",
|
"Agency",
|
||||||
"Organization name",
|
"Organization name",
|
||||||
"City",
|
"City",
|
||||||
"State",
|
"State",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue