Compare commits
3
Commits
952a8bca13
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1853e6c470
|
||
|
|
54f45820ad
|
||
|
|
031d61e1fe
|
@@ -0,0 +1,27 @@
|
|||||||
|
name: dnscms
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "dnscms/**"
|
||||||
|
- ".gitea/workflows/dnscms.yaml"
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "dnscms/**"
|
||||||
|
- ".gitea/workflows/dnscms.yaml"
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: dnscms
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: astral-sh/setup-uv@v7
|
||||||
|
- run: uv sync --locked
|
||||||
|
- run: uv run ruff check .
|
||||||
|
- run: uv run ruff format --check .
|
||||||
|
- run: uv run manage.py makemigrations --check --dry-run --settings=dnscms.settings.test
|
||||||
|
- run: uv run pytest
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
name: web
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "web/**"
|
||||||
|
- ".gitea/workflows/web.yaml"
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- "web/**"
|
||||||
|
- ".gitea/workflows/web.yaml"
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: web
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 24
|
||||||
|
cache: npm
|
||||||
|
cache-dependency-path: web/package-lock.json
|
||||||
|
- run: npm ci
|
||||||
|
- run: npx tsc --noEmit
|
||||||
|
- run: npm test
|
||||||
@@ -33,11 +33,11 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 99
|
line-length = 99
|
||||||
|
exclude = ["**/migrations/*.py"]
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
select = ["F", "E", "W", "Q", "UP", "DJ"]
|
select = ["F", "E", "W", "Q", "UP", "DJ"]
|
||||||
ignore = []
|
ignore = []
|
||||||
exclude = ["**/migrations/*.py"]
|
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
DJANGO_SETTINGS_MODULE = "dnscms.settings.test"
|
DJANGO_SETTINGS_MODULE = "dnscms.settings.test"
|
||||||
|
|||||||
@@ -304,14 +304,14 @@ const CalendarWeek = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
function maybeYear(yearMonthString: string) {
|
function srOnlyYear(yearMonthString: string) {
|
||||||
|
// formatYearMonth only shows the year for non-current years; always expose it to screen readers
|
||||||
const yearMonth = new Date(yearMonthString);
|
const yearMonth = new Date(yearMonthString);
|
||||||
const now = new Date();
|
const isCurrentYear = yearMonth.getFullYear() === new Date().getFullYear();
|
||||||
const isCurrentYear = yearMonth.getFullYear() == now.getFullYear();
|
if (!isCurrentYear) {
|
||||||
if (isCurrentYear) {
|
return null;
|
||||||
return <span className="sr-only"> {yearMonth.getFullYear()}</span>;
|
|
||||||
}
|
}
|
||||||
return ` ${yearMonth.getFullYear()}`;
|
return <span className="sr-only"> {yearMonth.getFullYear()}</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventCalendar = ({ events }: { events: EventOverviewItemFragment[] }) => {
|
const EventCalendar = ({ events }: { events: EventOverviewItemFragment[] }) => {
|
||||||
@@ -354,7 +354,7 @@ const EventCalendar = ({ events }: { events: EventOverviewItemFragment[] }) => {
|
|||||||
>
|
>
|
||||||
<h2 onClick={() => toggleYearMonth(yearMonth)}>
|
<h2 onClick={() => toggleYearMonth(yearMonth)}>
|
||||||
{formatYearMonth(yearMonth)}
|
{formatYearMonth(yearMonth)}
|
||||||
{maybeYear(yearMonth)}{" "}
|
{srOnlyYear(yearMonth)}{" "}
|
||||||
<span className={styles.eventCounter}>({eventCount})</span>
|
<span className={styles.eventCounter}>({eventCount})</span>
|
||||||
</h2>
|
</h2>
|
||||||
{eventCount === 0 && (
|
{eventCount === 0 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user