-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EREGCSC-2113 -- Reflect edited statute dates in frontend (#929)
* feat: bring in statute column dates to statute view * feat: get column dates into Statutes SPA * feat: first pass as getting type and date into col header * chore: python linting, method cleanup * chore: return better empty struct * chore: guard against invalid dates * chore: style subtitle; fix code error * feat: handle null date * chore: empty obj is better than var * fix: JS dates are fun * test: update headerCell snapshot tests * test: better unit tests for headerCells * test: add unit tests for date formatting method * chore: order imports alphabetically * chore: upate header on error_base template
- Loading branch information
Showing
12 changed files
with
581 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
from django.views.generic.base import TemplateView | ||
|
||
from regulations.models import ( | ||
SiteConfiguration, | ||
) | ||
|
||
|
||
class StatuteView(TemplateView): | ||
template_name = 'regulations/statute.html' | ||
|
||
def get_context_data(self, **kwargs): | ||
context = super().get_context_data(**kwargs) | ||
host = self.request.get_host() | ||
site_config = SiteConfiguration.get_solo() | ||
site_config = { | ||
'us_code_house_gov': { | ||
'type': site_config.us_code_house_gov_date_type, | ||
'date': site_config.us_code_house_gov_date, | ||
}, | ||
'us_code_annual': { | ||
'type': site_config.us_code_annual_date_type, | ||
'date': site_config.us_code_annual_date, | ||
}, | ||
'statute_compilation': { | ||
'type': site_config.statute_compilation_date_type, | ||
'date': site_config.statute_compilation_date, | ||
}, | ||
'ssa_gov_compilation': { | ||
'type': site_config.ssa_gov_compilation_date_type, | ||
'date': site_config.ssa_gov_compilation_date, | ||
}, | ||
} | ||
|
||
c = { | ||
'host': host | ||
'host': host, | ||
'site_config': site_config, | ||
} | ||
|
||
return {**context, **c, **self.request.GET.dict()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ssa_gov_compilation": {"date": "2023-08", "type": "effective"}, | ||
"statute_compilation": {"date": "2023-08", "type": "effective"}, | ||
"us_code_annual": {"date": "2023-08", "type": "effective"}, | ||
"us_code_house_gov": {"date": "2023-08", "type": "effective"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.