Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions src/static/riot/competitions/detail/_header.tag
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</div>
<div class="row">
<div class="column">
<!-- Main information -->
<div>
<span class="detail-label">Organized by:</span>
<span class="detail-item">{competition.created_by}</span>
Expand All @@ -44,10 +45,19 @@
<span class="detail-label">Current server time:</span>
<span class="detail-item" id="server_time">{pretty_date(CURRENT_DATE_TIME)}</span>
</div>
<!-- Docker image -->
<div class="competition-secret-key">
<span class="docker-label">Docker image:</span>
<span id="docker-image">{ competition.docker_image }</span>
<span onclick="{copy_docker_url}" class="ui send-pop-docker" data-content="Copied!">
<i class="ui copy icon"></i>
</span>
</div>
<!-- Secret URL -->
<div class="competition-secret-key" if="{ competition.admin }">
<span class="secret-label">Secret url:</span>
<span id="secret-url">https://{ URLS.SECRET_KEY_URL(competition.id, competition.secret_key) }</span>
<span onclick="{copy_secret_url}" class="ui send-pop" data-content="Copied!">
<span onclick="{copy_secret_url}" class="ui send-pop-secret" data-content="Copied!">
<i class="ui copy icon"></i>
</span>
</div>
Expand Down Expand Up @@ -207,7 +217,17 @@
window.getSelection().addRange(range); // to select text
document.execCommand("copy");
window.getSelection().removeAllRanges();// to deselect
$('.send-pop').popup('toggle')
$('.send-pop-secret').popup('toggle')
}

self.copy_docker_url = function () {
let range = document.createRange();
range.selectNode(document.getElementById("docker-image"));
window.getSelection().removeAllRanges(); // clear current selection
window.getSelection().addRange(range); // to select text
document.execCommand("copy");
window.getSelection().removeAllRanges();// to deselect
$('.send-pop-docker').popup('toggle')
}

self.get_end_date = function (competition) {
Expand All @@ -232,6 +252,7 @@
$blue = #2c3f4c
$teal = #00bbbb
$lightblue = #f2faff
$red = #DB2828

.detail-label
font-size 1.25em
Expand All @@ -249,7 +270,10 @@
font-size 13px

.secret-label
color #DB2828
color $red

.docker-label
color $teal

.secret-url
color $blue
Expand Down