diff --git a/resources/common.js b/resources/common.js index 38db21b..910efef 100644 --- a/resources/common.js +++ b/resources/common.js @@ -280,12 +280,18 @@ function registerPopper($trigger, $dropdown) { function populateCopyButton() { var copyButton; $('pre code').each(function () { + var copyButton = $('', { + 'class': 'btn-clipboard', + 'data-clipboard-text': $(this).text(), + 'title': 'Click to copy' + }).append(''); + + if ($(this).parent().width() > 100) { + copyButton.append('Copy'); + } + $(this).before($('
', {'class': 'copy-clipboard'}) - .append(copyButton = $('', { - 'class': 'btn-clipboard', - 'data-clipboard-text': $(this).text(), - 'title': 'Click to copy' - }).append('Copy'))); + .append(copyButton)); $(copyButton.get(0)).mouseleave(function () { $(this).attr('class', 'btn-clipboard'); diff --git a/resources/content-description.scss b/resources/content-description.scss index b13cd35..e299697 100644 --- a/resources/content-description.scss +++ b/resources/content-description.scss @@ -173,7 +173,7 @@ pre { @media (min-width: 800px) { .content-description pre:has(code) { - min-width: 20em; + min-width: 3em; } #common-content { display: flex; diff --git a/templates/contest/contest.html b/templates/contest/contest.html index a1e9f72..1b454dc 100644 --- a/templates/contest/contest.html +++ b/templates/contest/contest.html @@ -78,11 +78,19 @@ {% endif %}
-
- {% cache 3600 'contest_html' contest.id MATH_ENGINE %} - {{ contest.description|markdown|reference|str|safe }} - {% endcache %} -
+ + {% if contest.is_organization_private %} + {% for org in contest.organizations.all() %} +
+ + + {{ org.name }} + + +
+ {% endfor %} + {% endif %} + {% if editable_organizations or is_clonable %}
{% for org in editable_organizations %} @@ -96,6 +104,12 @@
{% endif %} +
+ {% cache 3600 'contest_html' contest.id MATH_ENGINE %} + {{ contest.description|markdown|reference|str|safe }} + {% endcache %} +
+ {% if contest.ended or request.user.is_superuser or is_editor or is_tester %}