diff --git a/core/templates/core/_edit_form.html b/core/templates/core/_edit_form.html index 4966eaa..e68182f 100644 --- a/core/templates/core/_edit_form.html +++ b/core/templates/core/_edit_form.html @@ -6,7 +6,7 @@
-
Tag auswählen
{% for tag in tags %}{% endfor %}
+
Tag auswählen
{% for tag in tags %}{% endfor %}
diff --git a/core/templates/core/base.html b/core/templates/core/base.html index cd073d1..882440a 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -21,7 +21,7 @@ - +
{% for message in messages %}
{{ message }}
{% endfor %}{% block content %}{% endblock %}
diff --git a/core/templates/core/index.html b/core/templates/core/index.html index e7bbd5c..5bd5896 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -30,10 +30,20 @@ -
Tags
-
- {% include 'core/_tags.html' %} +
+
Tags
+
+ {% include 'core/_tags.html' %} +
+
+ Tags anzeigen +
+ {% for tag in tags %} + {% if active_tag == tag.name %}#{{ tag.name }} ×{% else %}#{{ tag.name }}{% endif %} + {% empty %}Noch keine Tags{% endfor %} +
+
@@ -45,7 +55,7 @@ -
Tags hinzufügen
{% for tag in tags %}{% endfor %}
+
Tags hinzufügen
{% for tag in tags %}{% endfor %}
{{ form.content }}
@@ -173,6 +183,19 @@ function quickComposer(tags, itemId=null){ fetch(`{% url "api_item_suggestions" %}?q=${encodeURIComponent(q)}`).then(r=>r.json()).then(data=>{this.linkSuggestions=data.items||[]}); } }, + addToken(token){ + let el=this.currentEl || document.getElementById('id_content'); + if(!el) return; + let pos=el.selectionStart??el.value.length; + let before=el.value.slice(0,pos); + let after=el.value.slice(pos); + let prefix=before&&!before.endsWith(' ')&&!before.endsWith('\n')?' ':''; + let value=before+prefix+token+' '+after; + this.text=value; + el.value=value; + this.showTags=false; + this.$nextTick(()=>{let p=before.length+prefix.length+token.length+1;el.focus();el.setSelectionRange(p,p)}) + }, insert(token){ let el=this.currentEl || document.getElementById('id_content'); if(!el) return; diff --git a/core/templates/core/item_editor.html b/core/templates/core/item_editor.html index 5beab57..0973ca4 100644 --- a/core/templates/core/item_editor.html +++ b/core/templates/core/item_editor.html @@ -10,7 +10,7 @@
-
Tag auswählen
{% for tag in tags %}{% endfor %}
+
Tag auswählen
{% for tag in tags %}{% endfor %}
diff --git a/core/templates/core/journal.html b/core/templates/core/journal.html index 36a5535..0ba5345 100644 --- a/core/templates/core/journal.html +++ b/core/templates/core/journal.html @@ -26,7 +26,7 @@ -
Tags hinzufügen
{% for tag in tags %}{% endfor %}
+
Tags hinzufügen
{% for tag in tags %}{% endfor %}
{{ form.content }}
diff --git a/core/templates/core/new_item.html b/core/templates/core/new_item.html index 9501f04..3979964 100644 --- a/core/templates/core/new_item.html +++ b/core/templates/core/new_item.html @@ -1,16 +1,18 @@ {% extends 'core/base.html' %} {% block content %} -← zurück
{% csrf_token %}
-

{% if requested_kind == 'todo' %}Aufgabe erstellen{% elif requested_kind == 'link' %}Link erstellen{% elif requested_kind == 'journal' %}Journal-Eintrag erstellen{% else %}Notiz erstellen{% endif %}

+
+

{% if requested_kind == 'todo' %}Aufgabe erstellen{% elif requested_kind == 'link' %}Link erstellen{% elif requested_kind == 'journal' %}Journal-Eintrag erstellen{% else %}Notiz erstellen{% endif %}

+
Abbrechen
+
-
Tag auswählen
{% for tag in tags %}{% endfor %}
+
Tag auswählen
{% for tag in tags %}{% endfor %}
@@ -24,7 +26,7 @@
Mit ![[ können Bilder im Text eingefügt werden.
- +
{% endblock %} diff --git a/my2dos/urls.py b/my2dos/urls.py index f5d2075..9213cc7 100644 --- a/my2dos/urls.py +++ b/my2dos/urls.py @@ -6,7 +6,9 @@ from django.urls import include, path def service_worker(request): - return FileResponse(open(settings.BASE_DIR / 'static' / 'sw.js', 'rb'), content_type='text/javascript') + response = FileResponse(open(settings.BASE_DIR / 'static' / 'sw.js', 'rb'), content_type='text/javascript') + response['Service-Worker-Allowed'] = '/' + return response urlpatterns = [ path('sw.js', service_worker, name='service_worker'),