Compare commits

..

10 Commits
0.8.0 ... 0.8.2

Author SHA1 Message Date
Herculino Trotta
cd7ecd42ea Merge pull request #109
feat: allow for a subset of markdown (bold, italics, strikethrough, links) when displaying notes
2025-01-29 13:53:09 -03:00
Herculino Trotta
0b83ad6b3e feat: allow for a subset of markdown (bold, italics, strikethrough, links) when displaying notes 2025-01-29 13:52:46 -03:00
Herculino Trotta
d0ef08252e Merge pull request #108
feat: improve transactions list loading time
2025-01-29 13:47:05 -03:00
Herculino Trotta
1140d9c896 feat: improve transactions list loading time
Prefetch more values and allow them to be cached
2025-01-29 13:46:06 -03:00
Herculino Trotta
b2843a1ec1 Merge pull request #106 from DragonHeart69/main
Small change in Dutch translation
2025-01-29 08:40:31 -03:00
Dimitri Decrock
d25aba7be9 small change to number format again 2025-01-29 06:12:54 +01:00
Dimitri Decrock
c3eaca3e9a Merge branch 'eitchtee:main' into main 2025-01-29 06:10:17 +01:00
Herculino Trotta
5677706452 Merge pull request #105
fix: unable to load transactions on first login
2025-01-29 00:56:22 -03:00
Herculino Trotta
5bf7f9f272 fix: unable to load transactions on first login 2025-01-29 00:56:06 -03:00
Dimitri Decrock
65ad51c273 smal change to number format 2025-01-28 19:16:52 +01:00
6 changed files with 66 additions and 10 deletions

View File

@@ -0,0 +1,52 @@
from typing import Optional
import mistune
from django import template
from django.utils.safestring import mark_safe
from mistune import HTMLRenderer, Markdown, BlockParser, InlineParser, safe_entity
from mistune.plugins.formatting import strikethrough as plugin_strikethrough
from mistune.plugins.url import url as plugin_url
register = template.Library()
class CustomRenderer(HTMLRenderer):
def link(self, text: str, url: str, title: Optional[str] = None) -> str:
s = '<a rel="nofollow" target="_blank" href="' + self.safe_url(url) + '"'
if title:
s += ' title="' + safe_entity(title) + '"'
return s + ">" + text + "</a>"
def paragraph(self, text: str) -> str:
return text + "\n"
def softbreak(self) -> str:
return "\n"
def blank_line(self) -> str:
return "\n"
block = BlockParser()
block.rules = ["blank_line"]
inline = InlineParser(hard_wrap=False)
inline.rules = [
"emphasis",
"link",
"auto_link",
"auto_email",
"linebreak",
"softbreak",
]
markdown = Markdown(
renderer=CustomRenderer(escape=False),
block=block,
inline=inline,
plugins=[plugin_strikethrough, plugin_url],
)
@register.filter(name="limited_markdown")
def limited_markdown(value):
return mark_safe(markdown(value))

View File

@@ -69,7 +69,7 @@ def transactions_list(request, month: int, year: int):
if "order" in request.GET:
order = request.GET["order"]
if order != request.session["monthly_transactions_order"]:
if order != request.session.get("monthly_transactions_order", "default"):
request.session["monthly_transactions_order"] = order
f = TransactionsFilter(request.GET)
@@ -84,9 +84,12 @@ def transactions_list(request, month: int, year: int):
"account__group",
"category",
"tags",
"tags__id",
"account__exchange_currency",
"account__currency",
"installment_plan",
"entities__name",
"entities__id",
)
)

View File

@@ -328,7 +328,7 @@ def transaction_all_list(request):
if "order" in request.GET:
order = request.GET["order"]
if order != request.session["all_transactions_order"]:
if order != request.session.get("all_transactions_order", "default"):
request.session["all_transactions_order"] = order
transactions = Transaction.objects.prefetch_related(
@@ -336,9 +336,12 @@ def transaction_all_list(request):
"account__group",
"category",
"tags",
"tags__id",
"account__exchange_currency",
"account__currency",
"installment_plan",
"entities__name",
"entities__id",
).all()
transactions = default_order(transactions, order=order)

View File

@@ -9,8 +9,8 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-28 00:49+0000\n"
"PO-Revision-Date: 2025-01-27 13:27-0300\n"
"Last-Translator: Herculino Trotta\n"
"PO-Revision-Date: 2025-01-29 06:12+0100\n"
"Last-Translator: Dimitri Decrock <dimitri@fam-decrock.eu>\n"
"Language-Team: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
@@ -323,8 +323,6 @@ msgid "Info"
msgstr "Info"
#: apps/common/views.py:110
#, fuzzy
#| msgid "Category updated successfully"
msgid "Cache cleared successfully"
msgstr "Categorie succesvol bijgewerkt"
@@ -1180,7 +1178,7 @@ msgstr "Tijdsnotatie"
#: apps/users/forms.py:102 apps/users/models.py:48
msgid "Number Format"
msgstr "Nummerformat"
msgstr "Schrijfwijze Nummers"
#: apps/users/forms.py:131
msgid "Save"
@@ -1906,8 +1904,6 @@ msgid "Settings"
msgstr "Instellingen"
#: templates/includes/navbar/user_menu.html:38
#, fuzzy
#| msgid "Clear"
msgid "Clear cache"
msgstr "Leegmaken"

View File

@@ -1,3 +1,4 @@
{% load markdown %}
{% load i18n %}
<div class="transaction d-flex my-1 {% if transaction.type == "EX" %}expense{% else %}income{% endif %}">
{% if not disable_selection %}
@@ -54,7 +55,7 @@
{% if transaction.notes %}
<div class="row mb-2 mb-lg-1 tw-text-gray-400">
<div class="col-auto pe-1"><i class="fa-solid fa-align-left fa-fw me-1 fa-xs"></i></div>
<div class="col ps-0">{{ transaction.notes | linebreaksbr }}</div>
<div class="col ps-0">{{ transaction.notes | limited_markdown | linebreaksbr }}</div>
</div>
{% endif %}
{# Category#}

View File

@@ -26,3 +26,4 @@ python-dateutil~=2.9.0.post0
simpleeval~=1.0.0
pydantic~=2.10.5
PyYAML~=6.0.2
mistune~=3.1.1