Front update

This commit is contained in:
Piotr Kopycki 2022-04-11 12:20:29 +02:00
parent 40164544b6
commit c1d087c192
5 changed files with 44 additions and 28 deletions

View File

@ -476,7 +476,7 @@ background-color:#FF0B7E
}
.editContainerLine {
padding: 10px 0px 10px 0px;
padding: 0px 0px 0px 0px;
}
.editContainerSection {
@ -485,4 +485,8 @@ background-color:#FF0B7E
.editContainerSection h2 {
display: inline;
}
span {
margin-right: 10px;
}

View File

@ -18,8 +18,8 @@
</select>
<br>
<br>
<label for="password">Hasło: </label>
<input id="password" type="text" name="password" value=""> - Jeśli test ma nie posiadać hasła pozostaw puste pole
<label for="password">Hasło (opcjonalne): </label>
<input id="password" type="text" name="password" value="">
<br>
<br>
<label for="category">Kategoria: </label>

View File

@ -82,27 +82,37 @@
<div class="card-body test_body">
<div class="editContainerSection">
<div class="editContainerLine">
<label for="name"><h2>Nazwa:</h2></label>
<input id="name" type="text" name="name" value="{{ test.name }}">
<button class="defaultButton">
<a href='' onclick="this.href='editName?name='+document.getElementById('name').value">Zmien nazwe</a>
</button>
<span><label for="name"><h3>Nazwa:</h3></label></span>
<span><input id="name" type="text" name="name" value="{{ test.name }}"></span>
<span><button class="defaultButton">
<a href='' onclick="this.href='editName?name='+document.getElementById('name').value">Zapisz</a>
</button></span>
</div>
<label for="actual_visible">Aktualna widzialność: {% if test.visible %}Publiczny{% else %}Prywatny{% endif %}</label><br>
<label for="visible">Widzialność: </label>
<select name="visible" id="visible">
<option value="public">Publiczny</option>
<div class="editContainerLine">
<!-- <span><label>Aktualna widzialność: {% if test.visible %}Publiczny{% else %}Prywatny{% endif %}</label></span><br>-->
<span><label for="visible"><h3>Widzialność: </h3></label></span>
<span><select name="visible" id="visible">
{% if test.visible %}
<option selected="selected" value="public" >Publiczny</option>
<option value="private">Prywatny</option>
</select>
<button class="defaultButton">
<a href='' onclick="this.href='editVisible?visible='+document.getElementById('visible').value">Zmien widzialność testu</a>
</button>
<label for="password"><h2>Hasło:</h2></label>
<input id="password" type="text" name="password" value="">
<button class="defaultButton">
<a href='' onclick="this.href='editPassword?password='+document.getElementById('password').value">Zmien hasło</a>
</button>
{% endif %}
{% if not test.visible %}
<option value="public" >Publiczny</option>
<option selected="selected" value="private">Prywatny</option>
{% endif %}
</select></span>
<span><button class="defaultButton">
<a href='' onclick="this.href='editVisible?visible='+document.getElementById('visible').value">Zapisz</a>
</button></span>
</div>
<div class="editContainerLine">
<span><label for="password"><h3>Hasło:</h3></label></span>
<span><input id="password" type="text" name="password" value=""></span>
<span><button class="defaultButton">
<a href='' onclick="this.href='editPassword?password='+document.getElementById('password').value">Zapisz</a>
</button></span>
</div>
<label><h3>Pytania:</h3></label>
</div>
<form method="post" novalidate>
{% for question in test.questions.all %}
@ -124,7 +134,7 @@
<a href="/tests/{{test.id}}/add-question">Dodaj pytanie</a>
</button>
<button class="defaultButton">
<a href="/tests/{{test.id}}/remove-question">Usuwanie pytań</a>
<a href="/tests/{{test.id}}/remove-question">Usuń pytania</a>
</button>
</div>
</form>

View File

@ -8,6 +8,7 @@
<div class="mainTestContainer">
<div class="mainTestName">
{{test.name}}
<i class="fa-solid fa-lock"></i>
</div>
<div class="mainTestMeta">
<div class="left">Kategoria: {{test.category}}</div>

View File

@ -27,11 +27,12 @@
<h5 class="resultText">Maksymalny wynik: {{ max }}</h5>
<h5 class="resultText">Wynik procentowy: {{ percentage }}%</h5>
<button class="defaultButton"><a href="{% url 'home' %}">Strona główna</a></button>
{% if password == "" %}
Udostępnij:
{% post_to_facebook object_or_url "Post to Facebook!" %}
{% post_to_linkedin object_or_url %}
{% endif %}
{% if password == "" %}
<br>
<h5>Udostępnij:</h5>
{% post_to_facebook object_or_url %}
{% post_to_linkedin object_or_url %}
{% endif %}
</div>
</div>