Skip to content

Commit

Permalink
Fix setting time config and make various language changes in config p…
Browse files Browse the repository at this point in the history
…anel (CTFd#2542)

* Fix setting time config and make various language changes in config
panel

* Small language fixes
  • Loading branch information
ColdHeat authored May 23, 2024
1 parent c1f657e commit ea6aa3f
Show file tree
Hide file tree
Showing 16 changed files with 59 additions and 65 deletions.
2 changes: 1 addition & 1 deletion CTFd/forms/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ResetInstanceForm(BaseForm):
class AccountSettingsForm(BaseForm):
domain_whitelist = StringField(
"Email Domain Allowlist",
description="Comma-seperated list of allowable email domains which users can register under (e.g. gmail.com, example.com, *.example.com)",
description="Comma-seperated list of allowable email domains which users can register under (e.g. examplectf.com, example.com, *.example.com)",
)
team_creation = SelectField(
"Team Creation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
<div class="form-group">
<label>Bracket Name</label>
<input type="text" class="form-control" v-model.lazy="bracket.name" />
<small class="form-text text-muted"
>Bracket name (such as "Interns", "IT engineers", or "CS04
students")</small
>
<small class="form-text text-muted">
Bracket name (e.g. "Students", "Interns", "Engineers")
</small>
</div>
</div>

Expand All @@ -42,10 +41,10 @@
<option value="users">Users</option>
<option value="teams">Teams</option>
</select>
<small class="form-text text-muted"
>If you are using Team Mode and would like the bracket to apply to
entire teams instead of individuals, select Teams.</small
>
<small class="form-text text-muted">
If you are using Team Mode and would like the bracket to apply to
entire teams instead of individuals, select Teams.
</small>
</div>
</div>

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CTFd/themes/admin/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
]
},
"assets/js/pages/configs.js": {
"file": "assets/pages/configs-CkTkz6V1.js",
"file": "assets/pages/configs-CJmOQB5a.js",
"src": "assets/js/pages/configs.js",
"isEntry": true,
"imports": [
Expand Down
12 changes: 6 additions & 6 deletions CTFd/themes/admin/templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ <h1>Configuration</h1>
<i class="fa fa-users action-icon"></i>Accounts
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 py-1" href="#usermode" role="tab" data-toggle="tab">
<i class="fa fa-people-arrows action-icon"></i>User Mode
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 py-1" href="#brackets" role="tab" data-toggle="tab">
<i class="fa fa-chart-line action-icon"></i>Scoreboard Brackets
Expand Down Expand Up @@ -127,7 +122,7 @@ <h1>Configuration</h1>
<!-- Plugins -->
{% set plugins = get_configurable_plugins() %}
{% if plugins %}
<small class="section-title">Plugins</small>
<small class="section-title">Plugins</small>
{% for plugin in plugins %}
{% if plugin.config %}
<li class="nav-item">
Expand All @@ -141,6 +136,11 @@ <h1>Configuration</h1>

<!-- Reset -->
<small class="section-title">Danger zone</small>
<li class="nav-item">
<a class="nav-link rounded-0 py-1" href="#usermode" role="tab" data-toggle="tab">
<i class="fa fa-people-arrows action-icon"></i>User Mode
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-0 py-1" href="{{ url_for('admin.reset') }}" role="tab">
<i class="fa fa-trash-can action-icon"></i>Reset
Expand Down
2 changes: 1 addition & 1 deletion CTFd/themes/admin/templates/configs/accounts.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div role="tabpanel" class="tab-pane config-section" id="accounts">

{% set verify_emails = "true" if verify_emails == True else "false" %}
{% set verify_emails = "true" if verify_emails == True else "false" %}
{% set name_changes = "true" if name_changes == True else "false" %}
{% set team_creation = "false" if team_creation == False else "true" %}
{% with form = Forms.config.AccountSettingsForm(verify_emails=verify_emails, name_changes=name_changes, team_disbanding=team_disbanding, team_creation=team_creation) %}
Expand Down
8 changes: 3 additions & 5 deletions CTFd/themes/admin/templates/configs/backup.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<div role="tabpanel" class="tab-pane config-section" id="backup">
<ul class="nav nav-tabs mb-3" role="tablist">
<li class="nav-item">
<a class="nav-link active" href="#export-ctf" aria-controls="export-ctf" role="tab"
data-toggle="tab">Export</a>
<a class="nav-link active" href="#export-ctf" aria-controls="export-ctf" role="tab" data-toggle="tab">Export</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#import-ctf" aria-controls="import-ctf" role="tab" data-toggle="tab">Import</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#save-csv" aria-controls="save-csv" role="tab" data-toggle="tab">Download CSV</a>
<a class="nav-link" href="#save-csv" aria-controls="save-csv" role="tab" data-toggle="tab">Download CSV</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#import-csv" aria-controls="import-csv" role="tab" data-toggle="tab">Import CSV</a>
<a class="nav-link" href="#import-csv" aria-controls="import-csv" role="tab" data-toggle="tab">Import CSV</a>
</li>
</ul>
<div class="tab-content">
Expand Down Expand Up @@ -47,7 +46,6 @@
<div role="tabpanel" class="tab-pane" id="save-csv">
<div class="alert alert-warning" role="alert">
<small class="text-muted text-right">
<!-- TODO: Alert icon borked -->
<i class="fas fa-exclamation pr-2"></i>
CSVs exported from CTFd are not guaranteed to import back in via the Import CSV functionality. See <a href="https://docs.ctfd.io/docs/imports/csv/" target="_blank">CSV Importing instructions</a> for details.
</small>
Expand Down
8 changes: 4 additions & 4 deletions CTFd/themes/admin/templates/configs/email.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h5>Email notifications</h5>
<div role="tabpanel" class="tab-pane active" id="email-server-tab">
<div class="form-group">
<label class="pt-3">
Sending Address<br>
Mail From Address<br>
<small class="form-text text-muted">
Email address used to send email
</small>
Expand Down Expand Up @@ -126,7 +126,7 @@ <h5>Email notifications</h5>
</small>
</label>
<input class="form-control" id='mailgun_base_url' name='mailgun_base_url' type='text'
{% if mailgun_base_url is defined and mailgun_base_url != None %}value="{{ mailgun_base_url }}"{% endif %}>
{% if mailgun_base_url is defined and mailgun_base_url != None %}value="{{ mailgun_base_url }}"{% endif %}>
</div>
<div class="form-group">
<label>
Expand All @@ -136,7 +136,7 @@ <h5>Email notifications</h5>
</small>
</label>
<input class="form-control" id='mailgun_api_key' name='mailgun_api_key' type='text'
{% if mailgun_api_key is defined and mailgun_api_key != None %}value="{{ mailgun_api_key }}"{% endif %}>
{% if mailgun_api_key is defined and mailgun_api_key != None %}value="{{ mailgun_api_key }}"{% endif %}>
</div>
</div>
<div role="tabpanel" class="tab-pane" id="registration-email-tab">
Expand Down Expand Up @@ -189,7 +189,7 @@ <h5>Email notifications</h5>
<label class="pt-3">
New Account Details<br>
<small class="form-text text-muted">
Email sent to new users <i>manually created by an admin</i> with their initial account details
Email sent to new users <i>(manually created by an admin)</i> with their initial account details
</small>
</label>
<div>
Expand Down
6 changes: 3 additions & 3 deletions CTFd/themes/admin/templates/configs/general.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<form method="POST" autocomplete="off" class="w-100">
<div class="form-group">
<label for="ctf_name">
Competition Name
Event Name
<small class="form-text text-muted">When no logo is specified, the CTF's name is used instead.</small>
</label>
<input class="form-control" id='ctf_name' name='ctf_name' type='text' placeholder="CTF Name"
{% if ctf_name is defined and ctf_name != None %}value="{{ ctf_name }}"{% endif %}>
{% if ctf_name is defined and ctf_name != None %}value="{{ ctf_name }}"{% endif %}>
</div>

<div class="form-group">
<label>
Competition Description<br>
Event Description<br>
<!-- TODO: Clarify WHERE this description is used. -->
<small class="form-text text-muted">
Description of your CTF. Available for use on your custom pages and emails as <code>{ctf_description}</code>.
Expand Down
10 changes: 4 additions & 6 deletions CTFd/themes/admin/templates/configs/mlc.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ <h6>
<label>
Client ID
</label>
<input class="form-control" id='oauth_client_id' name='oauth_client_id' type='text'
placeholder=""
{% if oauth_client_id is defined and oauth_client_id != None %}value="{{ oauth_client_id }}"{% endif %}>
<input class="form-control" id='oauth_client_id' name='oauth_client_id' type='text' placeholder=""
{% if oauth_client_id is defined and oauth_client_id != None %}value="{{ oauth_client_id }}"{% endif %}>
</div>

<div class="form-group">
<label>
Client Secret
</label>
<input class="form-control" id='oauth_client_secret' name='oauth_client_secret' type='text'
placeholder=""
{% if oauth_client_secret is defined and oauth_client_secret != None %}value="{{ oauth_client_secret }}"{% endif %}>
<input class="form-control" id='oauth_client_secret' name='oauth_client_secret' type='text' placeholder=""
{% if oauth_client_secret is defined and oauth_client_secret != None %}value="{{ oauth_client_secret }}"{% endif %}>
</div>

<button type="submit" class="btn btn-md btn-primary float-right">Update</button>
Expand Down
1 change: 0 additions & 1 deletion CTFd/themes/admin/templates/configs/pause.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div role="tabpanel" class="tab-pane config-section" id="pause">
<form method="POST" autocomplete="off" class="w-100">
<div class="form-group">
<!-- TODO: Should this be a checkbox?? -->
<div class="form-check pl-0">
<label>
<input id="paused" name="paused" type="checkbox" {% if paused %}checked{% endif %}>
Expand Down
2 changes: 1 addition & 1 deletion CTFd/themes/admin/templates/configs/registration_code.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<small class="form-text text-muted">Registration Code required for account registration (SSO excluded)</small>
</label>
<input class="form-control" id='registration_code' name='registration_code' type='text' placeholder="Registration Code"
{% if registration_code is defined and registration_code != None %}value="{{ registration_code }}"{% endif %}>
{% if registration_code is defined and registration_code != None %}value="{{ registration_code }}"{% endif %}>
</div>

<button type="submit" class="btn btn-md btn-primary float-right">Update</button>
Expand Down
2 changes: 1 addition & 1 deletion CTFd/themes/admin/templates/configs/robots.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div role="tabpanel" class="tab-pane config-section" id="robots">
<form method="POST" enctype="multipart/form-data">
<form method="POST" enctype="multipart/form-data">
<div class="form-group">
<label>
Robots.txt
Expand Down
8 changes: 4 additions & 4 deletions CTFd/themes/admin/templates/configs/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h5 class="modal-title">Theme Settings</h5>
<form method="POST" autocomplete="off" class="w-100">
<div class="form-group">
<label for="ctf_theme">
Base Theme
Theme
<small class="form-text text-muted">
Switch themes to change CTFd's aesthetics
</small>
Expand All @@ -33,7 +33,7 @@ <h5 class="modal-title">Theme Settings</h5>
<label>
Primary Color
<small class="form-text text-muted">
Base color used for the navigation bar. Requires theme support.
Base color used for theme features. Requires theme support.
</small>
</label>
<div>
Expand All @@ -46,7 +46,7 @@ <h5 class="modal-title">Theme Settings</h5>
</div>
<div class="form-group">
<label>
HTML Header
Theme Header
<small class="form-text text-muted">
Theme headers are inserted just before the <code>&lt;/head&gt;</code> tag on all public facing pages.
Requires theme support.
Expand All @@ -58,7 +58,7 @@ <h5 class="modal-title">Theme Settings</h5>

<div class="form-group">
<label>
HTML Footer
Theme Footer
<small class="form-text text-muted">
Theme footers are inserted just before the <code>&lt;/body&gt;</code> tag on all public facing pages.
Requires theme support.
Expand Down
36 changes: 18 additions & 18 deletions CTFd/themes/admin/templates/configs/time.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,26 @@

<!-- TODO: Better Timezone options (e.g. with UTC offset info like "UTC+1")-->
<div class="form-group col-md-12">
<label for="start-timezone">CTF Timezone:</label>
<label for="start-timezone">Timezone:</label>
<select class="form-control custom-select start-date" id="start-timezone">
</select>
</div>

<!-- TODO: Clarify via UI that user cannot touch these fields -->
<div class="form-group col-md-12">
<label for="start-local">Your Local Time:</label>
<input class="form-control" id='start-local' type='text' readonly disabled>
<label for="start-local">Local Time:</label>
<input class="form-control" id='start-local' type='text' readonly>
</div>

<div class="form-group col-md-12">
<label for="start-zonetime">CTF Local Time:</label>
<input class="form-control" id='start-zonetime' type='text' readonly disabled>
<label for="start-zonetime">Timezone Time:</label>
<input class="form-control" id='start-zonetime' type='text' readonly>
</div>

<div class="form-group col-md-12">
<label>UTC Timestamp:</label>
<input class="form-control" id='start' name='start' type='number'
{% if start is defined and start != None %}value="{{ start }}"{% endif %} readonly disabled>
{% if start is defined and start != None %}value="{{ start }}"{% endif %} readonly>
</div>
</div>
</div>
Expand Down Expand Up @@ -112,7 +112,7 @@
</div>

<div class="form-group col-md-12">
<label for="end-timezone">CTF Timezone:</label>
<label for="end-timezone">Timezone:</label>
<select class="form-control custom-select end-date" id="end-timezone">
</select>
</div>
Expand All @@ -123,7 +123,7 @@
<div class="form-check pl-0">
<label>
<input id="view_after_ctf" name="view_after_ctf" type="checkbox" {% if view_after_ctf %}checked{% endif %}>
View After CTF
View After CTF
<small class="form-text text-muted">
Allows challenges to be viewed after the End Time, however no new submissions will be recorded.<br>
For participants to be able to submit after End Time but not alter the scoreboard, configure Freeze Time to be your End Time.
Expand All @@ -133,19 +133,19 @@
</div>

<div class="form-group col-md-12">
<label for="end-local">Your Local Time:</label>
<input class="form-control" id='end-local' type='text' readonly disabled>
<label for="end-local">Local Time:</label>
<input class="form-control" id='end-local' type='text' readonly>
</div>

<div class="form-group col-md-12">
<label for="end-zonetime">CTF Local Time:</label>
<input class="form-control" id='end-zonetime' type='text' readonly disabled>
<label for="end-zonetime">Timezone Time:</label>
<input class="form-control" id='end-zonetime' type='text' readonly>
</div>

<div class="form-group col-md-12">
<label for="end">UTC Timestamp:</label>
<input class="form-control" id='end' name='end' type='number'
{% if end is defined and end != None %}value="{{ end }}"{% endif %} readonly disabled>
{% if end is defined and end != None %}value="{{ end }}"{% endif %} readonly>
</div>
</div>
</div>
Expand Down Expand Up @@ -192,19 +192,19 @@

<!-- TODO: Clarify -->
<div class="form-group col-md-12">
<label for="freeze-local">Your Local Time:</label>
<input class="form-control" id='freeze-local' type='text' readonly disabled>
<label for="freeze-local">Local Time:</label>
<input class="form-control" id='freeze-local' type='text' readonly>
</div>

<div class="form-group col-md-12">
<label for="freeze-zonetime">CTF Local Time:</label>
<input class="form-control" id='freeze-zonetime' type='text' readonly disabled>
<label for="freeze-zonetime">Timezone Time:</label>
<input class="form-control" id='freeze-zonetime' type='text' readonly>
</div>

<div class="form-group col-md-12">
<label for="freeze">UTC Timestamp:</label>
<input class="form-control" id='freeze' name='freeze' type='number'
{% if freeze is defined and freeze != None %}value="{{ freeze }}"{% endif %} readonly disabled>
{% if freeze is defined and freeze != None %}value="{{ freeze }}"{% endif %} readonly>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions CTFd/themes/admin/templates/configs/usermode.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<form id="user-mode-form" method="POST" autocomplete="off" class="w-100 custom-config-form">
<div class="form-group">
<label for="ctf_name">
User Play Mode
User Mode
<small class="form-text text-muted">Controls whether users play as themselves (User Mode) or join together as teams (Team Mode).</small>
</label>

Expand Down Expand Up @@ -47,7 +47,7 @@ <h5>User Mode</h5>
<li>Players can share accounts to form pseudo-teams</li>
<br>
<li>Easier to organize</li>
<li>Difficult to attribute solutions to individuals on pseudo-teams</li>
<li>Difficult to attribute solutions to individual team members</li>
</ul>
</div>
</span>
Expand All @@ -60,7 +60,7 @@ <h5>User Mode</h5>

<div class="alert alert-danger text-center" role="alert">
<p>
<strong>Changing your user mode will delete all submissions or records of user actions.</strong>
<strong>Changing your user mode will also delete all submissions or records that a user took an action.</strong>
<br><small>(Submissions, Awards, Unlocks, Tracking)</small>
</p>
</div>
Expand Down

0 comments on commit ea6aa3f

Please sign in to comment.