diff --git a/app/webpacker/components/CompetitionTabs/GeneralInfoTab.jsx b/app/webpacker/components/CompetitionTabs/GeneralInfoTab.jsx index 01227ca56a..d2d67ee089 100644 --- a/app/webpacker/components/CompetitionTabs/GeneralInfoTab.jsx +++ b/app/webpacker/components/CompetitionTabs/GeneralInfoTab.jsx @@ -204,143 +204,160 @@ export default function GeneralInfoTab({ -
-
{I18n.t('competitions.competition_info.information')}
-
- -
-
+ + + +
{I18n.t('competitions.competition_info.information')}
+
+ + + +
-
-
{I18n.t('competitions.competition_info.events')}
-
- {competition.events.map((event) => ( - - - - ))} -
+ + +
{I18n.t('competitions.competition_info.events')}
+
+ + {competition.events.map((event) => ( + + + + ))} + +
{competition.main_event_id && ( - <> -
{I18n.t('competitions.competition_info.main_event')}
-
- -
- + + +
{I18n.t('competitions.competition_info.main_event')}
+
+ + + +
)} {competition['results_posted?'] && ( - <> -
{I18n.t('competitions.nav.menu.competitors')}
-
{competition.competitors.length}
- + + +
{I18n.t('competitions.nav.menu.competitors')}
+
+ {competition.competitors.length} +
)} -
- - {(competition.media.accepted ?? []).map((mediaType) => ( -
-
-

- - {`${mediaType.type}s (${mediaType.items.length})`} - -

-
-
- + +
+
+ +
- - ))} + ))} - {!competition['results_posted?'] && competition.competitor_limit_enabled && ( -
-
{I18n.t('competitions.competition_info.competitor_limit')}
-
{competition.competitor_limit}
-
- )} + {!competition['results_posted?'] && competition.competitor_limit_enabled && ( + + +
{I18n.t('competitions.competition_info.competitor_limit')}
+
+ + {competition.competitor_limit} + +
+ )} + + {!competition['results_posted?'] && ( + + +
{I18n.t('competitions.competition_info.number_of_bookmarks')}
+
+ + {competition.number_of_bookmarks} + +
+ )} +
- {!competition['results_posted?'] && ( -
-
{I18n.t('competitions.competition_info.number_of_bookmarks')}
-
{competition.number_of_bookmarks}
-
- )}
- {competition.registration_open && competition.registration_close && ( -
-
{I18n.t('competitions.competition_info.registration_period.label')}
-
-

- {/* eslint-disable-next-line no-nested-ternary */} - {competition['registration_not_yet_opened?'] - ? I18n.t('competitions.competition_info.registration_period.range_future_html', { - start_date_and_time: - getFullDateTimeString(DateTime.fromISO(competition.registration_open)), - end_date_and_time: - getFullDateTimeString(DateTime.fromISO(competition.registration_close)), - }) - : competition['registration_past?'] - ? I18n.t('competitions.competition_info.registration_period.range_past_html', { - start_date_and_time: - getFullDateTimeString(DateTime.fromISO(competition.registration_open)), - end_date_and_time: - getFullDateTimeString(DateTime.fromISO(competition.registration_close)), - }) - : I18n.t('competitions.competition_info.registration_period.range_ongoing_html', { - start_date_and_time: - getFullDateTimeString(DateTime.fromISO(competition.registration_open)), - end_date_and_time: - getFullDateTimeString(DateTime.fromISO(competition.registration_close)), - })} -

-
-
- )} + + {competition.registration_open && competition.registration_close && ( + + +
{I18n.t('competitions.competition_info.registration_period.label')}
+
+ +

+ {competition['registration_not_yet_opened?'] + ? I18n.t('competitions.competition_info.registration_period.range_future_html', { + start_date_and_time: getFullDateTimeString(DateTime.fromISO(competition.registration_open)), + end_date_and_time: getFullDateTimeString(DateTime.fromISO(competition.registration_close)), + }) + : competition['registration_past?'] + ? I18n.t('competitions.competition_info.registration_period.range_past_html', { + start_date_and_time: getFullDateTimeString(DateTime.fromISO(competition.registration_open)), + end_date_and_time: getFullDateTimeString(DateTime.fromISO(competition.registration_close)), + }) + : I18n.t('competitions.competition_info.registration_period.range_ongoing_html', { + start_date_and_time: getFullDateTimeString(DateTime.fromISO(competition.registration_open)), + end_date_and_time: getFullDateTimeString(DateTime.fromISO(competition.registration_close)), + })} +

+
+
+ )} -
-
{I18n.t('competitions.competition_info.registration_requirements')}
-
-
- {showRegistrationRequirements ? ( - <> -
- -
- + + ) : ( + - - ) : ( - - )} -
-
-
+ )} + + + +
{competition.userCanViewResults && (competition.main_event_id || records) && (
diff --git a/app/webpacker/components/CompetitionTabs/TimeLimitCutoffInfo.jsx b/app/webpacker/components/CompetitionTabs/TimeLimitCutoffInfo.jsx new file mode 100644 index 0000000000..7317d9085d --- /dev/null +++ b/app/webpacker/components/CompetitionTabs/TimeLimitCutoffInfo.jsx @@ -0,0 +1,92 @@ +import React from 'react'; + +import I18n from '../../lib/i18n'; +import I18nHTMLTranslate from '../I18nHTMLTranslate'; + +export default function TimeLimitCutoffInfo({ competition }) { + // const showCumulativeOneRound = competition['uses_cumulative?']; + // const showCumulativeAcrossRounds = competition['uses_cumulative_across_rounds?']; + // const showCutoff = competition['uses_cutoff?']; + // const showQualifications = competition['uses_qualification?']; + // + // return ( + //
+ //

+ // { I18n.t("competitions.events.time_limit") } + //

+ //

+ // ${I18n.t("competitions.events.time_limit_information.regulation_link_text", { number: "A1a4" })}')}`} + // } + // { showCumulativeOneRound && } + // <% if show_cumulative_one_round %> + //
+ // <% cumulative_one_round = content_tag :strong, + // t("competitions.events.time_limit_information.cumulative_time_limit"), id: "cumulative-time-limit" %> + // <%= t("competitions.events.time_limit_information.cumulative_one_round_html", + // cumulative_time_limit: cumulative_one_round, + // regulation_link: link_to(t("competitions.events.time_limit_information.regulation_link_text", number: "A1a2"), + // regulations_path + "#A1a2", target: "_blank")) %> + // <% end %> + // <% if show_cumulative_across_rounds %> + //
+ // < + // % cumulative_across_rounds = content_tag :strong, + // t("competitions.events.time_limit_information.cumulative_time_limit"), id: "cumulative-across-rounds-time-limit" + // %> + // <%= t("competitions.events.time_limit_information.cumulative_across_rounds_html", + // cumulative_time_limit: cumulative_across_rounds, + // guideline_link: link_to(t("competitions.events.time_limit_information.guideline_link_text", number: "A1a2++"), + // regulations_path + "/guidelines.html#A1a2++", target: "_blank")) %> + // <% end %> + //

+ // + // < + // % if show_cutoff %> + //

+ // < + // %= t("competitions.events.cutoff") %>

+ //

+ // < + // %= t("competitions.events.time_limit_information.cutoff_html", + // regulation_link: link_to(t("competitions.events.time_limit_information.regulation_link_text", number: "9g"), + // regulations_path + "#9g", target: "_blank")) %> + //

+ // < + // % end %> + //

+ // < + // %= t("competitions.events.format") %>

+ //

+ // < + // %= t("competitions.events.time_limit_information.format_html", + // link_to_9b: link_to(t("competitions.events.time_limit_information.regulation_link_text", number: "9b"), + // regulations_path + "#9b", target: "_blank"), + // link_to_9f: link_to(t("competitions.events.time_limit_information.regulation_link_text", number: "9f"), + // regulations_path + "#9f", target: "_blank")) %> + //

+ // + // < + // % if show_qualifications %> + //

+ // < + // %= t("competitions.events.qualification") %>

+ //

+ // < + // %= t("competitions.events.time_limit_information.qualification_html") %> + // <% date_to_events = competition.qualification_date_to_events %> + // <% if (date_to_events.length() > 1) %> + // <% date_to_events.each do |date, events| %> + // <%= t("competitions.events.time_limit_information.qualification_some_events_html", + // date: wca_date_range(date, date), events: events.map{|e| e.event.name}.join(", ")) %> + // <% end %> + // <% else %> + // <%= t("competitions.events.time_limit_information.qualification_all_events_html", + // date: wca_date_range(date_to_events.keys.first, date_to_events.keys.first)) %> + // <% end %> + //

+ // < + // % end %> + //
+ // ) +}