Skip to content
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

Add ranking freeze feature #7

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.7'

services:
client:
container_name: client
Expand Down
2 changes: 1 addition & 1 deletion src/views/AddAnnouncementView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default {
<input v-model="title" type="text" placeholder="Tytuł" required />
<input v-model="author" type="text" placeholder="Autor" required />
<EditorItem @modelValue="(msg) => (content = msg)" />
<input v-model="added" type="datetime-local" ref="dateInp" min="2023-02-01T00:00" required />
<input v-model="added" type="datetime-local" min="2023-02-01T00:00" required />
<button type="submit">Zapisz</button>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/AddChallengeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
<EditorItem @modelValue="(msg) => (content = msg)" />
<input v-model="answer" type="text" placeholder="Odpowiedź" required />
<input v-model="points" type="number" placeholder="Punkty" required />
<input v-model="start" type="datetime-local" ref="dateInp" min="2023-02-01T00:00" required />
<input v-model="start" type="datetime-local" min="2023-02-01T00:00" required />
<button type="submit">Zapisz</button>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/ChallengesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
<template>
<main>
<div class="title">mądrALO - Zadania</div>
<div class="info" v-if="challs === null || challs === [] || challs.length === 0 || !challs">
<div class="info" v-if="challs === null || challs.length === 0 || !challs">
<p>Żadne zadania nie zostały jeszcze opublikowane. Zapoznaj się z zakładką <i>Zasady</i></p>
</div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/EditAnnouncementView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default {
<label>Treść:</label>
<EditorItem class="editor" @modelValue="(msg) => (content = msg)" :placeholder="content" />
<label>Data dodania:</label>
<input v-model="added" type="datetime-local" ref="dateInp" min="2023-02-01T00:00" required />
<input v-model="added" type="datetime-local" min="2023-02-01T00:00" required />
<button type="submit">Zapisz</button>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/views/EditChallengeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default {
<label>Rozwiązań:</label>
<input v-model="solves" type="number" placeholder="Rozwiązań" required />
<label>Data startu:</label>
<input v-model="start" type="datetime-local" ref="dateInp" min="2023-02-01T00:00" required />
<input v-model="start" type="datetime-local" min="2023-02-01T00:00" required />
<button type="submit">Zapisz</button>
</form>
</div>
Expand Down
23 changes: 19 additions & 4 deletions src/views/EditCompetitionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default {
title: '',
rules: '',
start: null,
end: null
end: null,
freeze: false,
freezeTime: null
};
},
methods: {
Expand All @@ -23,7 +25,9 @@ export default {
title: this.title,
rules: this.rules,
start: this.start,
end: this.end
end: this.end,
freeze: this.freeze,
freezeTime: this.freezeTime
},
{
headers: {
Expand Down Expand Up @@ -64,6 +68,8 @@ export default {
this.rules = (await axios.get(`${url}/competition/rules`)).data;
this.start = tr.start;
this.end = tr.end;
this.freeze = (await axios.get(`${url}/competition/freeze`)).data;
this.freezeTime = (await axios.get(`${url}/competition/freezeTime`)).data;
} catch (error) {
if (error.response.status === 404 || error.response.status === 400) {
this.$router.push('/NotFound');
Expand All @@ -90,9 +96,13 @@ export default {
<label>Opis (zasady):</label>
<EditorItem class="editor" @modelValue="(msg) => (rules = msg)" :placeholder="rules" />
<label>Data startu:</label>
<input v-model="start" type="datetime-local" ref="dateInp" min="2023-02-01T00:00" required />
<input v-model="start" type="datetime-local" min="2023-02-01T00:00" required />
<label>Data zakończenia:</label>
<input v-model="end" type="datetime-local" ref="dateInp" min="2023-02-01T00:00" required />
<input v-model="end" type="datetime-local" min="2023-02-01T00:00" required />
<label>Zamrażanie rankingu:</label>
<input v-model="freeze" type="checkbox" />
<label>Data zamrożenia rankingu:</label>
<input v-model="freezeTime" type="datetime-local" min="2023-02-01T00:00" required />
<button type="submit">Zapisz</button>
</form>
<form @submit.prevent="submitIcon" class="iconForm">
Expand Down Expand Up @@ -131,6 +141,11 @@ input:focus {
background-color: rgba(255, 255, 255, 0.1);
}

input[type='checkbox'] {
display: block;
width: auto;
}

button {
cursor: pointer;
margin-bottom: 2rem;
Expand Down
Loading