final version, submitted to teacher
This commit is contained in:
@@ -42,14 +42,35 @@
|
||||
<label for="popis">Popis:</label>
|
||||
<textarea id="popis" name="popis" required>{{ repair['Popis'] }}</textarea>
|
||||
|
||||
<h3>Použité Produkty</h3>
|
||||
<div id="product-container">
|
||||
{% for product in repair['products'] %}
|
||||
<div class="product-item" id="product-item-{{ loop.index0 }}">
|
||||
<label for="product_{{ loop.index0 }}">Produkt:</label>
|
||||
<select id="product_{{ loop.index0 }}" name="products[{{ loop.index0 }}][id]" required>
|
||||
<option value="" disabled>Vyberte produkt</option>
|
||||
{% for p in products %}
|
||||
<option value="{{ p['ID_Produktu'] }}" {% if p['ID_Produktu'] == product['ID_Produktu'] %}selected{% endif %}>{{ p['Nazev'] }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label for="quantity_{{ loop.index0 }}">Množství:</label>
|
||||
<input type="number" id="quantity_{{ loop.index0 }}" name="products[{{ loop.index0 }}][quantity]" value="{{ product['Pocet_Produktu'] }}" min="0" required>
|
||||
<button type="button" style="margin-top: -5px;" onclick="removeProduct({{ loop.index0 }})">Odstranit</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<button type="button" onclick="addProduct()">Přidat Produkt</button>
|
||||
|
||||
<button type="submit" class="button">Aktualizovat</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer" id="kontakt">
|
||||
<div>Made by Hrachovina</div>
|
||||
<div>Made by Hrachovina and Kirsch </div>
|
||||
</footer>
|
||||
|
||||
<script src="{{ url_for('static', filename='scripts/products.js') }}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user