This commit is contained in:
cuom1999 2024-01-29 20:43:28 -06:00
parent e22061fc84
commit 4b6ba43c42
3 changed files with 31 additions and 11 deletions

View file

@ -280,12 +280,18 @@ function registerPopper($trigger, $dropdown) {
function populateCopyButton() { function populateCopyButton() {
var copyButton; var copyButton;
$('pre code').each(function () { $('pre code').each(function () {
var copyButton = $('<span>', {
'class': 'btn-clipboard',
'data-clipboard-text': $(this).text(),
'title': 'Click to copy'
}).append('<i class="fa fa-copy"></i>');
if ($(this).parent().width() > 100) {
copyButton.append('<span style="margin-left: 2px">Copy</span>');
}
$(this).before($('<div>', {'class': 'copy-clipboard'}) $(this).before($('<div>', {'class': 'copy-clipboard'})
.append(copyButton = $('<span>', { .append(copyButton));
'class': 'btn-clipboard',
'data-clipboard-text': $(this).text(),
'title': 'Click to copy'
}).append('<i class="fa fa-copy"></i><span style="margin-left: 2px">Copy</span>')));
$(copyButton.get(0)).mouseleave(function () { $(copyButton.get(0)).mouseleave(function () {
$(this).attr('class', 'btn-clipboard'); $(this).attr('class', 'btn-clipboard');

View file

@ -173,7 +173,7 @@ pre {
@media (min-width: 800px) { @media (min-width: 800px) {
.content-description pre:has(code) { .content-description pre:has(code) {
min-width: 20em; min-width: 3em;
} }
#common-content { #common-content {
display: flex; display: flex;

View file

@ -78,11 +78,19 @@
</form> </form>
{% endif %} {% endif %}
<div style="clear: both"></div> <div style="clear: both"></div>
<div class="content-description">
{% cache 3600 'contest_html' contest.id MATH_ENGINE %} {% if contest.is_organization_private %}
{{ contest.description|markdown|reference|str|safe }} {% for org in contest.organizations.all() %}
{% endcache %} <div style="margin-bottom: 1em;">
</div> <span class="contest-tag contest-tag-org">
<a href="{{ org.get_absolute_url() }}">
<i class="fa fa-lock"></i> {{ org.name }}
</a>
</span>
</div>
{% endfor %}
{% endif %}
{% if editable_organizations or is_clonable %} {% if editable_organizations or is_clonable %}
<div style="display: flex; gap: 0.5em;"> <div style="display: flex; gap: 0.5em;">
{% for org in editable_organizations %} {% for org in editable_organizations %}
@ -96,6 +104,12 @@
</div> </div>
{% endif %} {% endif %}
<div style="padding: 0 1em;">
{% cache 3600 'contest_html' contest.id MATH_ENGINE %}
{{ contest.description|markdown|reference|str|safe }}
{% endcache %}
</div>
{% if contest.ended or request.user.is_superuser or is_editor or is_tester %} {% if contest.ended or request.user.is_superuser or is_editor or is_tester %}
<hr> <hr>
<div class="contest-problems"> <div class="contest-problems">