@shzlx/ui-default 4.58.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/api.ts +61 -0
- package/backendlib/builder.ts +182 -0
- package/backendlib/markdown-it-imsize.ts +235 -0
- package/backendlib/markdown-it-katex.ts +139 -0
- package/backendlib/markdown-it-media.ts +163 -0
- package/backendlib/markdown-it-xss.ts +200 -0
- package/backendlib/markdown.js +64 -0
- package/backendlib/misc.ts +54 -0
- package/backendlib/template.ts +279 -0
- package/breakpoints.json +5 -0
- package/components/DOMAttachedObject.ts +128 -0
- package/components/autocomplete/AssignSelectAutoComplete.tsx +22 -0
- package/components/autocomplete/CustomSelectAutoComplete.tsx +23 -0
- package/components/autocomplete/DomainSelectAutoComplete.tsx +18 -0
- package/components/autocomplete/FileSelectAutoComplete.tsx +26 -0
- package/components/autocomplete/LanguageSelectAutoComplete.tsx +24 -0
- package/components/autocomplete/ProblemSelectAutoComplete.tsx +18 -0
- package/components/autocomplete/UserSelectAutoComplete.tsx +23 -0
- package/components/autocomplete/components/AssignSelectAutoComplete.tsx +118 -0
- package/components/autocomplete/components/DomainSelectAutoComplete.tsx +53 -0
- package/components/autocomplete/components/FileSelectAutoComplete.tsx +50 -0
- package/components/autocomplete/components/LanguageSelectAutoComplete.tsx +48 -0
- package/components/autocomplete/components/ProblemSelectAutoComplete.tsx +54 -0
- package/components/autocomplete/components/UserSelectAutoComplete.tsx +54 -0
- package/components/autocomplete/domainselectautocomplete.page.styl +6 -0
- package/components/autocomplete/index.tsx +110 -0
- package/components/autocomplete/problemselectautocomplete.page.styl +6 -0
- package/components/autocomplete/userselectautocomplete.page.styl +6 -0
- package/components/browser-update.page.ts +27 -0
- package/components/calendar/calendar.page.styl +129 -0
- package/components/calendar/index.js +367 -0
- package/components/clipboard.page.ts +23 -0
- package/components/contest/contest.page.styl +119 -0
- package/components/contest/contest.page.ts +23 -0
- package/components/contest/contest_sidebar.page.styl +21 -0
- package/components/contest/problem-contest-bg.png +0 -0
- package/components/contest/problem-contest-bg@2x.png +0 -0
- package/components/customFont.page.tsx +90 -0
- package/components/datepicker/datepicker.page.tsx +94 -0
- package/components/dialog/DomDialog.ts +145 -0
- package/components/dialog/dialog.page.styl +40 -0
- package/components/dialog/index.tsx +285 -0
- package/components/discussion/CommentBox.js +103 -0
- package/components/discussion/collapsible.page.styl +40 -0
- package/components/discussion/collapsible.page.tsx +62 -0
- package/components/discussion/comments.page.styl +142 -0
- package/components/discussion/comments.page.tsx +192 -0
- package/components/discussion/discussion.page.styl +17 -0
- package/components/discussion/history.page.tsx +81 -0
- package/components/discussion/reaction.page.styl +30 -0
- package/components/discussion/reaction.page.tsx +103 -0
- package/components/drop/drop.page.styl +40 -0
- package/components/dropdown/Dropdown.js +50 -0
- package/components/dropdown/dropdown.page.styl +33 -0
- package/components/dropdown/dropdown.page.ts +8 -0
- package/components/editor/cmeditor.page.ts +23 -0
- package/components/editor/cmeditor.styl +10 -0
- package/components/editor/index.tsx +293 -0
- package/components/editor/mdeditor.ts +60 -0
- package/components/editor/textareaHandler.ts +29 -0
- package/components/footer/footer.page.styl +94 -0
- package/components/footer/footer.page.ts +26 -0
- package/components/form/button.page.default.styl +59 -0
- package/components/form/button.page.styl +36 -0
- package/components/form/checkbox.page.styl +89 -0
- package/components/form/form.page.styl +200 -0
- package/components/form/form.page.ts +20 -0
- package/components/form/multiSelectCheckbox.page.js +46 -0
- package/components/form/radiobox.page.styl +62 -0
- package/components/form/select.page.styl +29 -0
- package/components/form/textbox.page.styl +79 -0
- package/components/form/textbox.page.ts +21 -0
- package/components/form/var.inc.styl +14 -0
- package/components/header/header.page.styl +79 -0
- package/components/highlighter/code-example.js +111 -0
- package/components/highlighter/highlighter.page.styl +99 -0
- package/components/highlighter/highlighter.page.ts +72 -0
- package/components/highlighter/meta.js +15 -0
- package/components/highlighter/prismjs.js +122 -0
- package/components/hint.page.styl +9 -0
- package/components/hint.ts +19 -0
- package/components/hitokoto/index.page.js +21 -0
- package/components/hotkey/hotkey.page.js +83 -0
- package/components/katex/katex.page.js +26 -0
- package/components/katex/katex.page.styl +2 -0
- package/components/languageselect.tsx +94 -0
- package/components/loader/loader.page.styl +40 -0
- package/components/mantine.page.tsx +39 -0
- package/components/marker/Marker.js +192 -0
- package/components/marker/MarkerReactive.js +55 -0
- package/components/marker/marker.page.js +8 -0
- package/components/marker/marker.page.styl +57 -0
- package/components/media/media.page.js +46 -0
- package/components/menu/menu-heading.page.js +28 -0
- package/components/menu/menu.page.js +18 -0
- package/components/menu/menu.page.styl +68 -0
- package/components/message/index.page.ts +166 -0
- package/components/message/worker.ts +110 -0
- package/components/messagepad/DialogueListItem.page.styl +28 -0
- package/components/messagepad/DialogueListItemComponent.jsx +39 -0
- package/components/messagepad/Message.page.styl +64 -0
- package/components/messagepad/MessageComponent.jsx +33 -0
- package/components/messagepad/MessagePad.page.styl +99 -0
- package/components/messagepad/MessagePadDialogueContentContainer.jsx +104 -0
- package/components/messagepad/MessagePadDialogueListContainer.jsx +49 -0
- package/components/messagepad/MessagePadInputContainer.jsx +100 -0
- package/components/messagepad/index.jsx +49 -0
- package/components/messagepad/reducers/activeId.ts +36 -0
- package/components/messagepad/reducers/dialogues.js +53 -0
- package/components/messagepad/reducers/index.ts +14 -0
- package/components/messagepad/reducers/inputs.js +43 -0
- package/components/messagepad/reducers/isPosting.ts +49 -0
- package/components/monaco/index.ts +178 -0
- package/components/monaco/languages/markdown.ts +97 -0
- package/components/monaco/languages/typescript.ts +45 -0
- package/components/monaco/languages/yaml.ts +22 -0
- package/components/monaco/loader.ts +96 -0
- package/components/monaco/monaco.styl +30 -0
- package/components/monaco/nls.js +31 -0
- package/components/monaco/schema/problemconfig.ts +123 -0
- package/components/navigation/hamburgers.page.styl +87 -0
- package/components/navigation/nav-logo-small_dark.png +0 -0
- package/components/navigation/navigation.page.js +203 -0
- package/components/navigation/navigation.page.styl +211 -0
- package/components/notification/index.ts +105 -0
- package/components/notification/notification.page.js +14 -0
- package/components/notification/notification.page.styl +84 -0
- package/components/nprogress.page.styl +50 -0
- package/components/omnisearch/index.page.tsx +124 -0
- package/components/omnisearch/omnibar.page.styl +138 -0
- package/components/pager/pager.page.styl +57 -0
- package/components/preview/preview.page.ts +187 -0
- package/components/problem/create.page.js +12 -0
- package/components/problem/list.page.js +9 -0
- package/components/problem/rp.page.styl +4 -0
- package/components/problem/tag.page.styl +84 -0
- package/components/problemconfig/BasicForm.tsx +92 -0
- package/components/problemconfig/ProblemConfigEditor.tsx +170 -0
- package/components/problemconfig/ProblemConfigForm.tsx +140 -0
- package/components/problemconfig/ProblemConfigTree.tsx +163 -0
- package/components/problemconfig/ProblemType.tsx +165 -0
- package/components/problemconfig/index.tsx +91 -0
- package/components/problemconfig/reducer/config.ts +173 -0
- package/components/problemconfig/reducer/index.ts +11 -0
- package/components/problemconfig/reducer/testdata.ts +16 -0
- package/components/problemconfig/tree/AddTestcase.tsx +137 -0
- package/components/problemconfig/tree/SelectionManager.tsx +140 -0
- package/components/problemconfig/tree/SubtaskSettings.tsx +180 -0
- package/components/problemconfig/tree/Testcase.tsx +98 -0
- package/components/profile/backgrounds/1.jpg +0 -0
- package/components/profile/backgrounds/10.jpg +0 -0
- package/components/profile/backgrounds/11.jpg +0 -0
- package/components/profile/backgrounds/12.jpg +0 -0
- package/components/profile/backgrounds/13.jpg +0 -0
- package/components/profile/backgrounds/14.jpg +0 -0
- package/components/profile/backgrounds/15.jpg +0 -0
- package/components/profile/backgrounds/16.jpg +0 -0
- package/components/profile/backgrounds/17.jpg +0 -0
- package/components/profile/backgrounds/18.jpg +0 -0
- package/components/profile/backgrounds/19.jpg +0 -0
- package/components/profile/backgrounds/2.jpg +0 -0
- package/components/profile/backgrounds/20.jpg +0 -0
- package/components/profile/backgrounds/21.jpg +0 -0
- package/components/profile/backgrounds/3.jpg +0 -0
- package/components/profile/backgrounds/4.jpg +0 -0
- package/components/profile/backgrounds/5.jpg +0 -0
- package/components/profile/backgrounds/6.jpg +0 -0
- package/components/profile/backgrounds/7.jpg +0 -0
- package/components/profile/backgrounds/8.jpg +0 -0
- package/components/profile/backgrounds/9.jpg +0 -0
- package/components/profile/backgrounds/gen_thumbnails.sh +7 -0
- package/components/profile/backgrounds/thumbnail/1.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/10.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/11.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/12.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/13.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/14.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/15.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/16.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/17.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/18.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/19.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/2.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/20.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/21.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/3.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/4.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/5.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/6.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/7.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/8.jpg +0 -0
- package/components/profile/backgrounds/thumbnail/9.jpg +0 -0
- package/components/profile/profile.page.styl +23 -0
- package/components/react/DomComponent.tsx +14 -0
- package/components/react/IconComponent.tsx +20 -0
- package/components/record/record.page.styl +26 -0
- package/components/rotator/index.js +75 -0
- package/components/rotator/rotator.page.styl +20 -0
- package/components/scratchpad/DataInput.page.styl +17 -0
- package/components/scratchpad/DataInputComponent.jsx +45 -0
- package/components/scratchpad/Editor.page.styl +13 -0
- package/components/scratchpad/Panel.page.styl +18 -0
- package/components/scratchpad/PanelButton.page.styl +15 -0
- package/components/scratchpad/PanelButtonComponent.jsx +19 -0
- package/components/scratchpad/PanelComponent.jsx +25 -0
- package/components/scratchpad/ScratchpadEditorContainer.tsx +137 -0
- package/components/scratchpad/ScratchpadPretestContainer.jsx +57 -0
- package/components/scratchpad/ScratchpadRecordsContainer.jsx +45 -0
- package/components/scratchpad/ScratchpadRecordsRowContainer.jsx +83 -0
- package/components/scratchpad/ScratchpadSettings.tsx +48 -0
- package/components/scratchpad/ScratchpadToolbarContainer.jsx +190 -0
- package/components/scratchpad/Tab.page.styl +24 -0
- package/components/scratchpad/Toolbar.page.styl +53 -0
- package/components/scratchpad/ToolbarComponent.jsx +85 -0
- package/components/scratchpad/index.tsx +132 -0
- package/components/scratchpad/reducers/editor.ts +24 -0
- package/components/scratchpad/reducers/index.ts +17 -0
- package/components/scratchpad/reducers/pretest.ts +34 -0
- package/components/scratchpad/reducers/records.ts +40 -0
- package/components/scratchpad/reducers/state.ts +10 -0
- package/components/scratchpad/reducers/ui.ts +152 -0
- package/components/scratchpad/scratchpad.page.styl +55 -0
- package/components/scratchpad/var.inc.styl +2 -0
- package/components/selectUser.tsx +16 -0
- package/components/signin/signInDialog.page.js +84 -0
- package/components/signin/signin_dialog.page.styl +57 -0
- package/components/smoothscroll/smoothscroll.page.js +44 -0
- package/components/socket/index.ts +68 -0
- package/components/star/star.page.styl +20 -0
- package/components/star/star.page.ts +58 -0
- package/components/sticky/sticky.page.js +66 -0
- package/components/tab/Tab.js +168 -0
- package/components/tab/tab.page.js +9 -0
- package/components/tab/tab.page.styl +105 -0
- package/components/tab/var.inc.styl +3 -0
- package/components/table/StyledTable.js +51 -0
- package/components/table/styledTable.page.js +8 -0
- package/components/table/table.page.styl +73 -0
- package/components/time/time.page.js +47 -0
- package/components/tooltip/Tooltip.js +49 -0
- package/components/tooltip/tooltip.page.js +29 -0
- package/components/tooltip/tooltip.page.styl +69 -0
- package/components/training/training.page.styl +25 -0
- package/components/upload.tsx +103 -0
- package/components/vote/vote.page.js +43 -0
- package/components/zipDownloader/index.ts +157 -0
- package/constant/domain.js +21 -0
- package/constant/message.js +5 -0
- package/constant/record.js +52 -0
- package/context.ts +11 -0
- package/entry.js +72 -0
- package/hydro.ts +112 -0
- package/index.ts +226 -0
- package/lazyload.ts +69 -0
- package/locales/en.yaml +71 -0
- package/locales/ko.yaml +823 -0
- package/locales/zh.yaml +1137 -0
- package/locales/zh_TW.yaml +1133 -0
- package/misc/Page.ts +49 -0
- package/misc/PageLoader.js +31 -0
- package/misc/float.styl +14 -0
- package/misc/grid.styl +1048 -0
- package/misc/immersive-background.jpg +0 -0
- package/misc/immersive-background@2x.jpg +0 -0
- package/misc/immersive.styl +23 -0
- package/misc/nothing.styl +13 -0
- package/misc/puzzled_twd2.svg +1 -0
- package/misc/section.styl +105 -0
- package/misc/slideout.styl +46 -0
- package/misc/structure.styl +158 -0
- package/misc/textalign.styl +11 -0
- package/misc/typography.styl +485 -0
- package/package.json +148 -0
- package/polyfill.ts +90 -0
- package/postcss.config.js +15 -0
- package/sentry.ts +26 -0
- package/service-worker.ts +265 -0
- package/setting.yaml +98 -0
- package/templates/about.html +14 -0
- package/templates/bsod.html +35 -0
- package/templates/components/comments_discussion.html +165 -0
- package/templates/components/comments_solution.html +171 -0
- package/templates/components/contest.html +12 -0
- package/templates/components/form.html +214 -0
- package/templates/components/home.html +20 -0
- package/templates/components/homework.html +8 -0
- package/templates/components/md_hint.html +39 -0
- package/templates/components/noscript_note.html +15 -0
- package/templates/components/nothing.html +6 -0
- package/templates/components/paginator.html +25 -0
- package/templates/components/problem.html +33 -0
- package/templates/components/record.html +21 -0
- package/templates/components/sidemenu.html +11 -0
- package/templates/components/user.html +49 -0
- package/templates/contest_balloon.html +48 -0
- package/templates/contest_clarification.html +103 -0
- package/templates/contest_detail.html +56 -0
- package/templates/contest_edit.html +259 -0
- package/templates/contest_main.html +146 -0
- package/templates/contest_manage.html +80 -0
- package/templates/contest_print.html +27 -0
- package/templates/contest_problemlist.html +231 -0
- package/templates/contest_scoreboard.html +46 -0
- package/templates/contest_scoreboard_download_html.html +71 -0
- package/templates/contest_user.html +47 -0
- package/templates/discussion_create.html +28 -0
- package/templates/discussion_detail.html +149 -0
- package/templates/discussion_edit.html +30 -0
- package/templates/discussion_main_or_node.html +47 -0
- package/templates/domain_base.html +26 -0
- package/templates/domain_create.html +55 -0
- package/templates/domain_dashboard.html +45 -0
- package/templates/domain_edit.html +6 -0
- package/templates/domain_group.html +51 -0
- package/templates/domain_join.html +47 -0
- package/templates/domain_join_applications.html +67 -0
- package/templates/domain_permission.html +66 -0
- package/templates/domain_role.html +71 -0
- package/templates/domain_user.html +86 -0
- package/templates/domain_user_raw.html +5 -0
- package/templates/error.html +25 -0
- package/templates/home_domain.html +64 -0
- package/templates/home_files.html +16 -0
- package/templates/home_messages.html +9 -0
- package/templates/home_security.html +224 -0
- package/templates/home_settings.html +21 -0
- package/templates/homework_detail.html +82 -0
- package/templates/homework_edit.html +138 -0
- package/templates/homework_files.html +24 -0
- package/templates/homework_main.html +76 -0
- package/templates/layout/basic.html +27 -0
- package/templates/layout/home_base.html +13 -0
- package/templates/layout/html5.html +74 -0
- package/templates/layout/immersive.html +22 -0
- package/templates/layout/mail.html +31 -0
- package/templates/layout/simple.html +4 -0
- package/templates/layout/wiki_base.html +16 -0
- package/templates/main.html +22 -0
- package/templates/manage_base.html +24 -0
- package/templates/manage_config.html +6 -0
- package/templates/manage_dashboard.html +27 -0
- package/templates/manage_script.html +56 -0
- package/templates/manage_setting.html +6 -0
- package/templates/manage_user_import.html +23 -0
- package/templates/manage_user_priv.html +76 -0
- package/templates/partials/category.html +19 -0
- package/templates/partials/contest.html +3 -0
- package/templates/partials/contest_balloon.html +37 -0
- package/templates/partials/contest_sidebar.html +150 -0
- package/templates/partials/contest_sidebar_management.html +56 -0
- package/templates/partials/contest_user.html +19 -0
- package/templates/partials/discussion_edit_form.html +45 -0
- package/templates/partials/discussion_list.html +50 -0
- package/templates/partials/discussion_nodes_widget.html +17 -0
- package/templates/partials/files.html +49 -0
- package/templates/partials/footer.html +108 -0
- package/templates/partials/hamburger.html +7 -0
- package/templates/partials/header_mobile.html +12 -0
- package/templates/partials/homepage/bulletin.html +7 -0
- package/templates/partials/homepage/contest.html +48 -0
- package/templates/partials/homepage/discussion.html +13 -0
- package/templates/partials/homepage/discussion_nodes.html +4 -0
- package/templates/partials/homepage/error.html +5 -0
- package/templates/partials/homepage/hitokoto.html +6 -0
- package/templates/partials/homepage/homework.html +45 -0
- package/templates/partials/homepage/problem_search.html +13 -0
- package/templates/partials/homepage/ranking.html +39 -0
- package/templates/partials/homepage/recent_problems.html +17 -0
- package/templates/partials/homepage/starred_problems.html +15 -0
- package/templates/partials/homepage/suggestion.html +34 -0
- package/templates/partials/homepage/training.html +50 -0
- package/templates/partials/homework.html +3 -0
- package/templates/partials/homework_default_penalty_rules.yaml +6 -0
- package/templates/partials/homework_sidebar.html +93 -0
- package/templates/partials/login_dialog.html +56 -0
- package/templates/partials/manage_user_priv.html +78 -0
- package/templates/partials/nav.html +138 -0
- package/templates/partials/problem-sidebar-information.html +25 -0
- package/templates/partials/problem.html +2 -0
- package/templates/partials/problem_category_dialog.html +43 -0
- package/templates/partials/problem_default.md +26 -0
- package/templates/partials/problem_description.html +33 -0
- package/templates/partials/problem_files.html +63 -0
- package/templates/partials/problem_list.html +68 -0
- package/templates/partials/problem_lucky.html +10 -0
- package/templates/partials/problem_sidebar.html +14 -0
- package/templates/partials/problem_sidebar_contest.html +43 -0
- package/templates/partials/problem_sidebar_homework.html +42 -0
- package/templates/partials/problem_sidebar_normal.html +152 -0
- package/templates/partials/problem_stat.html +3 -0
- package/templates/partials/scoreboard.html +79 -0
- package/templates/partials/setting.html +92 -0
- package/templates/partials/training_default.json +14 -0
- package/templates/partials/training_detail.html +153 -0
- package/templates/partials/user.html +2 -0
- package/templates/partials/user_detail/activity.html +18 -0
- package/templates/partials/user_detail/solution.html +29 -0
- package/templates/problem_config.html +39 -0
- package/templates/problem_detail.html +150 -0
- package/templates/problem_edit.html +111 -0
- package/templates/problem_files.html +91 -0
- package/templates/problem_hack.html +41 -0
- package/templates/problem_import.html +58 -0
- package/templates/problem_main.html +100 -0
- package/templates/problem_solution.html +55 -0
- package/templates/problem_statistics.html +96 -0
- package/templates/problem_submit.html +40 -0
- package/templates/ranking.html +81 -0
- package/templates/record_detail.html +134 -0
- package/templates/record_detail_status.html +93 -0
- package/templates/record_detail_summary.html +19 -0
- package/templates/record_main.html +142 -0
- package/templates/record_main_tr.html +35 -0
- package/templates/status.html +75 -0
- package/templates/training_detail.html +120 -0
- package/templates/training_edit.html +68 -0
- package/templates/training_files.html +64 -0
- package/templates/training_main.html +107 -0
- package/templates/user_changemail_mail.html +6 -0
- package/templates/user_changemail_mail_sent.html +9 -0
- package/templates/user_delete_pending.html +10 -0
- package/templates/user_detail.html +181 -0
- package/templates/user_login.html +46 -0
- package/templates/user_logout.html +13 -0
- package/templates/user_lostpass.html +27 -0
- package/templates/user_lostpass_mail.html +6 -0
- package/templates/user_lostpass_mail_sent.html +9 -0
- package/templates/user_lostpass_with_code.html +29 -0
- package/templates/user_register.html +22 -0
- package/templates/user_register_mail.html +6 -0
- package/templates/user_register_mail_sent.html +9 -0
- package/templates/user_register_with_code.html +35 -0
- package/templates/user_sudo.html +54 -0
- package/templates/user_sudo_redirect.html +18 -0
- package/templates/wiki_help.html +189 -0
- package/theme/bp6-compat.css +48 -0
- package/theme/dark.styl +397 -0
- package/theme/default.js +33 -0
- package/typed.d.ts +20 -0
- package/utils/base.ts +209 -0
- package/utils/base64.js +104 -0
- package/utils/db.ts +32 -0
- package/utils/index.ts +73 -0
- package/utils/loadReactRedux.ts +32 -0
- package/utils/mediaQuery.ts +13 -0
- package/utils/pjax.js +148 -0
- package/utils/slide.ts +57 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
{% import "components/user.html" as user with context %}
|
|
2
|
+
{% macro reply(mode_create, udoc, doc = {}, rdoc = {}) %}
|
|
3
|
+
|
|
4
|
+
{% endmacro %}
|
|
5
|
+
|
|
6
|
+
{% macro render(
|
|
7
|
+
view, docs, udict,
|
|
8
|
+
comment_ref,
|
|
9
|
+
reply_ref,
|
|
10
|
+
comment_post_perm,
|
|
11
|
+
comment_edit_perm,
|
|
12
|
+
comment_edit_self_perm,
|
|
13
|
+
comment_delete_perm,
|
|
14
|
+
comment_delete_self_perm,
|
|
15
|
+
reply_post_perm,
|
|
16
|
+
reply_edit_perm,
|
|
17
|
+
reply_edit_self_perm,
|
|
18
|
+
reply_delete_perm,
|
|
19
|
+
reply_delete_self_perm,
|
|
20
|
+
comment_placeholder = 'Write Your Comment',
|
|
21
|
+
comment_post_op = 'reply',
|
|
22
|
+
comment_edit_op = 'edit_reply',
|
|
23
|
+
comment_post_text = 'Comment',
|
|
24
|
+
comment_edit_text = 'Update',
|
|
25
|
+
reply_post_op = 'tail_reply',
|
|
26
|
+
reply_post_text = 'Reply',
|
|
27
|
+
reply_edit_op = 'edit_tail_reply',
|
|
28
|
+
reply_edit_text = 'Update',
|
|
29
|
+
comment_delete_op = 'delete_reply',
|
|
30
|
+
reply_delete_op = 'delete_tail_reply'
|
|
31
|
+
) %}
|
|
32
|
+
<ul class="dczcomments__list view--solution">
|
|
33
|
+
{% if handler.user.hasPerm(comment_post_perm) %}
|
|
34
|
+
<li class="dczcomments__item">
|
|
35
|
+
<div class="media">
|
|
36
|
+
<div class="media__left top">
|
|
37
|
+
<div class="vote vote--discussion">
|
|
38
|
+
<div class="vote-number">0</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="media__body top">
|
|
42
|
+
<div class="clearfix">
|
|
43
|
+
<div class="supplementary dczcomments__supplementary">
|
|
44
|
+
{{ user.render_inline(handler.user) }}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="hasjs--hide">
|
|
48
|
+
<form method="post" class="dczcomments__box" name="dczcomments__box__form" data-hotkey="ctrl+enter:submit,esc:vjCommentBoxCancel">
|
|
49
|
+
<div>
|
|
50
|
+
<textarea name="content" class="textbox" data-markdown required></textarea>
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
53
|
+
<input type="submit" class="rounded primary button dczcomments__box__submit" value="{{ _(comment_post_text) }} (Ctrl+Enter)" data-value-reply="{{ _(reply_post_text) }} (Ctrl+Enter)" data-value-comment="{{ _(comment_post_text) }} (Ctrl+Enter)" data-value-comment-update="{{ _(comment_edit_text) }} (Ctrl+Enter)" data-value-reply-update="{{ _(reply_edit_text) }} (Ctrl+Enter)">
|
|
54
|
+
<input type="button" class="rounded button nojs--hide" name="dczcomments__box__cancel" value="{{ _('Cancel') }} (Esc)">
|
|
55
|
+
</div>
|
|
56
|
+
<input type="hidden" name="operation" value="{{ comment_post_op }}">
|
|
57
|
+
</form>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="nojs--hide">
|
|
60
|
+
<textarea class="textbox" name="dczcomments__dummy-box" readonly data-form="{{ {operation: comment_post_op}|json }}" placeholder="{{ _(comment_placeholder) }}"></textarea>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="commentbox-placeholder"></div>
|
|
63
|
+
<ul style="display:none">
|
|
64
|
+
<li class="dczcomments__reply commentbox-container">
|
|
65
|
+
<div class="media">
|
|
66
|
+
<div class="media__body top">
|
|
67
|
+
<div class="clearfix">
|
|
68
|
+
<div class="supplementary dczcomments__supplementary">
|
|
69
|
+
{{ user.render_inline(handler.user, badge=false) }}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="commentbox-placeholder"></div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</li>
|
|
76
|
+
</ul>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</li>
|
|
80
|
+
{% endif %}
|
|
81
|
+
{%- for doc in docs -%}
|
|
82
|
+
{% set udoc = udict[doc.owner] %}
|
|
83
|
+
<li class="dczcomments__item">
|
|
84
|
+
<div class="media">
|
|
85
|
+
<div class="media__left top">
|
|
86
|
+
<div class="vote vote--discussion">
|
|
87
|
+
{% if handler.user.hasPerm(perm.PERM_VOTE_PROBLEM_SOLUTION) %}
|
|
88
|
+
<div class="vote-number rotator--enabled">{{ doc.vote }}</div>
|
|
89
|
+
<form method="post" class="vote-op clearfix">
|
|
90
|
+
<input type="hidden" name="psid" value="{{ doc._id }}">
|
|
91
|
+
<button type="submit" name="operation" value="upvote" class="vote-button upvote{% if pssdict[doc._id].vote == 1 %} active{% endif %}" data-tooltip="{{ _('Upvote') }}" data-tooltip-pos="bottom center" aria-label="{{ _('Upvote') }}"><span class="icon icon-vote--up"></span></button>
|
|
92
|
+
<button type="submit" name="operation" value="downvote" class="vote-button downvote{% if pssdict[doc._id].vote == -1 %} active{% endif %}" data-tooltip="{{ _('Downvote') }}" data-tooltip-pos="bottom center" aria-label="{{ _('Downvote') }}"><span class="icon icon-vote--down"></span></button>
|
|
93
|
+
</form>
|
|
94
|
+
{% else %}
|
|
95
|
+
<div class="vote-number">{{ doc.vote }}</div>
|
|
96
|
+
{% endif %}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="media__body top">
|
|
100
|
+
<div class="clearfix">
|
|
101
|
+
<div class="supplementary dczcomments__supplementary">
|
|
102
|
+
{{ user.render_inline(udoc) }} @ {{ datetimeSpan(doc._id)|safe }}
|
|
103
|
+
</div>
|
|
104
|
+
<div class="dczcomments__operations nojs--hide">
|
|
105
|
+
{% if pdoc %}
|
|
106
|
+
<a href="javascript:;" data-tooltip="{{ _('Copy Link') }}" data-copylink="{{ url('problem_solution_detail', pid=pdoc.pid|default(pdoc.docId), sid=doc._id) }}">
|
|
107
|
+
<span class="icon icon-link"></span>
|
|
108
|
+
</a>
|
|
109
|
+
{% endif %}
|
|
110
|
+
{% if handler.user.hasPerm(reply_post_perm) %}
|
|
111
|
+
<a href="javascript:;" data-tooltip="{{ _('Reply') }}" data-op="reply" data-type="comment"
|
|
112
|
+
data-form="{{ {operation: reply_post_op, psid: doc._id}|json }}"
|
|
113
|
+
><span class="icon icon-reply"></span></a>
|
|
114
|
+
{% endif %}
|
|
115
|
+
{% if (handler.user.hasPerm(comment_edit_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(comment_edit_perm) %}
|
|
116
|
+
<a href="javascript:;" data-tooltip="{{ _('Edit') }}" data-op="edit" data-type="comment"
|
|
117
|
+
data-form="{{ {operation: comment_edit_op, psid: doc._id}|json }}"
|
|
118
|
+
><span class="icon icon-edit"></span></a>
|
|
119
|
+
{% endif %}
|
|
120
|
+
{% if (handler.user.hasPerm(comment_delete_self_perm) and handler.user.own(doc)) or handler.user.hasPerm(comment_delete_perm) %}
|
|
121
|
+
<a href="javascript:;" data-tooltip="{{ _('Delete') }}" data-op="delete" data-type="comment"
|
|
122
|
+
data-form="{{ {operation: comment_delete_op, psid: doc._id}|json }}"
|
|
123
|
+
><span class="icon icon-delete"></span></a>
|
|
124
|
+
{% endif %}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="typo richmedia collapsible-content" data-emoji-enabled data-raw-url="{{ url('problem_solution_raw', pid=doc.parentId, psid=doc._id) }}">
|
|
128
|
+
{{ doc['content']|markdown|safe }}
|
|
129
|
+
</div>
|
|
130
|
+
<div class="commentbox-edit-target"></div>
|
|
131
|
+
<ul class="dczcomments__replies commentbox-reply-target">
|
|
132
|
+
{%- for rdoc in doc['reply'] -%}
|
|
133
|
+
{% set udoc = udict[rdoc['owner']] %}
|
|
134
|
+
<li class="dczcomments__reply{% if mode_create %} commentbox-container{% endif %}">
|
|
135
|
+
<div class="media">
|
|
136
|
+
<div class="media__body top">
|
|
137
|
+
<div class="clearfix">
|
|
138
|
+
<div class="supplementary dczcomments__supplementary">
|
|
139
|
+
{{ user.render_inline(udoc, badge=false) }} @ {{ datetimeSpan(rdoc['_id'])|safe }}
|
|
140
|
+
</div>
|
|
141
|
+
<div class="dczcomments__operations nojs--hide">
|
|
142
|
+
{% if handler.user.hasPerm(reply_post_perm) %}
|
|
143
|
+
<a href="javascript:;" data-tooltip="{{ _('Reply') }}" data-op="reply" data-type="reply"><span class="icon icon-reply"></span></a>
|
|
144
|
+
{% endif %}
|
|
145
|
+
{% if (handler.user.hasPerm(reply_edit_self_perm) and handler.user.own(rdoc)) or handler.user.hasPerm(reply_edit_perm) %}
|
|
146
|
+
<a href="javascript:;" data-tooltip="{{ _('Edit') }}" data-op="edit" data-type="reply"
|
|
147
|
+
data-form="{{ {operation: reply_edit_op, psid: doc._id, psrid: rdoc._id}|json }}"
|
|
148
|
+
><span class="icon icon-edit"></span></a>
|
|
149
|
+
{% endif %}
|
|
150
|
+
{% if (handler.user.hasPerm(reply_delete_self_perm) and handler.user.own(rdoc)) or handler.user.hasPerm(reply_delete_perm) %}
|
|
151
|
+
<a href="javascript:;" data-tooltip="{{ _('Delete') }}" data-op="delete" data-type="reply"
|
|
152
|
+
data-form="{{ {operation: reply_delete_op, psid: doc._id, psrid: rdoc._id}|json }}"
|
|
153
|
+
><span class="icon icon-delete"></span></a>
|
|
154
|
+
{% endif %}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
<div class="typo richmedia collapsible-content" data-emoji-enabled data-raw-url="{{ url('problem_solution_reply_raw', pid=doc.parentId, psid=doc._id, psrid=rdoc._id) }}">
|
|
158
|
+
{{ rdoc['content']|markdown|safe }}
|
|
159
|
+
</div>
|
|
160
|
+
<div class="commentbox-edit-target"></div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</li>
|
|
164
|
+
{%- endfor -%}
|
|
165
|
+
</ul>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</li>
|
|
169
|
+
{%- endfor -%}
|
|
170
|
+
</ul>
|
|
171
|
+
{% endmacro %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% import "components/user.html" as user with context %}
|
|
2
|
+
{% macro render_time(tdoc_time) %}
|
|
3
|
+
{{ datetimeSpan(tdoc_time, false, 'YYYY-M-D H:mm')|safe }}
|
|
4
|
+
{% endmacro %}
|
|
5
|
+
|
|
6
|
+
{% macro render_duration(tdoc) %}
|
|
7
|
+
{{ tdoc.duration|round(1) if tdoc.duration else ((tdoc.endAt.getTime() - tdoc.beginAt.getTime()) /1000 / 3600)|round(1) }}
|
|
8
|
+
{% endmacro %}
|
|
9
|
+
|
|
10
|
+
{% macro render_clarification_subject(tdoc, pdict, subject) %}
|
|
11
|
+
{% if subject == 0 %}{{ _('General Issue') }}{% elif subject == -1 %}{{ _('Technical Issue') }}{% else %}{{ utils.getAlphabeticId(tdoc.pids.indexOf(subject)) }}. {{ pdict[subject].title }}{% endif %}
|
|
12
|
+
{% endmacro %}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
{% macro form_begin(args) %}
|
|
2
|
+
{% set label = args.label %}
|
|
3
|
+
{% set columns = args.columns %}
|
|
4
|
+
{% set last_column = args.last_column|default(true) %}
|
|
5
|
+
{% set required = args.required or false %}
|
|
6
|
+
{% set hotkeys = args.hotkeys or none %}
|
|
7
|
+
{% set row = args.row|default(true) %}
|
|
8
|
+
{% set no_label = args.no_label or false %}
|
|
9
|
+
{% set label_wrap = args.label_wrap|default(true) %}
|
|
10
|
+
{% if row %}
|
|
11
|
+
<div class="row">
|
|
12
|
+
{% endif %}
|
|
13
|
+
<div
|
|
14
|
+
class="{% if columns %}medium-{{ columns }} {% endif %}columns form__item{% if last_column %} end{% endif %}"
|
|
15
|
+
{% if hotkeys %}data-hotkey="{{ hotkeys }}"{% endif %}
|
|
16
|
+
>
|
|
17
|
+
{% if not no_label %}
|
|
18
|
+
<label>
|
|
19
|
+
{{ _(label) }}
|
|
20
|
+
{% if required %}
|
|
21
|
+
({{ _('required') }})
|
|
22
|
+
{% endif %}
|
|
23
|
+
{% if not label_wrap %}
|
|
24
|
+
</label>
|
|
25
|
+
{% endif %}
|
|
26
|
+
{% endif %}
|
|
27
|
+
{% endmacro %}
|
|
28
|
+
|
|
29
|
+
{% macro form_end(args) %}
|
|
30
|
+
{% set help_text = args.help_text or none %}
|
|
31
|
+
{% set row = args.row|default(true) %}
|
|
32
|
+
{% set no_label = args.no_label or false %}
|
|
33
|
+
{% set label_wrap = args.label_wrap|default(true) %}
|
|
34
|
+
{% if not no_label and label_wrap %}
|
|
35
|
+
</label>
|
|
36
|
+
{% endif %}
|
|
37
|
+
{% if help_text %}
|
|
38
|
+
<p class="help-text">{{ _(help_text)|safe }}</p>
|
|
39
|
+
{% endif %}
|
|
40
|
+
</div>
|
|
41
|
+
{% if row %}
|
|
42
|
+
</div>
|
|
43
|
+
{% endif %}
|
|
44
|
+
{% endmacro %}
|
|
45
|
+
|
|
46
|
+
{% macro form_attr(form_class, args) %}
|
|
47
|
+
{% set disabled = args.disabled or false %}
|
|
48
|
+
{% set required = args.required or false %}
|
|
49
|
+
{% set autofocus = args.autofocus or false %}
|
|
50
|
+
{% set noAutocomplete = args.noAutocomplete or false %}
|
|
51
|
+
{% set extra_style = args.extra_style or false %}
|
|
52
|
+
{% set extra_class = args.extra_class %}
|
|
53
|
+
{% set extra_attr = args.extra_attr %}
|
|
54
|
+
{% set date = args.date or false %}
|
|
55
|
+
{% set time = args.time or false %}
|
|
56
|
+
{% set datetime = args.datetime or false %}
|
|
57
|
+
class="{{ form_class }}{% if extra_class %} {{ extra_class }}{% endif %}"
|
|
58
|
+
{% if disabled %}disabled{% endif %}
|
|
59
|
+
{% if required %}required{% endif %}
|
|
60
|
+
{% if autofocus %}autofocus data-autofocus{% endif %}
|
|
61
|
+
{% if noAutocomplete %}autocomplete="off"{% endif %}
|
|
62
|
+
{% if datetime %}data-pick-datetime{% endif %}
|
|
63
|
+
{% if date %}data-pick-date{% endif %}
|
|
64
|
+
{% if time %}data-pick-time{% endif %}
|
|
65
|
+
{% if extra_attr %}{{ extra_attr }}{% endif %}
|
|
66
|
+
{% if extra_style %}style="{{extra_style}}"{% endif %}
|
|
67
|
+
{% endmacro %}
|
|
68
|
+
|
|
69
|
+
{% macro container_attr(container_class, args) %}
|
|
70
|
+
{% set extra_class = args.extra_class or none %}
|
|
71
|
+
class="{{ container_class }}{% if extra_class %} {{ extra_class }}{% endif %}"
|
|
72
|
+
{% endmacro %}
|
|
73
|
+
|
|
74
|
+
{% macro select(args) %}
|
|
75
|
+
<div
|
|
76
|
+
name="form_item_{{ args.name }}"
|
|
77
|
+
{{ container_attr('select-container', args) }}
|
|
78
|
+
>
|
|
79
|
+
<select
|
|
80
|
+
name="{{ args.name }}"
|
|
81
|
+
{{ form_attr('select', args) }}
|
|
82
|
+
>
|
|
83
|
+
{%- for k, v in args.options -%}
|
|
84
|
+
<option value="{{ k }}"{% if args.value == k %} selected{% endif %}>
|
|
85
|
+
{{ _(v) }}
|
|
86
|
+
</option>
|
|
87
|
+
{%- endfor -%}
|
|
88
|
+
</select>
|
|
89
|
+
</div>
|
|
90
|
+
{% endmacro %}
|
|
91
|
+
|
|
92
|
+
{% macro form_select(args) %}
|
|
93
|
+
{{ form_begin({columns:5}|assign(args)) }}
|
|
94
|
+
{{ select(args) }}
|
|
95
|
+
{{ form_end(args) }}
|
|
96
|
+
{% endmacro %}
|
|
97
|
+
|
|
98
|
+
{% macro radio(args) %}
|
|
99
|
+
<div
|
|
100
|
+
name="form_item_{{ args.name }}"
|
|
101
|
+
{{ container_attr('radiobox-container', args) }}
|
|
102
|
+
>
|
|
103
|
+
{%- for k, v in args.options -%}
|
|
104
|
+
<label class="radiobox">
|
|
105
|
+
<input
|
|
106
|
+
value="{{ k }}"
|
|
107
|
+
type="radio"
|
|
108
|
+
name="{{ args.name }}"
|
|
109
|
+
{{ form_attr('radiobox__input', args) }}
|
|
110
|
+
{% if args.value == k %} checked{% endif %}
|
|
111
|
+
/> {{ _(v) }}
|
|
112
|
+
</label>
|
|
113
|
+
{%- endfor -%}
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
{% endmacro %}
|
|
117
|
+
|
|
118
|
+
{% macro form_radio(args) %}
|
|
119
|
+
{{ form_begin({columns:5, label_wrap:false}|assign(args)) }}
|
|
120
|
+
{{ radio(args) }}
|
|
121
|
+
{{ form_end({label_wrap:false}|assign(args)) }}
|
|
122
|
+
{% endmacro %}
|
|
123
|
+
|
|
124
|
+
{% macro image_radio(args) %}
|
|
125
|
+
<div
|
|
126
|
+
name="form_item_{{ args.name }}"
|
|
127
|
+
{{ container_attr('radiobox-container with-image', args) }}
|
|
128
|
+
>
|
|
129
|
+
{%- for k, v in options -%}
|
|
130
|
+
<label class="radiobox with-image">
|
|
131
|
+
<input
|
|
132
|
+
value="{{ k }}"
|
|
133
|
+
type="radio"
|
|
134
|
+
name="{{ args.name }}"
|
|
135
|
+
{{ form_attr('radiobox__input', args) }}
|
|
136
|
+
{% if value == k %} checked{% endif %}
|
|
137
|
+
/>
|
|
138
|
+
<div class="radiobox__image-container" data-tooltip="{{ _(v) }}">
|
|
139
|
+
<div class="radiobox__image {{ image_class.format(k) }}"></div>
|
|
140
|
+
</div>
|
|
141
|
+
</label>
|
|
142
|
+
{%- endfor -%}
|
|
143
|
+
</div>
|
|
144
|
+
{% endmacro %}
|
|
145
|
+
|
|
146
|
+
{% macro form_image_radio(args) %}
|
|
147
|
+
{{ form_begin({columns:8, label_wrap:false}|assign(args)) }}
|
|
148
|
+
{{ image_radio(args) }}
|
|
149
|
+
{{ form_end({label_wrap:false}|assign(args)) }}
|
|
150
|
+
{% endmacro %}
|
|
151
|
+
|
|
152
|
+
{% macro text(args) %}
|
|
153
|
+
<div
|
|
154
|
+
name="form_item_{{ args.name }}"
|
|
155
|
+
{{ container_attr('textbox-container', args) }}
|
|
156
|
+
>
|
|
157
|
+
<input
|
|
158
|
+
type="{{ 'number' if args.type == 'float' else args.type|default('text') }}"
|
|
159
|
+
name="{{ args.name }}"
|
|
160
|
+
value="{{ args.value }}"
|
|
161
|
+
{% if args.type == 'float' %} step="any"{% endif %}
|
|
162
|
+
placeholder="{{ args.placeholder }}"
|
|
163
|
+
{{ form_attr('textbox', args) }}
|
|
164
|
+
>
|
|
165
|
+
</div>
|
|
166
|
+
{% endmacro %}
|
|
167
|
+
|
|
168
|
+
{% macro form_text(args) %}
|
|
169
|
+
{{ form_begin({columns:5}|assign(args)) }}
|
|
170
|
+
{{ text(args) }}
|
|
171
|
+
{{ form_end(args) }}
|
|
172
|
+
{% endmacro %}
|
|
173
|
+
|
|
174
|
+
{% macro textarea(args) %}
|
|
175
|
+
{% set markdown = args.markdown or false %}
|
|
176
|
+
{% set nospellcheck = args.nospellcheck or false %}
|
|
177
|
+
<div
|
|
178
|
+
name="form_item_{{ args.name }}"
|
|
179
|
+
{{ container_attr('textarea-container', args) }}
|
|
180
|
+
>
|
|
181
|
+
<textarea
|
|
182
|
+
name="{{ args.name }}"
|
|
183
|
+
placeholder="{{ args.placeholder }}"
|
|
184
|
+
{% if markdown %}data-markdown{% endif %}
|
|
185
|
+
{% if nospellcheck %}spellcheck="false"{% endif %}
|
|
186
|
+
{{ form_attr('textbox', args) }}
|
|
187
|
+
>{{ args.value }}</textarea>
|
|
188
|
+
</div>
|
|
189
|
+
{% endmacro %}
|
|
190
|
+
|
|
191
|
+
{% macro form_textarea(args) %}
|
|
192
|
+
{{ form_begin({columns:10}|assign(args)) }}
|
|
193
|
+
{{ textarea(args) }}
|
|
194
|
+
{{ form_end(args) }}
|
|
195
|
+
{% endmacro %}
|
|
196
|
+
|
|
197
|
+
{% macro checkbox(args) %}
|
|
198
|
+
<div
|
|
199
|
+
name="form_item_{{ args.name }}"
|
|
200
|
+
{{ container_attr('checkbox-container', args) }}
|
|
201
|
+
>
|
|
202
|
+
<label class="checkbox">
|
|
203
|
+
<input type="checkbox" name="{{ args.name }}"{% if args.value %} checked{% endif %}
|
|
204
|
+
{{ form_attr('checkbox', args) }}
|
|
205
|
+
>{% if args.placeholder %}{{ _(args.placeholder) }}{% endif %}
|
|
206
|
+
</label>
|
|
207
|
+
</div>
|
|
208
|
+
{% endmacro %}
|
|
209
|
+
|
|
210
|
+
{% macro form_checkbox(args) %}
|
|
211
|
+
{{ form_begin({columns:5}|assign(args)) }}
|
|
212
|
+
{{ checkbox(args) }}
|
|
213
|
+
{{ form_end(args) }}
|
|
214
|
+
{% endmacro %}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{% import "components/sidemenu.html" as sidemenu with context %}
|
|
2
|
+
{% macro render_sidebar() %}
|
|
3
|
+
<div class="section side">
|
|
4
|
+
<ol class="menu">
|
|
5
|
+
{{ sidemenu.render_item('account--circle', 'user_detail', {uid:handler.user._id}, label='My Profile') }}
|
|
6
|
+
{{ sidemenu.render_item('comment--multiple', 'home_messages') }}
|
|
7
|
+
<li class="menu__seperator"></li>
|
|
8
|
+
{{ sidemenu.render_item('web', 'home_settings', {category:'domain'}, label='Domain Settings', menu_item='home_domain') }}
|
|
9
|
+
{{ sidemenu.render_item('web', 'home_domain', label='My Domains', memu_item='home_domains') }}
|
|
10
|
+
{% if handler.user.hasPriv(PRIV.PRIV_CREATE_FILE) %}
|
|
11
|
+
<li class="menu__seperator"></li>
|
|
12
|
+
{{ sidemenu.render_item('file', 'home_files', label='My Files') }}
|
|
13
|
+
{% endif %}
|
|
14
|
+
<li class="menu__seperator"></li>
|
|
15
|
+
{{ sidemenu.render_item('wrench', 'home_settings', {category:'account'}, label='Account Settings', menu_item='home_account') }}
|
|
16
|
+
{{ sidemenu.render_item('sliders', 'home_settings', {category:'preference'}, label='Preference Settings', menu_item='home_preference')}}
|
|
17
|
+
{{ sidemenu.render_item('security', 'home_security') }}
|
|
18
|
+
</ol>
|
|
19
|
+
</div>
|
|
20
|
+
{% endmacro %}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% import "components/user.html" as user with context %}
|
|
2
|
+
{% macro render_time(tdoc_time) %}
|
|
3
|
+
{{ datetimeSpan(tdoc_time, false, 'YYYY-M-D H:mm')|safe }}
|
|
4
|
+
{% endmacro %}
|
|
5
|
+
|
|
6
|
+
{% macro render_extension(tdoc) %}
|
|
7
|
+
{{ ((tdoc['endAt'].getTime() - tdoc['penaltySince'].getTime())/ 1000 / 3600)|round(1) }}
|
|
8
|
+
{% endmacro %}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<div class="section side">
|
|
2
|
+
<div class="section__body typo">
|
|
3
|
+
<dl>
|
|
4
|
+
<dt>{{ _('Inline codes') }}</dt>
|
|
5
|
+
<dd><pre>`std::cout()`</pre></dd>
|
|
6
|
+
<dt>{{ _('Code blocks') }}</dt>
|
|
7
|
+
<dd><pre>```c++
|
|
8
|
+
int main() {
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
```</pre></dd>
|
|
12
|
+
<dt>{{ _('Inline formulas') }}</dt>
|
|
13
|
+
<dd><pre>$E=mc^2$</pre></dd>
|
|
14
|
+
<dt>{{ _('Formula blocks') }}</dt>
|
|
15
|
+
<dd><pre>$$E=mc^2$$</pre></dd>
|
|
16
|
+
<dt>{{ _('Links') }}</dt>
|
|
17
|
+
<dd><pre>[{{ _('Text') }}](https://...)</pre></dd>
|
|
18
|
+
<dt>{{ _('Highlight') }}</dt>
|
|
19
|
+
<dd><pre>=={{ _('Text') }}==</pre></dd>
|
|
20
|
+
<dt>{{ _('Images') }}</dt>
|
|
21
|
+
<dd><pre></pre></dd>
|
|
22
|
+
<dt>{{ _('Images With Size') }}</dt>
|
|
23
|
+
<dd><pre></pre></dd>
|
|
24
|
+
<dt>{{ _('Footnote') }}</dt>
|
|
25
|
+
<dd><pre>Here is a ref[^1].
|
|
26
|
+
|
|
27
|
+
[^1]: And the footnote.</pre></dd>
|
|
28
|
+
<dt>{{ _('Videos') }}</dt>
|
|
29
|
+
<dd><pre>@[video](https://.../a.mp4)</pre></dd>
|
|
30
|
+
<dt>{{ _('Mention')}}</dt>
|
|
31
|
+
<dd><pre>@[](/user/uid)</pre></dd>
|
|
32
|
+
</dl>
|
|
33
|
+
<h2>{{ _('Learn More') }}</h2>
|
|
34
|
+
<ul>
|
|
35
|
+
<li><a href="http://commonmark.org/help/" target="_blank"><span class="icon icon-link--external"></span> {{ _('CommonMark Syntax') }}</a></li>
|
|
36
|
+
<li><a href="http://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm" target="_blank"><span class="icon icon-link--external"></span> {{ _('LaTeX Expressions') }}</a></li>
|
|
37
|
+
</ul>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{% macro render() %}
|
|
2
|
+
{% if not isIE(handler.request.headers['user-agent']) and not handler.session.legacy %}
|
|
3
|
+
<noscript><div class="section__body no-padding">
|
|
4
|
+
<blockquote class="warn">
|
|
5
|
+
<p>{{ _('This page needs JavaScript to work.') }}</p>
|
|
6
|
+
</blockquote>
|
|
7
|
+
</div></noscript>
|
|
8
|
+
{% else %}
|
|
9
|
+
<div class="section__body no-padding">
|
|
10
|
+
<blockquote class="warn">
|
|
11
|
+
<p>{{ _('This page needs JavaScript to work.') }}</p>
|
|
12
|
+
</blockquote>
|
|
13
|
+
</div>
|
|
14
|
+
{% endif %}
|
|
15
|
+
{% endmacro %}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{% macro render(page, num_pages, add_qs='', position='bottom') %}
|
|
2
|
+
{% if num_pages > 0 %}
|
|
3
|
+
<ul class="pager pager-{{ position }}">
|
|
4
|
+
{%- for type, page0 in paginate(page, num_pages) -%}
|
|
5
|
+
<li>
|
|
6
|
+
{% if type == 'first' %}
|
|
7
|
+
<a class="pager__item first link" href="?page={{ page0 }}{% if add_qs %}&{{ add_qs }}{% endif %}">{{ _('pager_first') }}</a>
|
|
8
|
+
{% elif type == 'previous' %}
|
|
9
|
+
<a class="pager__item previous link" href="?page={{ page0 }}{% if add_qs %}&{{ add_qs }}{% endif %}">{{ _('pager_previous') }}</a>
|
|
10
|
+
{% elif type == 'ellipsis' %}
|
|
11
|
+
<span class="pager__item ellipsis">...</span>
|
|
12
|
+
{% elif type == 'page' %}
|
|
13
|
+
<a class="pager__item page link" href="?page={{ page0 }}{% if add_qs %}&{{ add_qs }}{% endif %}">{{ page0 }}</a>
|
|
14
|
+
{% elif type == 'current' %}
|
|
15
|
+
<span class="pager__item current">{{ page0 }}</span>
|
|
16
|
+
{% elif type == 'next' %}
|
|
17
|
+
<a class="pager__item next link" href="?page={{ page0 }}{% if add_qs %}&{{ add_qs }}{% endif %}">{{ _('pager_next') }}</a>
|
|
18
|
+
{% elif type == 'last' %}
|
|
19
|
+
<a class="pager__item last link" href="?page={{ page0 }}{% if add_qs %}&{{ add_qs }}{% endif %}">{{ _('pager_last') }}</a>
|
|
20
|
+
{% endif %}
|
|
21
|
+
</li>
|
|
22
|
+
{%- endfor -%}
|
|
23
|
+
</ul>
|
|
24
|
+
{% endif %}
|
|
25
|
+
{% endmacro %}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{% macro render_problem_title(pdoc, tdoc=none, show_tags=true, show_invisible_flag=true, invalid=false, inline=false, show_pid=true, small=false, alphabetic=false) %}
|
|
2
|
+
{%- if not invalid -%}
|
|
3
|
+
{% set _linkArgs = { pid:pdoc.pid|default(pdoc.docId) } %}
|
|
4
|
+
{% if tdoc %}{{ set(_linkArgs, 'query', {tid:tdoc.docId}) }}{% endif %}
|
|
5
|
+
<a href="{{ url('problem_detail', _linkArgs) }}"{% if small %} data-tooltip="{{ pdoc.title }}"{% endif %}>
|
|
6
|
+
{%- endif -%}
|
|
7
|
+
{% if show_pid %}
|
|
8
|
+
<b>{%- if tdoc and alphabetic -%}{{ utils.getAlphabeticId(tdoc.pids.indexOf(pdoc.docId)) }}
|
|
9
|
+
{%- elif pdoc.pid and pdoc.pid.includes('-') -%}{{ pdoc.pid.split('-').join('#') }}
|
|
10
|
+
{%- else -%}{{ pdoc.pid|default(pdoc.docId) }}{%- endif -%}</b>
|
|
11
|
+
{% endif %}
|
|
12
|
+
{%- if not small -%}{% if show_pid %} {% endif %}{{ pdoc.title }}{%- endif -%}
|
|
13
|
+
{%- if not invalid -%}
|
|
14
|
+
</a>
|
|
15
|
+
{%- endif -%}
|
|
16
|
+
{%- if pdoc.hidden and show_invisible_flag -%}
|
|
17
|
+
<span class="text-orange">({{ _('Hidden') }})</span>
|
|
18
|
+
{%- endif -%}
|
|
19
|
+
{%- if show_tags -%}{{ render_problem_tags(pdoc, inline=inline) }}{%- endif -%}
|
|
20
|
+
{% endmacro %}
|
|
21
|
+
|
|
22
|
+
{% macro render_problem_tags(pdoc, show_none_label=false, inline=false) %}
|
|
23
|
+
{%- if pdoc.tag|length > 0 %}
|
|
24
|
+
{%- if not inline %}<ul class="problem__tags">{% endif -%}
|
|
25
|
+
{%- for tag in pdoc['tag'] %}
|
|
26
|
+
{% set _w = '"' if tag and tag.includes(' ') else '' %}
|
|
27
|
+
<li class="problem__tag"><a class="problem__tag-link" href="{{ url('problem_main', query={q:'category:'+_w+tag+_w}) }}">{{ tag }}</a></li>
|
|
28
|
+
{%- endfor -%}
|
|
29
|
+
{%- if not inline %}</ul>{% endif -%}
|
|
30
|
+
{%- else -%}
|
|
31
|
+
{%- if show_none_label -%}{{ _('(None)') }}{%- endif -%}
|
|
32
|
+
{%- endif -%}
|
|
33
|
+
{% endmacro %}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% macro render_status_td(rdoc, rid_key='_id', class='', allDomain=false, short=false, displayScore) %}
|
|
2
|
+
<td class="col--status record-status--border {{ class }} {{ model.builtin.STATUS_CODES[rdoc.status] }}">
|
|
3
|
+
<div class="col--status__text">
|
|
4
|
+
<span class="icon record-status--icon {{ model.builtin.STATUS_CODES[rdoc.status] }}"></span>
|
|
5
|
+
<a
|
|
6
|
+
href="{{ url('record_detail', rid=rdoc[rid_key], domainId=rdoc.domainId) if allDomain else url('record_detail', rid=rdoc[rid_key]) }}"
|
|
7
|
+
class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.status] }}"
|
|
8
|
+
>
|
|
9
|
+
{% if typeof(rdoc['score']) == 'number' %}
|
|
10
|
+
<span style="color: {{ utils.status.getScoreColor(rdoc.score|default(0)) }}">{{ displayScore|default(rdoc.score|default(0)) }}</span>
|
|
11
|
+
{% endif %}
|
|
12
|
+
{{ model.builtin.STATUS_SHORT_TEXTS[rdoc.status] if short else model.builtin.STATUS_TEXTS[rdoc.status] }}
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
{% if rdoc.status == STATUS.STATUS_JUDGING %}
|
|
16
|
+
<div class="col--status__progress-container">
|
|
17
|
+
<div class="col--status__progress" style="width: {{ rdoc['progress']|default(50)|int }}%"></div>
|
|
18
|
+
</div>
|
|
19
|
+
{% endif %}
|
|
20
|
+
</td>
|
|
21
|
+
{% endmacro %}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% macro render_item(icon_name, page_name, args={}, label=none, menu_item=none) %}
|
|
2
|
+
{% set target_url = url(page_name, args) if page_name else '#' %}
|
|
3
|
+
<li class="menu__item" id="menu-item-{{ menu_item or page_name }}">
|
|
4
|
+
<a href="{{ target_url }}" class="menu__link{% if handler.request.path == target_url %} active{% endif %}">
|
|
5
|
+
{% if icon_name %}
|
|
6
|
+
<span class="icon icon-{{ icon_name }}"></span>
|
|
7
|
+
{% endif %}
|
|
8
|
+
{{ _(label or page_name) }}
|
|
9
|
+
</a>
|
|
10
|
+
</li>
|
|
11
|
+
{% endmacro %}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{% macro render_inline(udoc, avatar=true, badge=true, modbadge=true, levelbadge=true) %}
|
|
2
|
+
{% if udoc %}
|
|
3
|
+
<span class="user-profile-link">
|
|
4
|
+
{% if avatar %}
|
|
5
|
+
<img class="small user-profile-avatar v-center" loading="lazy" src="{{ avatarUrl(udoc.avatar|default('')) }}" width="20" height="20">
|
|
6
|
+
{% endif %}
|
|
7
|
+
<a class="user-profile-name uname--lv{{ udoc.level|default(0) }}" href="{{ url('user_detail', uid=udoc._id) }}">
|
|
8
|
+
{% if handler.user.hasPerm(perm.PERM_VIEW_USER_PRIVATE_INFO) and udoc.displayName and udoc.displayName != udoc.uname %}
|
|
9
|
+
{{ udoc.displayName }} ({{ udoc.uname }})
|
|
10
|
+
{% else %}
|
|
11
|
+
{{ udoc.uname }}
|
|
12
|
+
{% endif %}
|
|
13
|
+
</a>
|
|
14
|
+
{% if badge %}
|
|
15
|
+
{% if udoc.badge %}
|
|
16
|
+
{% set _badge = udoc.badge.split('#') %}
|
|
17
|
+
{% if _badge[0] == 'img' %}
|
|
18
|
+
<img src="{{ _badge[1] }}" class="user-profile-badge v-center" style="vertical-align:bottom;" data-tooltip="{{ _badge[2] }}" alt="{{ _badge[2] }}">
|
|
19
|
+
{% else %}
|
|
20
|
+
<span class="user-profile-badge v-center" style="background-color:#{{ _badge[1] }}{% if _badge[2] %};color:#{{ _badge[2] }}{% endif %}">{{ _badge[0] }}</span>
|
|
21
|
+
{% endif %}
|
|
22
|
+
{% endif %}
|
|
23
|
+
{% if levelbadge and udoc.level %}
|
|
24
|
+
{% set level = udoc.level %}
|
|
25
|
+
<a class="user-profile-badge v-center badge--lv{{ level }}" href="{{ url('user_detail', uid=udoc._id) }}" data-tooltip="{{ _('LV '+ level) }}: Top {{ model.builtin.LEVELS[level]|default('N/A') }}%">{{ _('LV '+ level) }}</a>
|
|
26
|
+
{% endif %}
|
|
27
|
+
{% if modbadge %}
|
|
28
|
+
{% if udoc.hasPriv(PRIV.PRIV_MOD_BADGE) %}
|
|
29
|
+
<span class="user-profile-badge v-center badge--su" data-tooltip="{{ _('SuperUser') }}">SU</span>
|
|
30
|
+
{% elif udoc.hasPerm(perm.PERM_MOD_BADGE) %}
|
|
31
|
+
<span class="user-profile-badge v-center badge--mod" data-tooltip="{{ _('Moderator') }}">MOD</span>
|
|
32
|
+
{% endif %}
|
|
33
|
+
{% endif %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
</span>
|
|
36
|
+
{% else %}
|
|
37
|
+
<span class="user-profile-link">
|
|
38
|
+
{% if avatar %}
|
|
39
|
+
<img class="small user-profile-avatar v-center" src="{{ UiContext.cdn_prefix }}img/avatar.png" width="20" height="20">
|
|
40
|
+
{% endif %}
|
|
41
|
+
<a class="user-profile-name" href="#">
|
|
42
|
+
{{ _('Unknown User') }}
|
|
43
|
+
</a>
|
|
44
|
+
{% if badge %}
|
|
45
|
+
<a class="user-profile-badge v-center badge--lv0" href="#" title="LV0">LV 0</a>
|
|
46
|
+
{% endif %}
|
|
47
|
+
</span>
|
|
48
|
+
{% endif %}
|
|
49
|
+
{% endmacro %}
|