feat(katalog): puan türü ve kız/erkek sınıf sayfaları, akreditasyon rehberi (→ 2.4.0)
All checks were successful
Deploy / deploy (push) Successful in 13m53s
All checks were successful
Deploy / deploy (push) Successful in 13m53s
- /bolumler/{sayisal,esit-agirlik,sozel,dil,onlisans}: puan türüne göre bölümler
- /bolumler/{kiz-ogrenci,erkek-ogrenci}: ÖSYM koşul 31/33 taşıyan programlar
(program koşulu; adayın cinsiyeti sorulmaz, listesi süzülmez)
- Bölüm sayfası puan türü hapları, üniversite tablosu SAY/EA/SÖZ/DİL çipleri ve
çekmecedeki cinsiyet koşulu hapı sınıf sayfasına linkli
- Arama: "sayısal", "eşit ağırlık", "kız öğrenci" vb. sınıf sonucu; boşken
"Sınıflandır" çipleri
- content/rehber/akreditasyon-kisaltmalari.md: 36 kısaltma + YÖKAK, kod başına
çapa; çekmecedeki akreditasyon hapları ilgili bölüme linkli, tekrarlar ayrılır
- Sitemap'e sınıf sayfaları eklendi; rehber h3'lerine scroll-margin
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { puanTuruSinifHref } from "@/lib/bolum-sinifi";
|
||||
import { notFound } from "next/navigation";
|
||||
import {
|
||||
Armchair,
|
||||
@@ -193,6 +194,10 @@ const PUAN_TURU_HAP: Record<string, string> = {
|
||||
DİL: "Dil puanı",
|
||||
};
|
||||
|
||||
/** §4.12: link olan kimlik hapının hover/press hâli. */
|
||||
const HAP_LINK =
|
||||
"transition-[background-color,border-color,color,transform] duration-150 hover:border-orange-500 hover:bg-orange-50/60 hover:text-orange-500 active:scale-[0.97]";
|
||||
|
||||
export function bolumToplamSayfa(programSayisi: number): number {
|
||||
return Math.max(1, Math.ceil(programSayisi / SAYFA_BOYU));
|
||||
}
|
||||
@@ -396,9 +401,13 @@ export function BolumIcerik({ slug, sayfa }: { slug: string; sayfa: number }) {
|
||||
|
||||
// Kimlik hapları (DESIGN.md §4.12): düzey + lisans puan türleri. TYT
|
||||
// puanı önlisansın kendisi olduğundan ayrı hap açmaz.
|
||||
// Puan türü hapı o türün sınıf sayfasına linktir (/bolumler/sayisal …;
|
||||
// Bilal, 17 Eki 2026: "alanlar tıklanabilir olmalı"), §4.12 il hapı gibi.
|
||||
const puanTurleri = [
|
||||
...new Set(bolum.lisansProgramlari.map((p) => p.tur)),
|
||||
].flatMap((t) => (PUAN_TURU_HAP[t] ? [PUAN_TURU_HAP[t]] : []));
|
||||
].flatMap((t) =>
|
||||
PUAN_TURU_HAP[t] ? [{ etiket: PUAN_TURU_HAP[t], href: puanTuruSinifHref(t) }] : [],
|
||||
);
|
||||
const duzeyler = [
|
||||
...(bolum.lisansProgramlari.length > 0 ? ["Lisans"] : []),
|
||||
...(bolum.onlisansProgramlari.length > 0 ? ["Önlisans"] : []),
|
||||
@@ -507,12 +516,23 @@ export function BolumIcerik({ slug, sayfa }: { slug: string; sayfa: number }) {
|
||||
{d}
|
||||
</span>
|
||||
))}
|
||||
{puanTurleri.map((t) => (
|
||||
<span key={t} className={hapSinifi}>
|
||||
<Calculator className="size-4 text-primary" aria-hidden />
|
||||
{t}
|
||||
</span>
|
||||
))}
|
||||
{puanTurleri.map((t) =>
|
||||
t.href ? (
|
||||
<Link
|
||||
key={t.etiket}
|
||||
href={t.href}
|
||||
className={`${hapSinifi} ${HAP_LINK}`}
|
||||
>
|
||||
<Calculator className="size-4 text-primary" aria-hidden />
|
||||
{t.etiket}
|
||||
</Link>
|
||||
) : (
|
||||
<span key={t.etiket} className={hapSinifi}>
|
||||
<Calculator className="size-4 text-primary" aria-hidden />
|
||||
{t.etiket}
|
||||
</span>
|
||||
),
|
||||
)}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
|
||||
@@ -5,6 +5,13 @@ import { CtaSiraForm } from "@/features/sihirbaz/components/cta-sira-form";
|
||||
import { PagePixelDivider } from "@/components/pixel-decor";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { SON_YIL, TERCIH_YILI } from "@/lib/veri-yillari";
|
||||
import {
|
||||
CINSIYET_SINIFLARI,
|
||||
PUAN_SINIFLARI,
|
||||
bolumSinifiHref,
|
||||
type BolumSinifi,
|
||||
} from "@/lib/bolum-sinifi";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const sayi = (n: number) => n.toLocaleString("tr-TR");
|
||||
|
||||
@@ -28,7 +35,61 @@ function BolumLinkleri({ bolumler }: { bolumler: BolumOzet[] }) {
|
||||
);
|
||||
}
|
||||
|
||||
function KategoriGruplari({
|
||||
// §4.17 şehir çipi kalıbı: etkileşimli link çipi, bulunulan sınıf mavi dolu.
|
||||
const CIP =
|
||||
"inline-flex h-10 cursor-pointer items-center gap-1.5 rounded-full border px-3.5 text-sm font-semibold transition-[background-color,border-color,color,transform] duration-150 active:scale-[0.97]";
|
||||
const CIP_PASIF =
|
||||
"border-slate-200 bg-card text-slate-700 hover:border-orange-500 hover:bg-orange-50/60 hover:text-orange-500";
|
||||
const CIP_AKTIF = "border-primary bg-primary text-white";
|
||||
|
||||
function SinifCipSatiri({
|
||||
etiket,
|
||||
siniflar,
|
||||
aktif,
|
||||
}: {
|
||||
etiket: string;
|
||||
siniflar: readonly BolumSinifi[];
|
||||
aktif?: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="mr-1 text-sm font-semibold text-slate-500">{etiket}</span>
|
||||
{siniflar.map((s) => {
|
||||
const buSayfa = s.slug === aktif;
|
||||
return (
|
||||
<Link
|
||||
key={s.slug}
|
||||
href={bolumSinifiHref(s)}
|
||||
aria-current={buSayfa ? "page" : undefined}
|
||||
className={cn(CIP, buSayfa ? CIP_AKTIF : CIP_PASIF)}
|
||||
>
|
||||
{s.kisaAd}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bölüm sınıfı çipleri: puan türüne göre (Sayısal, Eşit ağırlık, Sözel, Dil,
|
||||
* Önlisans) ve programın öğrenci koşuluna göre (yalnız kız / yalnız erkek).
|
||||
* /bolumler'in üstünde ve her sınıf sayfasında durur; `aktif` bulunulan sınıf.
|
||||
*/
|
||||
export function BolumSinifCipleri({ aktif }: { aktif?: string }) {
|
||||
return (
|
||||
<nav aria-label="Bölümleri sınıflandır" className="space-y-3">
|
||||
<SinifCipSatiri etiket="Puan türü" siniflar={PUAN_SINIFLARI} aktif={aktif} />
|
||||
<SinifCipSatiri
|
||||
etiket="Öğrenci koşulu"
|
||||
siniflar={CINSIYET_SINIFLARI}
|
||||
aktif={aktif}
|
||||
/>
|
||||
</nav>
|
||||
);
|
||||
}
|
||||
|
||||
export function KategoriGruplari({
|
||||
bolumler,
|
||||
seviye,
|
||||
}: {
|
||||
@@ -89,6 +150,10 @@ export function BolumKatalogu() {
|
||||
{TERCIH_YILI} tercihleri için rehber niteliğindedir.
|
||||
</p>
|
||||
|
||||
<div className="mt-6">
|
||||
<BolumSinifCipleri />
|
||||
</div>
|
||||
|
||||
<PagePixelDivider seed={29} className="mt-8" />
|
||||
|
||||
<section className="mt-8">
|
||||
|
||||
@@ -104,12 +104,15 @@ export function BolumProgramListesi({
|
||||
bazAd,
|
||||
tabanYol,
|
||||
sayfa,
|
||||
istemciSayfalama = false,
|
||||
}: {
|
||||
/** Bölümün TÜM programları — sıralama liste geneline uygulanır. */
|
||||
programlar: BolumProgrami[];
|
||||
bazAd: string;
|
||||
tabanYol: string;
|
||||
sayfa: number;
|
||||
/** Statik /sayfa/N rotası olmayan listeler (bölüm sınıfı sayfası): hep istemcide sayfala. */
|
||||
istemciSayfalama?: boolean;
|
||||
}) {
|
||||
const [aktifAlan, setAktifAlan] = useState<SiralamaAlani | null>(null);
|
||||
const [yon, setYon] = useState<SiralamaYonu>("artan");
|
||||
@@ -135,7 +138,8 @@ export function BolumProgramListesi({
|
||||
});
|
||||
}, [aktifAlan, programlar, yon]);
|
||||
|
||||
const gosterilenSayfa = aktifAlan ? istemciSayfa : sayfa;
|
||||
const istemcide = istemciSayfalama || aktifAlan != null;
|
||||
const gosterilenSayfa = istemcide ? istemciSayfa : sayfa;
|
||||
const gosterilenProgramlar = useMemo(
|
||||
() =>
|
||||
siraliProgramlar.slice(
|
||||
@@ -313,7 +317,7 @@ export function BolumProgramListesi({
|
||||
tabanYol={tabanYol}
|
||||
sayfa={gosterilenSayfa}
|
||||
toplamSayfa={toplamSayfa}
|
||||
onSayfa={aktifAlan ? istemciSayfaDegistir : undefined}
|
||||
onSayfa={istemcide ? istemciSayfaDegistir : undefined}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -25,11 +25,17 @@ import {
|
||||
} from "@/features/liste/hooks/use-tercih-profili";
|
||||
import { preloadTercihProfiliKapisi } from "@/features/liste/components/tercih-profili-kapisi-lazy";
|
||||
import { PUAN_TURU_ETIKET } from "@/features/sihirbaz/sihirbaz-sabitler";
|
||||
import {
|
||||
BOLUM_SINIFLARI,
|
||||
bolumSinifiAra,
|
||||
bolumSinifiHref,
|
||||
} from "@/lib/bolum-sinifi";
|
||||
import { olay } from "@/lib/analitik";
|
||||
import {
|
||||
ArrowRight,
|
||||
BookOpenText,
|
||||
Building2,
|
||||
Calculator,
|
||||
GraduationCap,
|
||||
Search,
|
||||
SquarePen,
|
||||
@@ -164,7 +170,15 @@ export function KatalogArama({ rehberler }: { rehberler: RehberAramaKaydi[] }) {
|
||||
.map(({ yazi }) => yazi);
|
||||
}, [aramaAktif, temizSorgu, rehberler]);
|
||||
|
||||
// Bölüm sınıfları ("sayısal", "eşit ağırlık", "kız öğrenci" …): istemcide,
|
||||
// sabit listeden — sonuç beklemeden en üstte görünür (lib/bolum-sinifi.ts).
|
||||
const sinifSonuclari = useMemo(
|
||||
() => (aramaAktif ? bolumSinifiAra(aramaNormalize(temizSorgu)) : []),
|
||||
[aramaAktif, temizSorgu],
|
||||
);
|
||||
|
||||
const sonucVar =
|
||||
sinifSonuclari.length > 0 ||
|
||||
sonuclar.bolumler.length > 0 ||
|
||||
sonuclar.universiteler.length > 0 ||
|
||||
rehberSonuclari.length > 0;
|
||||
@@ -429,10 +443,32 @@ export function KatalogArama({ rehberler }: { rehberler: RehberAramaKaydi[] }) {
|
||||
>
|
||||
{!aramaAktif ? (
|
||||
<BaslangicIcerigi onSec={kapat} />
|
||||
) : yukleniyor ? (
|
||||
) : yukleniyor && sinifSonuclari.length === 0 ? (
|
||||
<AramaIskeleti />
|
||||
) : sonucVar ? (
|
||||
<div className="space-y-5">
|
||||
{sinifSonuclari.length > 0 ? (
|
||||
<SonucGrubu
|
||||
baslik="Bölüm sınıfları"
|
||||
ikon={<Calculator className="size-4" aria-hidden />}
|
||||
>
|
||||
{sinifSonuclari.map((sinif) => (
|
||||
<SonucLinki
|
||||
key={sinif.slug}
|
||||
href={bolumSinifiHref(sinif)}
|
||||
baslik={sinif.baslik}
|
||||
meta={
|
||||
sinif.tip === "puan"
|
||||
? "Puan türüne göre bölümler"
|
||||
: "Programın öğrenci koşulu (ÖSYM)"
|
||||
}
|
||||
detay="Hepsini gör"
|
||||
onSec={kapat}
|
||||
/>
|
||||
))}
|
||||
</SonucGrubu>
|
||||
) : null}
|
||||
{yukleniyor ? <AramaIskeleti /> : null}
|
||||
{sonuclar.bolumler.length > 0 ? (
|
||||
<SonucGrubu
|
||||
baslik="Bölümler"
|
||||
@@ -592,6 +628,21 @@ function BaslangicIcerigi({ onSec }: { onSec: () => void }) {
|
||||
onSec={onSec}
|
||||
/>
|
||||
</div>
|
||||
<p className="px-1 pb-2.5 pt-5 text-sm font-semibold text-slate-700">
|
||||
Sınıflandır
|
||||
</p>
|
||||
<div className="flex flex-wrap gap-2 px-1">
|
||||
{BOLUM_SINIFLARI.map((sinif) => (
|
||||
<Link
|
||||
key={sinif.slug}
|
||||
href={bolumSinifiHref(sinif)}
|
||||
onClick={onSec}
|
||||
className="inline-flex h-8 items-center rounded-full border border-slate-200 bg-card px-3 text-xs font-semibold text-slate-700 transition-[background-color,border-color,color,transform] duration-150 hover:border-orange-500 hover:bg-orange-50/60 hover:text-orange-500 active:scale-[0.97]"
|
||||
>
|
||||
{sinif.kisaAd}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
<div className="mt-5 flex gap-3 rounded-2xl bg-slate-50 px-3.5 py-3.5 sm:px-4">
|
||||
<span className="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-card text-slate-400 shadow-[0_0_0_1px_rgba(15,23,42,0.06)]">
|
||||
<Search className="size-3.5" aria-hidden />
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import { SATIR_BASLIK, SATIR_DUGME_BOYU } from "@/components/liste-satiri";
|
||||
import { useEffect, useRef, useState, type ReactNode } from "react";
|
||||
import Link from "next/link";
|
||||
import { LayoutGroup, MotionConfig, motion } from "motion/react";
|
||||
import {
|
||||
BadgeCheck,
|
||||
@@ -55,6 +56,12 @@ import {
|
||||
KONTENJAN_TURU_KIME,
|
||||
} from "@/lib/ozel-durum";
|
||||
import { trBaslikDuzeni } from "@/lib/slug";
|
||||
import { cinsiyetSinifHref } from "@/lib/bolum-sinifi";
|
||||
import {
|
||||
akreditasyonBul,
|
||||
akreditasyonHref,
|
||||
akreditasyonlariAyir,
|
||||
} from "@/lib/akreditasyon";
|
||||
import { UNITUR_ETIKET } from "@/lib/unitur";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { SON_YIL } from "@/lib/veri-yillari";
|
||||
@@ -125,6 +132,8 @@ const ondalik = (n: number) =>
|
||||
const HAP =
|
||||
"inline-flex h-10 items-center gap-2 rounded-full border border-slate-200 bg-card px-4 text-sm font-semibold text-slate-800";
|
||||
const HAP_IKON = "size-4 shrink-0 text-primary";
|
||||
const HAP_LINK =
|
||||
"transition-[background-color,border-color,color,transform] duration-150 hover:border-orange-500 hover:bg-orange-50/60 hover:text-orange-500 active:scale-[0.97]";
|
||||
const BOLUM_BASLIK = "mt-7 font-heading text-base font-bold text-slate-900";
|
||||
const NOT = "mt-2 text-sm leading-relaxed text-slate-500";
|
||||
|
||||
@@ -277,7 +286,15 @@ function AyrintiIcerik({ durum, veri }: { durum: Durum; veri: ProgramAyrintisi |
|
||||
|
||||
function Kunye({ veri }: { veri: ProgramAyrintisi }) {
|
||||
const o = veri.ozellik;
|
||||
const haplar: { ikon: typeof Languages; metin: string }[] = [];
|
||||
// `href`: hap bir sayfaya linktir (§4.12) — öğrenci koşulu sınıf sayfasına,
|
||||
// akreditasyon kısaltmasının açılımını anlatan rehber bölümüne gider.
|
||||
const haplar: {
|
||||
ikon: typeof Languages;
|
||||
metin: string;
|
||||
href?: string;
|
||||
/** Üzerine gelince görünen açıklama (akreditasyonun tam adı) */
|
||||
baslik?: string;
|
||||
}[] = [];
|
||||
const tur = veri.program.unitur ? UNITUR_ETIKET[veri.program.unitur]?.cip : null;
|
||||
if (veri.program.sure) {
|
||||
haplar.push({
|
||||
@@ -294,7 +311,15 @@ function Kunye({ veri }: { veri: ProgramAyrintisi }) {
|
||||
o.ucret != null && o.bursOrani !== "Burslu" ? ` · yıllık ${sayi(o.ucret)} TL` : "";
|
||||
haplar.push({ ikon: Wallet, metin: `${o.bursOrani}${ucret}` });
|
||||
}
|
||||
if (o?.akreditasyon) haplar.push({ ikon: BadgeCheck, metin: `${o.akreditasyon} akreditasyonlu` });
|
||||
// Her kuruluş ayrı hap; açılımı rehberdeki bölümünde (Bilal, 17 Eki 2026).
|
||||
for (const kod of akreditasyonlariAyir(o?.akreditasyon ?? null)) {
|
||||
haplar.push({
|
||||
ikon: BadgeCheck,
|
||||
metin: `${kod} akreditasyonlu`,
|
||||
href: akreditasyonHref(kod),
|
||||
baslik: akreditasyonBul(kod)?.ad,
|
||||
});
|
||||
}
|
||||
if (o?.minBasariSirasi != null) {
|
||||
haplar.push({ ikon: Flag, metin: `Baraj ${sayi(o.minBasariSirasi)}. sıra` });
|
||||
}
|
||||
@@ -302,18 +327,31 @@ function Kunye({ veri }: { veri: ProgramAyrintisi }) {
|
||||
if (uye != null) haplar.push({ ikon: GraduationCap, metin: `${sayi(uye)} öğretim üyesi` });
|
||||
if (o?.cinsiyetKosulu) {
|
||||
const m = CINSIYET_KOSULU_METNI[o.cinsiyetKosulu];
|
||||
haplar.push({ ikon: Users, metin: m.charAt(0).toLocaleUpperCase("tr-TR") + m.slice(1) });
|
||||
haplar.push({
|
||||
ikon: Users,
|
||||
metin: m.charAt(0).toLocaleUpperCase("tr-TR") + m.slice(1),
|
||||
href: cinsiyetSinifHref(o.cinsiyetKosulu),
|
||||
});
|
||||
}
|
||||
if (o?.ilce) haplar.push({ ikon: MapPin, metin: `${trBaslikDuzeni(o.ilce)} kampüsü` });
|
||||
if (haplar.length === 0) return null;
|
||||
return (
|
||||
<ul data-sonra className="flex flex-wrap justify-center gap-2">
|
||||
{haplar.map((h) => (
|
||||
<li key={h.metin} className={HAP}>
|
||||
<h.ikon className={HAP_IKON} aria-hidden />
|
||||
{h.metin}
|
||||
</li>
|
||||
))}
|
||||
{haplar.map((h) =>
|
||||
h.href ? (
|
||||
<li key={h.metin}>
|
||||
<Link href={h.href} title={h.baslik} className={cn(HAP, HAP_LINK)}>
|
||||
<h.ikon className={HAP_IKON} aria-hidden />
|
||||
{h.metin}
|
||||
</Link>
|
||||
</li>
|
||||
) : (
|
||||
<li key={h.metin} className={HAP}>
|
||||
<h.ikon className={HAP_IKON} aria-hidden />
|
||||
{h.metin}
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
|
||||
236
src/features/katalog/components/sinif-icerik.tsx
Normal file
236
src/features/katalog/components/sinif-icerik.tsx
Normal file
@@ -0,0 +1,236 @@
|
||||
import type { Metadata } from "next";
|
||||
import Link from "next/link";
|
||||
import { notFound } from "next/navigation";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import {
|
||||
getAllBolumler,
|
||||
getCinsiyetKosulluProgramlar,
|
||||
type BolumOzet,
|
||||
type CinsiyetKosulluProgram,
|
||||
} from "../katalog-queries";
|
||||
import { CtaSiraForm } from "@/features/sihirbaz/components/cta-sira-form";
|
||||
import { PagePixelDivider } from "@/components/pixel-decor";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import {
|
||||
JsonLd,
|
||||
breadcrumbJsonLd,
|
||||
sayfaMetadata,
|
||||
ustSegmentOgGorseli,
|
||||
} from "@/lib/seo";
|
||||
import {
|
||||
bolumSinifiBul,
|
||||
bolumSinifiHref,
|
||||
type CinsiyetSinifi,
|
||||
type PuanSinifi,
|
||||
} from "@/lib/bolum-sinifi";
|
||||
import { BASLIK_YILI, SON_YIL, TERCIH_YILI } from "@/lib/veri-yillari";
|
||||
import { BolumSinifCipleri, KategoriGruplari } from "./bolum-listesi";
|
||||
import { BolumProgramListesi } from "./bolum-program-listesi";
|
||||
|
||||
const sayi = (n: number) => n.toLocaleString("tr-TR");
|
||||
|
||||
/** Puan türü sınıfına giren bölümler; program sayısı yalnız o türdeki programlar. */
|
||||
function sinifBolumleri(s: PuanSinifi): BolumOzet[] {
|
||||
return getAllBolumler().flatMap((b) => {
|
||||
const adet = b.turSayilari[s.tur] ?? 0;
|
||||
return adet > 0 ? [{ ...b, programSayisi: adet }] : [];
|
||||
});
|
||||
}
|
||||
|
||||
/** Cinsiyet sınıfının programları bölüm bölüm, en kalabalık bölüm önde. */
|
||||
function cinsiyetGruplari(s: CinsiyetSinifi) {
|
||||
const programlar = getCinsiyetKosulluProgramlar(s.kosulKodu);
|
||||
const adlar = new Map(getAllBolumler().map((b) => [b.slug, b.ad]));
|
||||
const gruplar = new Map<
|
||||
string,
|
||||
{ slug: string | null; ad: string; programlar: CinsiyetKosulluProgram[] }
|
||||
>();
|
||||
for (const p of programlar) {
|
||||
const anahtar = p.bolumSlug ?? p.isim.trim();
|
||||
let g = gruplar.get(anahtar);
|
||||
if (!g) {
|
||||
g = {
|
||||
slug: p.bolumSlug,
|
||||
ad: (p.bolumSlug && adlar.get(p.bolumSlug)) || p.isim.trim(),
|
||||
programlar: [],
|
||||
};
|
||||
gruplar.set(anahtar, g);
|
||||
}
|
||||
g.programlar.push(p);
|
||||
}
|
||||
return {
|
||||
toplam: programlar.length,
|
||||
gruplar: [...gruplar.values()].sort(
|
||||
(a, b) =>
|
||||
b.programlar.length - a.programlar.length ||
|
||||
a.ad.localeCompare(b.ad, "tr-TR"),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
export function sinifSayfaMetadata(slug: string): Metadata {
|
||||
const s = bolumSinifiBul(slug);
|
||||
if (!s) return {};
|
||||
const aciklama =
|
||||
s.tip === "puan"
|
||||
? `${s.kisaAd} puan türüyle öğrenci alan ${sayi(sinifBolumleri(s).length)} bölümün ${SON_YIL} taban puanları ve başarı sıralamaları. ${s.aciklama}`
|
||||
: `${s.aciklama} ${sayi(cinsiyetGruplari(s).toplam)} programın ${SON_YIL} taban sıralaması ve kontenjanı; ${TERCIH_YILI} tercihleri için.`;
|
||||
return sayfaMetadata({
|
||||
title: `${s.baslik} ve Taban Sıralamaları ${BASLIK_YILI}`,
|
||||
description: aciklama,
|
||||
path: bolumSinifiHref(s),
|
||||
openGraph: {
|
||||
images: ustSegmentOgGorseli(
|
||||
"/bolumler",
|
||||
"Bölümlerin taban puanları ve sıralamaları — KolayTercih",
|
||||
),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* /bolumler/[sinif]: puan türüne göre bölümler (kategori kategori, /bolumler
|
||||
* ile aynı düzen) ya da yalnız kız / yalnız erkek öğrenci alan programlar
|
||||
* (bölüm bölüm program tablosu). Üstte sınıf çipleri, bulunulan sınıf dolu.
|
||||
*/
|
||||
export function SinifIcerik({ slug }: { slug: string }) {
|
||||
const s = bolumSinifiBul(slug);
|
||||
if (!s) notFound();
|
||||
const yol = bolumSinifiHref(s);
|
||||
|
||||
return (
|
||||
<main className="mx-auto w-full max-w-5xl px-4 py-12 sm:py-16">
|
||||
<JsonLd
|
||||
data={breadcrumbJsonLd([
|
||||
{ name: "Ana Sayfa", path: "/" },
|
||||
{ name: "Bölümler", path: "/bolumler" },
|
||||
{ name: s.baslik, path: yol },
|
||||
])}
|
||||
/>
|
||||
|
||||
<nav
|
||||
aria-label="İçerik yolu"
|
||||
className="flex flex-wrap items-center gap-1.5 text-sm text-slate-500"
|
||||
>
|
||||
<Link
|
||||
href="/"
|
||||
className="transition-colors hover:text-orange-500 hover:underline"
|
||||
>
|
||||
Ana Sayfa
|
||||
</Link>
|
||||
<ChevronRight className="size-3.5 shrink-0" aria-hidden />
|
||||
<Link
|
||||
href="/bolumler"
|
||||
className="transition-colors hover:text-orange-500 hover:underline"
|
||||
>
|
||||
Bölümler
|
||||
</Link>
|
||||
<ChevronRight className="size-3.5 shrink-0" aria-hidden />
|
||||
<span className="text-slate-700">{s.kisaAd}</span>
|
||||
</nav>
|
||||
|
||||
<h1 className="mt-6 font-heading text-3xl font-bold text-slate-900 sm:text-4xl">
|
||||
{s.baslik} ve Taban Sıralamaları {BASLIK_YILI}
|
||||
</h1>
|
||||
|
||||
{s.tip === "puan" ? <PuanGovdesi s={s} /> : <CinsiyetGovdesi s={s} />}
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
function PuanGovdesi({ s }: { s: PuanSinifi }) {
|
||||
const bolumler = sinifBolumleri(s);
|
||||
const toplamProgram = bolumler.reduce((a, b) => a + b.programSayisi, 0);
|
||||
return (
|
||||
<>
|
||||
<p className="mt-4 max-w-3xl text-sm leading-7 text-slate-600">
|
||||
{s.aciklama} Bu puan türüyle öğrenci alan {sayi(bolumler.length)}{" "}
|
||||
bölümde {sayi(toplamProgram)} program var. Bölüme tıklayınca o bölümü
|
||||
sunan üniversitelerin {SON_YIL} taban sıralamalarını görürsün.
|
||||
</p>
|
||||
|
||||
<div className="mt-6">
|
||||
<BolumSinifCipleri aktif={s.slug} />
|
||||
</div>
|
||||
|
||||
<PagePixelDivider seed={29} className="mt-8" />
|
||||
|
||||
<KategoriGruplari
|
||||
bolumler={bolumler}
|
||||
seviye={s.tur === "TYT" ? "onlisans" : "lisans"}
|
||||
/>
|
||||
|
||||
<div className="mt-12">
|
||||
<CtaSiraForm />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function CinsiyetGovdesi({ s }: { s: CinsiyetSinifi }) {
|
||||
const { toplam, gruplar } = cinsiyetGruplari(s);
|
||||
return (
|
||||
<>
|
||||
<p className="mt-4 max-w-3xl text-sm leading-7 text-slate-600">
|
||||
{s.aciklama} {SON_YIL} kılavuzunda {sayi(toplam)} program bu koşulu
|
||||
taşıyor; aşağıda bölüm bölüm, taban sırasına göre dizili. Bu bir
|
||||
program koşuludur: KolayTercih senin cinsiyetini sormaz, listeni de
|
||||
buna göre süzmez.
|
||||
</p>
|
||||
|
||||
<div className="mt-6">
|
||||
<BolumSinifCipleri aktif={s.slug} />
|
||||
</div>
|
||||
|
||||
<PagePixelDivider seed={29} className="mt-8" />
|
||||
|
||||
{gruplar.map((g) => (
|
||||
<section key={g.slug ?? g.ad} className="mt-10">
|
||||
<h2 className="font-heading text-2xl font-bold text-slate-900">
|
||||
{g.slug ? (
|
||||
<Link
|
||||
href={`/bolum/${g.slug}`}
|
||||
className="transition-colors hover:text-orange-500 hover:underline"
|
||||
>
|
||||
{g.ad}
|
||||
</Link>
|
||||
) : (
|
||||
g.ad
|
||||
)}
|
||||
<span className="ml-2 text-sm font-normal text-slate-400">
|
||||
{sayi(g.programlar.length)} program
|
||||
</span>
|
||||
</h2>
|
||||
<div className="mt-4">
|
||||
<BolumProgramListesi
|
||||
programlar={g.programlar}
|
||||
bazAd={g.ad}
|
||||
tabanYol={bolumSinifiHref(s)}
|
||||
sayfa={1}
|
||||
istemciSayfalama
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
))}
|
||||
|
||||
<div className="mt-12">
|
||||
<CtaSiraForm />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export function SinifIcerikSkeleton() {
|
||||
return (
|
||||
<main className="mx-auto w-full max-w-5xl px-4 py-12 sm:py-16">
|
||||
<Skeleton className="h-5 w-48" />
|
||||
<Skeleton className="mt-6 h-10 w-full max-w-xl" />
|
||||
<Skeleton className="mt-4 h-5 w-full max-w-3xl" />
|
||||
<div className="mt-8 space-y-4">
|
||||
{Array.from({ length: 4 }, (_, i) => (
|
||||
<Skeleton key={i} className="h-6 w-full max-w-2xl" />
|
||||
))}
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
import Link from "next/link";
|
||||
import type { Program } from "@/types/yokatlas";
|
||||
import { SON_YIL, VERI_YIL_SAYISI } from "@/lib/veri-yillari";
|
||||
import { puanTuruSinifHref } from "@/lib/bolum-sinifi";
|
||||
import { cn } from "@/lib/utils";
|
||||
import {
|
||||
ProgramSiraGecmisi,
|
||||
ProgramTabanTrendi,
|
||||
@@ -42,6 +44,14 @@ const TUR_ETIKET: Record<string, string> = {
|
||||
TYT: "TYT",
|
||||
};
|
||||
|
||||
const PUAN_TURU_UZUN: Record<string, string> = {
|
||||
SAYISAL: "sayısal",
|
||||
"EŞİT AĞIRLIK": "eşit ağırlık",
|
||||
SÖZEL: "sözel",
|
||||
DİL: "dil",
|
||||
TYT: "önlisans",
|
||||
};
|
||||
|
||||
export type UniProgramSatiri = Program & { bolumSlug: string | null };
|
||||
|
||||
export function UniversiteProgramTablosu({
|
||||
@@ -104,9 +114,23 @@ export function UniversiteProgramTablosu({
|
||||
</span>
|
||||
)}
|
||||
<span className={SATIR_META}>
|
||||
<span className={SATIR_CIP}>
|
||||
{TUR_ETIKET[p.tur] ?? p.tur}
|
||||
</span>
|
||||
{/* Puan türü çipi sınıf sayfasına linktir (TurCipi gibi) */}
|
||||
{puanTuruSinifHref(p.tur) ? (
|
||||
<Link
|
||||
href={puanTuruSinifHref(p.tur)!}
|
||||
title={`Tüm ${PUAN_TURU_UZUN[p.tur] ?? p.tur} bölümleri`}
|
||||
className={cn(
|
||||
SATIR_CIP,
|
||||
"transition-colors hover:bg-orange-50/60 hover:text-orange-500",
|
||||
)}
|
||||
>
|
||||
{TUR_ETIKET[p.tur] ?? p.tur}
|
||||
</Link>
|
||||
) : (
|
||||
<span className={SATIR_CIP}>
|
||||
{TUR_ETIKET[p.tur] ?? p.tur}
|
||||
</span>
|
||||
)}
|
||||
{/* Burs/dil/öğretim türü: aynı adlı satırları ayırt eder (§4.15 çip) */}
|
||||
{p.varyant ? (
|
||||
<span className={SATIR_CIP}>{p.varyant}</span>
|
||||
|
||||
@@ -11,11 +11,13 @@ export {
|
||||
getAllIller,
|
||||
getAllIlSlugs,
|
||||
getBolumBySlug,
|
||||
getCinsiyetKosulluProgramlar,
|
||||
getIlBySlug,
|
||||
getUniversiteBySlug,
|
||||
uniSlugFromAd,
|
||||
bolumSlugFromIsim,
|
||||
type BolumOzet,
|
||||
type CinsiyetKosulluProgram,
|
||||
type IlOzet,
|
||||
type UniOzet,
|
||||
} from "@/lib/katalog";
|
||||
|
||||
@@ -86,7 +86,7 @@ export function RehberMakale({ slug }: { slug: string }) {
|
||||
<div
|
||||
className="mt-8 text-[15px] leading-7 text-slate-700
|
||||
[&_h2]:mt-10 [&_h2]:font-heading [&_h2]:text-xl [&_h2]:font-bold [&_h2]:text-slate-900
|
||||
[&_h3]:mt-6 [&_h3]:font-heading [&_h3]:text-base [&_h3]:font-bold [&_h3]:text-slate-900
|
||||
[&_h3]:mt-6 [&_h3]:scroll-mt-28 [&_h3]:font-heading [&_h3]:text-base [&_h3]:font-bold [&_h3]:text-slate-900
|
||||
[&_p]:mt-3
|
||||
[&_a]:font-medium [&_a]:text-primary hover:[&_a]:underline
|
||||
[&_strong]:font-semibold [&_strong]:text-slate-900
|
||||
|
||||
Reference in New Issue
Block a user