diff --git a/apps/web/i18n b/apps/web/i18n index 11e2f335..03f59b9d 160000 --- a/apps/web/i18n +++ b/apps/web/i18n @@ -1 +1 @@ -Subproject commit 11e2f335ef22765c8e5822caf9a2f646f8f0136c +Subproject commit 03f59b9de6fc35ebdace993bdf34471900613d65 diff --git a/apps/web/public/images/academe/bg-academic.png b/apps/web/public/images/academe/bg-academic.png new file mode 100644 index 00000000..1816776f Binary files /dev/null and b/apps/web/public/images/academe/bg-academic.png differ diff --git a/apps/web/public/images/academe/bg-banner@2x.jpg b/apps/web/public/images/academe/bg-banner@2x.jpg new file mode 100644 index 00000000..3c694294 Binary files /dev/null and b/apps/web/public/images/academe/bg-banner@2x.jpg differ diff --git a/apps/web/public/images/academe/case/nju.png b/apps/web/public/images/academe/case/nju.png new file mode 100644 index 00000000..d12b6753 Binary files /dev/null and b/apps/web/public/images/academe/case/nju.png differ diff --git a/apps/web/public/images/academe/case/openeuler.mp4 b/apps/web/public/images/academe/case/openeuler.mp4 new file mode 100644 index 00000000..a6cef023 Binary files /dev/null and b/apps/web/public/images/academe/case/openeuler.mp4 differ diff --git a/apps/web/public/images/academe/case/pku1_en.png b/apps/web/public/images/academe/case/pku1_en.png new file mode 100644 index 00000000..40219f61 Binary files /dev/null and b/apps/web/public/images/academe/case/pku1_en.png differ diff --git a/apps/web/public/images/academe/case/pku1_zh.png b/apps/web/public/images/academe/case/pku1_zh.png new file mode 100644 index 00000000..42263334 Binary files /dev/null and b/apps/web/public/images/academe/case/pku1_zh.png differ diff --git a/apps/web/public/images/academe/case/pku2_en.png b/apps/web/public/images/academe/case/pku2_en.png new file mode 100644 index 00000000..a10d1cb9 Binary files /dev/null and b/apps/web/public/images/academe/case/pku2_en.png differ diff --git a/apps/web/public/images/academe/case/pku2_zh.png b/apps/web/public/images/academe/case/pku2_zh.png new file mode 100644 index 00000000..002f3f4d Binary files /dev/null and b/apps/web/public/images/academe/case/pku2_zh.png differ diff --git a/apps/web/public/images/academe/case/pku3_en.png b/apps/web/public/images/academe/case/pku3_en.png new file mode 100644 index 00000000..73ee5fc4 Binary files /dev/null and b/apps/web/public/images/academe/case/pku3_en.png differ diff --git a/apps/web/public/images/academe/case/pku3_zh.png b/apps/web/public/images/academe/case/pku3_zh.png new file mode 100644 index 00000000..6cd1ff54 Binary files /dev/null and b/apps/web/public/images/academe/case/pku3_zh.png differ diff --git a/apps/web/public/images/academe/icon-academic@2x.png b/apps/web/public/images/academe/icon-academic@2x.png new file mode 100644 index 00000000..1fa08619 Binary files /dev/null and b/apps/web/public/images/academe/icon-academic@2x.png differ diff --git a/apps/web/public/images/academe/icon-step-1.svg b/apps/web/public/images/academe/icon-step-1.svg new file mode 100644 index 00000000..52e3d2ee --- /dev/null +++ b/apps/web/public/images/academe/icon-step-1.svg @@ -0,0 +1,24 @@ + + + icon-step-1 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/public/images/academe/icon-steps.svg b/apps/web/public/images/academe/icon-steps.svg new file mode 100644 index 00000000..51c4b538 --- /dev/null +++ b/apps/web/public/images/academe/icon-steps.svg @@ -0,0 +1,13 @@ + + + icon-steps + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/public/images/academe/logo-chaoss@2x.png b/apps/web/public/images/academe/logo-chaoss@2x.png new file mode 100644 index 00000000..95ae126b Binary files /dev/null and b/apps/web/public/images/academe/logo-chaoss@2x.png differ diff --git a/apps/web/public/images/academe/logo-nju@2x.png b/apps/web/public/images/academe/logo-nju@2x.png new file mode 100644 index 00000000..eb769d14 Binary files /dev/null and b/apps/web/public/images/academe/logo-nju@2x.png differ diff --git a/apps/web/public/images/academe/logo-nytu@2x.png b/apps/web/public/images/academe/logo-nytu@2x.png new file mode 100644 index 00000000..88f98104 Binary files /dev/null and b/apps/web/public/images/academe/logo-nytu@2x.png differ diff --git a/apps/web/public/images/academe/logo-pku@2x.png b/apps/web/public/images/academe/logo-pku@2x.png new file mode 100644 index 00000000..ffa43aec Binary files /dev/null and b/apps/web/public/images/academe/logo-pku@2x.png differ diff --git a/apps/web/public/images/academe/openeuler.svg b/apps/web/public/images/academe/openeuler.svg new file mode 100644 index 00000000..291baca7 --- /dev/null +++ b/apps/web/public/images/academe/openeuler.svg @@ -0,0 +1,29 @@ + + + 切片 + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/web/src/common/components/Header/index.tsx b/apps/web/src/common/components/Header/index.tsx index ec3f7381..12eed86f 100644 --- a/apps/web/src/common/components/Header/index.tsx +++ b/apps/web/src/common/components/Header/index.tsx @@ -53,7 +53,12 @@ const Header: React.FC<{ > {t('common:header.lab')} - + + {t('common:header.academe')} + diff --git a/apps/web/src/modules/academe/CooperationCase.tsx b/apps/web/src/modules/academe/CooperationCase.tsx new file mode 100644 index 00000000..ea925b0b --- /dev/null +++ b/apps/web/src/modules/academe/CooperationCase.tsx @@ -0,0 +1,234 @@ +import React, { useState } from 'react'; +import classnames from 'classnames'; +import { useTranslation } from 'next-i18next'; +import Image from 'next/image'; +import { Progress } from 'antd'; +import Dialog, { Transition } from '@common/components/Dialog'; +import Input from '@common/components/Input'; +import { GrClose } from 'react-icons/gr'; + +const p = () => { + ; +}; +const CooperationProcess = () => { + const { t, i18n } = useTranslation(); + const caseList = [ + { + name: 'nju', + url: '/images/academe/logo-nju@2x.png', + title: t('academe:nju_title'), + desc: t('academe:nju_desc'), + content: ( + + ), + }, + { + name: 'pku1', + url: '/images/academe/logo-pku@2x.png', + title: t('academe:pku1_title'), + desc: ( +
    +
  • {t('academe:pku1_desc1')}
  • +
  • {t('academe:pku1_desc2')}
  • +
+ ), + content: + i18n.language === 'en' ? ( + + ) : ( + + ), + }, + { + name: 'openeuler', + url: '/images/academe/openeuler.svg', + title: t('academe:openeuler_title'), + desc: t('academe:openeuler_desc'), + content: ( +
+ +
+ ), + }, + { + name: 'pku2', + url: '/images/academe/logo-pku@2x.png', + title: t('academe:pku2_title'), + desc: ( +
    +
  • {t('academe:pku2_desc1')}
  • +
  • {t('academe:pku2_desc2')}
  • +
+ ), + content: + i18n.language === 'en' ? ( + + ) : ( + + ), + }, + { + name: 'pku3', + url: '/images/academe/logo-pku@2x.png', + title: t('academe:pku3_title'), + desc: ( +
    +
  • {t('academe:pku3_desc1')}
  • +
  • {t('academe:pku3_desc2')}
  • +
+ ), + content: + i18n.language === 'en' ? ( + + ) : ( + + ), + }, + ]; + + const [active, setActive] = useState('nju'); + const [open, setOpen] = useState(false); + const activeCase = caseList.find((item) => item.name === active); + const [content, setContent] = useState(''); + + const dialogContent = ( + <> +
{ + setOpen(false); + }} + > + +
+
+ {''} +
+
+
{activeCase.title}
+
+
+
{activeCase.desc}
+
{activeCase.content}
+
+
+
效果体验
+
请输入内容
+ +
{}} + className="mt-4 flex h-8 w-16 cursor-pointer items-center justify-center bg-[#000000] px-3 text-sm text-white hover:bg-black/90" + > + 计算 +
+
+
+
+ + ); + + return ( + <> +
+ {t('academe:cooperation_case')} +
+
+ {caseList.map((item, index) => { + return ( +
{ + setActive(item.name); + }} + className={classnames( + 'flex h-[56px] w-[300px] cursor-pointer items-center justify-center border border-l-0 border-[#CFCFCF] bg-[#f7f7f7]', + { '!border-l ': index === 0, '!bg-white': active === item.name } + )} + > + {''} +
+ ); + })} +
+
+
+
{activeCase.title}
+
{activeCase.desc}
+
{ + setOpen(true); + }} + className="mt-4 flex h-8 w-48 cursor-pointer items-center justify-center bg-[#000000] px-3 text-sm text-white hover:bg-black/90" + > + {t('academe:experience_immediately')} +
+
+
{activeCase.content}
+
+ { + setOpen(false); + }} + /> + + ); +}; + +export default CooperationProcess; diff --git a/apps/web/src/modules/academe/CooperationProcess.tsx b/apps/web/src/modules/academe/CooperationProcess.tsx new file mode 100644 index 00000000..492c9961 --- /dev/null +++ b/apps/web/src/modules/academe/CooperationProcess.tsx @@ -0,0 +1,142 @@ +import React, { useState } from 'react'; +import classnames from 'classnames'; +import { useTranslation } from 'next-i18next'; +import Image from 'next/image'; + +const CooperationProcess = () => { + const { t } = useTranslation(); + const submit = ( + <> +

{t('academe:submit_application_desc1')}

+

{t('academe:submit_application_desc2')}

+
    +
  • + {t('academe:submit_application_desc3')} +
  • +
  • + {t('academe:submit_application_desc4')} +
  • +
  • + {t('academe:submit_application_desc5')} +
  • +
  • + {t('academe:submit_application_desc6')} +
  • +
+

{t('academe:submit_application_desc7')}

+ + ); + const release = ( + <> +

{t('academe:release_desc1')}

+
    +
  • {t('academe:release_desc2')}
  • +
  • {t('academe:release_desc3')}
  • +
+ + ); + const processList = [ + { + name: 'submit', + title: t('academe:submit_application'), + url: '/images/academe/logo-nju@2x.png', + desc: submit, + }, + { + name: 'affirm', + title: t('academe:affirm'), + url: '/images/academe/logo-pku@2x.png', + desc: t('academe:affirm_desc'), + }, + { + name: 'research', + title: t('academe:conduct_joint_research'), + url: '/images/academe/openeuler.svg', + desc: t('academe:conduct_joint_research_desc'), + }, + { + name: 'verify', + title: t('academe:experiment_verify'), + url: '/images/academe/logo-pku@2x.png', + desc: t('academe:verify_desc'), + }, + { + name: 'release', + title: t('academe:release_results'), + url: '/images/academe/logo-pku@2x.png', + desc: release, + }, + ]; + const [active, setActive] = useState('submit'); + const activeProcess = processList.find((item) => item.name === active); + return ( + <> +
+ {t('academe:cooperation_process')} +
+
+
+ {processList.map((item, index) => { + return ( + <> +
{ + setActive(item.name); + }} + className={classnames( + 'flex h-[40px] w-full cursor-pointer items-center justify-center rounded-full border border-dashed border-[#82BA41] bg-[#ecfbdc] text-sm font-semibold text-[#4A711C]', + { + '!bg-[#3EB93E] text-[#FFFFFF]': active === item.name, + } + )} + > + {item.title} +
+ {index !== processList.length - 1 && ( +
+
+
+
+
+
+ )} + + ); + })} +
+
+
+ {''} + {activeProcess.title} +
+
{activeProcess.desc}
+
+ {''} +
+
+
+ + ); +}; + +export default CooperationProcess; diff --git a/apps/web/src/modules/academe/SubmitApplication.tsx b/apps/web/src/modules/academe/SubmitApplication.tsx new file mode 100644 index 00000000..be18966f --- /dev/null +++ b/apps/web/src/modules/academe/SubmitApplication.tsx @@ -0,0 +1,35 @@ +import React, { useState } from 'react'; +import { useTranslation } from 'next-i18next'; +import classnames from 'classnames'; + +const SubmitApplication = () => { + const { t } = useTranslation(); + const bg = { + backgroundImage: "url('/images/academe/bg-banner@2x.jpg')", + backgroundSize: '100% 100%', + }; + return ( + <> +
+
+ {t('academe:discuss_the_evolution')} +
+
{ + // router.push('/lab/model/create'); + }} + > + {t('academe:submit_your_application_now')} +
+
+ + ); +}; + +export default SubmitApplication; diff --git a/apps/web/src/modules/academe/components/Banner/index.module.css b/apps/web/src/modules/academe/components/Banner/index.module.css new file mode 100644 index 00000000..a9a84904 --- /dev/null +++ b/apps/web/src/modules/academe/components/Banner/index.module.css @@ -0,0 +1,14 @@ +.headerBgLine { + background-image: url('/images/academe/bg-academic.png'); + background-repeat: repeat; + background-size: 89px 57px; +} +.headerBgGraph { + background-image: url('/images/academe/icon-academic@2x.png'); + background-repeat: no-repeat; + background-size: 100% 100%; +} +.headerdsc { + line-height: 1.38rem; + margin-top: 0.94rem; +} diff --git a/apps/web/src/modules/academe/components/Banner/index.tsx b/apps/web/src/modules/academe/components/Banner/index.tsx new file mode 100644 index 00000000..f84c3634 --- /dev/null +++ b/apps/web/src/modules/academe/components/Banner/index.tsx @@ -0,0 +1,55 @@ +import React from 'react'; +import { useRouter } from 'next/router'; +import classnames from 'classnames'; +import { useTranslation } from 'next-i18next'; + +import style from './index.module.css'; + +const Banner = () => { + const { t } = useTranslation(); + const router = useRouter(); + return ( +
+
+ +
+
+ {t('academe:academic_research_cooperation')} +
+
+ {t('academe:academic_research_desc')} +
+
+
{ + // router.push('/lab/model/create'); + }} + > + {t('academe:submit_your_application_now')} +
+
+
+
+ ); +}; + +export default Banner; diff --git a/apps/web/src/modules/academe/index.tsx b/apps/web/src/modules/academe/index.tsx new file mode 100644 index 00000000..98746308 --- /dev/null +++ b/apps/web/src/modules/academe/index.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import Header from '@common/components/Header'; +import Banner from '@modules/academe/components/Banner'; +import CooperationCase from './CooperationCase'; +import CooperationProcess from './CooperationProcess'; +import SubmitApplication from './SubmitApplication'; + +const Explore = () => { + return ( + <> +
+
+ +
+ + + +
+
+ + ); +}; + +export default Explore; diff --git a/apps/web/src/modules/home/LatestNews/DatePicker.tsx b/apps/web/src/modules/home/LatestNews/DatePicker.tsx index 98ca084d..0e9226cf 100644 --- a/apps/web/src/modules/home/LatestNews/DatePicker.tsx +++ b/apps/web/src/modules/home/LatestNews/DatePicker.tsx @@ -1,10 +1,32 @@ -import React, { useEffect, useRef, useState } from 'react'; +import React, { useRef, useState } from 'react'; import { DayClickEventHandler, DayPicker } from 'react-day-picker'; import { enGB, zhCN } from 'date-fns/locale'; import 'react-day-picker/dist/style.css'; import { useTranslation } from 'react-i18next'; import Popper from '@mui/material/Popper'; import { useClickAway } from 'react-use'; +import { format } from 'date-fns'; + +const eventList = [ + { + titleCn: 'OSS-Compass 技术研讨周会; 腾讯会议号:513-5733-3878', + titleEn: + 'OSS-Compass Technical Seminar Weekly Meeting; Tencent Conference No.:513-5733-3878 ', + time: '14:15 - 15:15 (UTC+8)', + }, + { + titleCn: 'Compass Talk——Open Source Summit Europe 2023', + titleEn: 'Compass Talk——Open Source Summit Europe 2023', + time: '11:00 - 11:40 (UTC+2)', + key: '2023-08-23', + }, + { + titleCn: 'OSS Compass社区2023年会及晚宴', + titleEn: 'OSS Compass Community 2023 Annual Meeting and Dinner', + time: '13:00 - 18:00 (UTC+8)', + key: '2023-12-13', + }, +]; const DatePicker = () => { const { t, i18n } = useTranslation(); @@ -13,9 +35,14 @@ const DatePicker = () => { const [anchorEl, setAnchorEl] = useState(null); const popoverRef = useRef(null); - const bookedDays = [new Date(2023, 8, 21)]; + const bookedDays = [ + (date) => { + return date.getDay() === 2 || date.getDay() === 4; + }, + new Date(2023, 7, 23), + new Date(2023, 11, 13), + ]; const bookedStyle = { border: '2px solid #3A5BEF', borderRadius: 'none' }; - useClickAway(popoverRef, () => { setOpen(false); }); @@ -25,6 +52,13 @@ const DatePicker = () => { setOpen(true); } }; + const selectEvent = eventList.filter(({ key }, index) => { + if (index === 0) { + return selected?.getDay() === 2 || selected?.getDay() === 4; + } else { + return selected && format(selected, 'yyyy-MM-dd') === key; + } + }); return ( <> { ]} >
-
-
- Compass Talk——Open Source Summit Europe 2023 -
- 11:00 - 11:40 (UTC+2) -
-
+ {selectEvent.map((item) => { + return ( +
+
+
+ {i18n.language === 'en' ? item.titleEn : item.titleCn} +
+ {item.time} +
+
+
+ ); + })}
{ + return { + props: { + ...(await getLocalesFile(req.cookies, ['academe'])), + }, + }; +}; + +const AcademePage = () => { + return ( + <> + + + ); +}; + +export default AcademePage; diff --git a/packages/graphql/src/gql/query.graphql b/packages/graphql/src/gql/query.graphql index 92ade1e6..e3a2c40c 100644 --- a/packages/graphql/src/gql/query.graphql +++ b/packages/graphql/src/gql/query.graphql @@ -101,7 +101,7 @@ query communityRepos($label: String!, $page: Int, $per: Int, $type: String) { query metric( $label: String! - $level: String = "repo" + $level: String = repo $start: ISO8601DateTime $end: ISO8601DateTime $repoType: String @@ -424,7 +424,7 @@ query summary($start: ISO8601DateTime, $end: ISO8601DateTime) { # query labMetric( # $label: String! -# $level: String = "repo" +# $level: String = repo # $start: ISO8601DateTime # $end: ISO8601DateTime # ) { @@ -507,7 +507,7 @@ query bulkOverview($labels: [String!]!) { } } -query trending($level: String = "repo") { +query trending($level: String = repo) { trending(level: $level) { activityScore collections @@ -558,7 +558,7 @@ query bulkShortenedLabel($labels: [LabelRowInput!]!) { } query metricDashboard( $label: String! - $level: String = "repo" + $level: String = repo $beginDate: ISO8601DateTime $endDate: ISO8601DateTime ) { @@ -612,7 +612,7 @@ query metricDashboard( } query contributorsDetailList( $label: String! - $level: String = "repo" + $level: String = repo $page: Int $per: Int $filterOpts: [FilterOptionInput!] @@ -651,7 +651,7 @@ query contributorsDetailList( query ecoContributorsOverview( $label: String! - $level: String = "repo" + $level: String = repo $filterOpts: [FilterOptionInput!] $beginDate: ISO8601DateTime $endDate: ISO8601DateTime @@ -677,7 +677,7 @@ query ecoContributorsOverview( } query orgContributionDistribution( $label: String! - $level: String = "repo" + $level: String = repo $filterOpts: [FilterOptionInput!] $beginDate: ISO8601DateTime $endDate: ISO8601DateTime @@ -703,7 +703,7 @@ query orgContributionDistribution( } query orgContributorsOverview( $label: String! - $level: String = "repo" + $level: String = repo $filterOpts: [FilterOptionInput!] $beginDate: ISO8601DateTime $endDate: ISO8601DateTime @@ -728,7 +728,7 @@ query orgContributorsOverview( } query contributorsOverview( $label: String! - $level: String = "repo" + $level: String = repo $filterOpts: [FilterOptionInput!] $beginDate: ISO8601DateTime $endDate: ISO8601DateTime @@ -755,7 +755,7 @@ query contributorsOverview( query issuesDetailList( $label: String! - $level: String = "repo" + $level: String = repo $page: Int $per: Int $filterOpts: [FilterOptionInput!] @@ -795,7 +795,7 @@ query issuesDetailList( } query issueCompletion( $label: String! - $level: String = "repo" + $level: String = repo $beginDate: ISO8601DateTime $endDate: ISO8601DateTime ) { @@ -815,7 +815,7 @@ query issueCompletion( } query issueComment( $label: String! - $level: String = "repo" + $level: String = repo $beginDate: ISO8601DateTime $endDate: ISO8601DateTime ) { @@ -835,7 +835,7 @@ query issueComment( } query pullsDetailList( $label: String! - $level: String = "repo" + $level: String = repo $page: Int $per: Int $filterOpts: [FilterOptionInput!] @@ -876,7 +876,7 @@ query pullsDetailList( } query pullsCompletion( $label: String! - $level: String = "repo" + $level: String = repo $beginDate: ISO8601DateTime $endDate: ISO8601DateTime ) { @@ -896,7 +896,7 @@ query pullsCompletion( } query pullsComment( $label: String! - $level: String = "repo" + $level: String = repo $beginDate: ISO8601DateTime $endDate: ISO8601DateTime ) { @@ -934,7 +934,7 @@ query verifyDetailDataRange( query metricModelsOverview( $label: String! - $level: String = "repo" + $level: String = repo $repoType: String ) { metricModelsOverview(label: $label, level: $level, repoType: $repoType) { @@ -950,3 +950,64 @@ query metricModelsOverview( updatedAt } } + +# metricDomainPersona( +# label: $label +# level: $level +# beginDate: $start +# endDate: $end +# repoType: $repoType +# ) { +# activity_observation_contributor_count +# activity_observation_contribution_per_person +# activity_code_contributor_count +# activity_code_contribution_per_person +# activity_issue_contributor_count +# activity_issue_contribution_per_person +# domainPersonaScore +# grimoireCreationDate +# label +# level +# shortCode +# type +# } + +# metricMilestonePersona( +# label: $label +# level: $level +# beginDate: $start +# endDate: $end +# repoType: $repoType +# ) { +# activity_casual_contributor_count +# activity_casual_contribution_per_person +# activity_regular_contributor_count +# activity_regular_contribution_per_person +# activity_core_contributor_count +# activity_core_contribution_per_person +# MilestonePersonaScore +# grimoireCreationDate +# label +# level +# shortCode +# type +# } + +# metricRolePersona( +# label: $label +# level: $level +# beginDate: $start +# endDate: $end +# repoType: $repoType +# ) { +# activity_organization_contributor_count +# activity_organization_contribution_per_person +# activity_individual_contributor_count +# activity_individual_contribution_per_person +# RolePersonaScore +# grimoireCreationDate +# label +# level +# shortCode +# type +# }