Compare commits
No commits in common. "b78c4ba9c5d4a88c64e029c3313195c2c4a0dc7a" and "2640a49734ddbd90289189c0bb481d0e9613f364" have entirely different histories.
b78c4ba9c5
...
2640a49734
|
@ -5,5 +5,6 @@ __pycache__
|
||||||
node_modules
|
node_modules
|
||||||
package-lock.json
|
package-lock.json
|
||||||
db.sqlite3
|
db.sqlite3
|
||||||
/static/
|
static/admin/
|
||||||
|
static/django_extensions/
|
||||||
dist/
|
dist/
|
|
@ -43,7 +43,6 @@ class PurchaseForm(forms.ModelForm):
|
||||||
|
|
||||||
|
|
||||||
class EditionForm(forms.ModelForm):
|
class EditionForm(forms.ModelForm):
|
||||||
game = forms.ModelChoiceField(queryset=Game.objects.order_by("name"))
|
|
||||||
platform = forms.ModelChoiceField(queryset=Platform.objects.order_by("name"))
|
platform = forms.ModelChoiceField(queryset=Platform.objects.order_by("name"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
/**
|
|
||||||
* @description Sync select field with input field until user focuses it.
|
|
||||||
* @param {HTMLSelectElement} sourceElementSelector
|
|
||||||
* @param {HTMLInputElement} targetElementSelector
|
|
||||||
*/
|
|
||||||
function syncSelectInputUntilChanged(
|
|
||||||
sourceElementSelector,
|
|
||||||
targetElementSelector
|
|
||||||
) {
|
|
||||||
const sourceElement = document.querySelector(sourceElementSelector);
|
|
||||||
const targetElement = document.querySelector(targetElementSelector);
|
|
||||||
function sourceElementHandler(event) {
|
|
||||||
let selected = event.target.value;
|
|
||||||
let selectedValue = document.querySelector(
|
|
||||||
`#id_game option[value='${selected}']`
|
|
||||||
).textContent;
|
|
||||||
targetElement.value = selectedValue;
|
|
||||||
}
|
|
||||||
function targetElementHandler(event) {
|
|
||||||
sourceElement.removeEventListener("change", sourceElementHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceElement.addEventListener("change", sourceElementHandler);
|
|
||||||
targetElement.addEventListener("focus", targetElementHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("load", () => {
|
|
||||||
syncSelectInputUntilChanged("#id_game", "#id_name");
|
|
||||||
});
|
|
|
@ -1,21 +0,0 @@
|
||||||
{% extends "base.html" %}
|
|
||||||
|
|
||||||
{% block title %}{{ title }}{% endblock title %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<form method="post" enctype="multipart/form-data">
|
|
||||||
<table class="mx-auto">
|
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
{{ form.as_table }}
|
|
||||||
<tr>
|
|
||||||
<td><input type="submit" value="Submit"/></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
{% endblock content %}
|
|
||||||
|
|
||||||
{% block scripts %}
|
|
||||||
{% load static %}
|
|
||||||
<script type="module" src="{% static 'js/qol.js' %}"></script>
|
|
||||||
{% endblock scripts %}
|
|
|
@ -12,7 +12,7 @@
|
||||||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"/>
|
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"/>
|
||||||
<link rel="stylesheet" href="{% static 'base.css' %}" />
|
<link rel="stylesheet" href="{% static 'base.css' %}" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="dark">
|
<body class="dark">
|
||||||
<div class="dark:bg-gray-800 min-h-screen">
|
<div class="dark:bg-gray-800 min-h-screen">
|
||||||
<nav class="mb-4 bg-white dark:bg-gray-900 border-gray-200 rounded">
|
<nav class="mb-4 bg-white dark:bg-gray-900 border-gray-200 rounded">
|
||||||
|
@ -47,7 +47,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% load version %}
|
{% load version %}
|
||||||
<span class="fixed left-2 bottom-2 text-xs text-slate-300 dark:text-slate-600">{% version %} ({% version_date %})</span>
|
<span class="fixed left-2 bottom-2 text-xs text-slate-300 dark:text-slate-600">{% version %} ({% version_date %})</span>
|
||||||
{% block scripts %}{% endblock scripts %}
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
|
@ -221,7 +221,7 @@ def add_edition(request):
|
||||||
|
|
||||||
context["form"] = form
|
context["form"] = form
|
||||||
context["title"] = "Add New Edition"
|
context["title"] = "Add New Edition"
|
||||||
return render(request, "add_edition.html", context)
|
return render(request, "add.html", context)
|
||||||
|
|
||||||
|
|
||||||
def add_platform(request):
|
def add_platform(request):
|
||||||
|
|
Loading…
Reference in New Issue