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]
|
||||
line-length = 99
|
||||
exclude = ["**/migrations/*.py"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["F", "E", "W", "Q", "UP", "DJ"]
|
||||
ignore = []
|
||||
exclude = ["**/migrations/*.py"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
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 now = new Date();
|
||||
const isCurrentYear = yearMonth.getFullYear() == now.getFullYear();
|
||||
if (isCurrentYear) {
|
||||
return <span className="sr-only"> {yearMonth.getFullYear()}</span>;
|
||||
const isCurrentYear = yearMonth.getFullYear() === new Date().getFullYear();
|
||||
if (!isCurrentYear) {
|
||||
return null;
|
||||
}
|
||||
return ` ${yearMonth.getFullYear()}`;
|
||||
return <span className="sr-only"> {yearMonth.getFullYear()}</span>;
|
||||
}
|
||||
|
||||
const EventCalendar = ({ events }: { events: EventOverviewItemFragment[] }) => {
|
||||
@@ -354,7 +354,7 @@ const EventCalendar = ({ events }: { events: EventOverviewItemFragment[] }) => {
|
||||
>
|
||||
<h2 onClick={() => toggleYearMonth(yearMonth)}>
|
||||
{formatYearMonth(yearMonth)}
|
||||
{maybeYear(yearMonth)}{" "}
|
||||
{srOnlyYear(yearMonth)}{" "}
|
||||
<span className={styles.eventCounter}>({eventCount})</span>
|
||||
</h2>
|
||||
{eventCount === 0 && (
|
||||
|
||||
Reference in New Issue
Block a user