-
-
Notifications
You must be signed in to change notification settings - Fork 470
core&ui: contest can limit submission language #1007
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f21c6ea
core&ui: contest can limit submission language
bhscer 51f7a66
fix existed problems && replace checkboxs with selectAutoComplete
bhscer 2617b47
remove debug outputs && better code style
bhscer 102bbac
make eslint happy
bhscer eff7801
core&ui: support limit language in homework
bhscer da38fa5
fix a bug on get language list
bhscer 33281bf
core&ui: change the logic
bhscer 2ad088f
objective or submit_answer problem should skip language limit
bhscer bb011cc
use a simpler way
bhscer b461eb1
fix: ProblemConfig page will make dead loop on trying to add a nonexi…
bhscer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,44 @@ <h2 class="section__title">{{ _('Basic Info') }}</h2> | |
| markdown:true | ||
| }) }} | ||
| </div> | ||
| <div class="section__body"> | ||
| <div class="row"> | ||
| {{ form.form_checkbox({ | ||
| columns:9, | ||
| label:'Limit language', | ||
| name:'limitLang', | ||
| placeholder:_('Limit contest submission language'), | ||
| value:isLimitLang, | ||
| row:false, | ||
| disabled:true | ||
| }) }} | ||
| <div class="medium-3 columns" id="limitLang_btnBox" {% if not isLimitLang %}style="display:none;"{% endif %}> | ||
| <button type="button" class=" button" id="limitLangBtn_selectAll"> | ||
| {{ _('Select All') }} | ||
| </button> | ||
| <button type="button" class=" button" id="limitLangBtn_selectNone"> | ||
| {{ _('Select None') }} | ||
| </button> | ||
| </div> | ||
| </div> | ||
| <div id="limitLangListBox" {% if not isLimitLang %}style="display:none;"{% endif %}> | ||
| <div> | ||
| <p>对于有子类的语言,勾选时请详细至子分类!</p><br /> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace hard-coded Chinese text with localized string. The Chinese text should be replaced with a localized string to support internationalization. - <p>对于有子类的语言,勾选时请详细至子分类!</p><br />
+ <p>{{ _('For languages with subcategories, please select specific subcategories when checking!') }}</p><br />You'll also need to add the corresponding translation to the localization files. 🤖 Prompt for AI Agents |
||
| </div> | ||
| <div class="row"> | ||
| {%- for k, v, enabled in langList -%} | ||
| <div class="medium-3 columns"> | ||
| <div name="form_item_limitLangList" class="checkbox-container"> | ||
| <label class="checkbox"> | ||
| <input type="checkbox" {% if enabled %}checked{% endif %} class="checkbox limitLangListItem" value="{{k}}" disabled>{{v}} | ||
| </label> | ||
| </div> | ||
| </div> | ||
| {%- endfor -%} | ||
| </div> | ||
| </div> | ||
| <input type="hidden" name="limitLangList" value="{{limitLangListString}}"> | ||
| </div> | ||
| <div style="padding-top: 0" class="section__header"> | ||
| <h2 class="section__title">{{ _('Permission Control') }}</h2> | ||
| </div> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix checkbox manipulation to use proper jQuery methods.
The current approach to setting checkbox states is incorrect and may not work consistently across browsers.
$('#limitLangBtn_selectAll').on('click', () => { $('.limitLangListItem').each(function () { - $(this).attr('checked', 'true'); + $(this).prop('checked', true); }); + $('.limitLangListItem').trigger('change'); }); $('#limitLangBtn_selectNone').on('click', () => { $('.limitLangListItem').each(function () { - $(this).removeAttr('checked'); + $(this).prop('checked', false); }); + $('.limitLangListItem').trigger('change'); });🤖 Prompt for AI Agents