Compare commits

...

8 Commits

Author SHA1 Message Date
pre-commit-ci[bot] 731cbcd622
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)
2022-11-29 02:49:05 +00:00
Gabriel Augendre c6c565f785 Update deps 2022-11-28 14:27:50 +01:00
Gabriel Augendre 5097b83b72 Merge branch 'master' of github.com:Crocmagnon/charasheet 2022-11-28 14:26:03 +01:00
Gabriel Augendre a89af12877
Install Firefox manually in test setup steps
Firefox isn't installed in ubuntu-latest anymore.
2022-11-25 17:46:50 +01:00
Gabriel Augendre f3e54e5955 Update deps & cleanup refresh tooltips 2022-11-25 16:52:11 +01:00
Gabriel Augendre 2458ff7901 Update deps & cleanup refresh tooltips 2022-11-25 15:59:12 +01:00
Gabriel Augendre 4f39677b9e Add link to group in character view.
Closes #27
2022-11-22 13:27:56 +01:00
Gabriel Augendre 79e1810461
Merge pull request #26 from Crocmagnon/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-11-22 07:11:11 +01:00
6 changed files with 42 additions and 40 deletions

View File

@ -12,6 +12,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Firefox
run: sudo snap remove firefox && sudo add-apt-repository ppa:mozillateam/ppa && sudo apt install --target-release 'o=LP-PPA-mozillateam' firefox
- uses: browser-actions/setup-geckodriver@latest
- name: Install poetry
run: pipx install poetry==1.1.15

View File

@ -1,7 +1,7 @@
exclude: \.min\.(js|css)(\.map)?$|^\.idea/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-json

52
poetry.lock generated
View File

@ -232,7 +232,7 @@ postal = ["cryptography"]
[[package]]
name = "django-bootstrap5"
version = "22.1"
version = "22.2"
description = "Bootstrap 5 for Django"
category = "main"
optional = false
@ -332,7 +332,7 @@ Django = ">=3.2"
[[package]]
name = "exceptiongroup"
version = "1.0.2"
version = "1.0.4"
description = "Backport of PEP 654 (exception groups)"
category = "main"
optional = false
@ -400,7 +400,7 @@ python-versions = ">=3.7"
[[package]]
name = "hypothesis"
version = "6.57.1"
version = "6.58.1"
description = "A library for property-based testing"
category = "dev"
optional = false
@ -412,14 +412,14 @@ exceptiongroup = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
sortedcontainers = ">=2.1.0,<3.0.0"
[package.extras]
all = ["backports.zoneinfo (>=0.2.1)", "black (>=19.10b0)", "click (>=7.0)", "django (>=3.2)", "dpcontracts (>=0.4)", "importlib-metadata (>=3.6)", "lark-parser (>=0.6.5)", "libcst (>=0.3.16)", "numpy (>=1.9.0)", "pandas (>=1.0)", "pytest (>=4.6)", "python-dateutil (>=1.4)", "pytz (>=2014.1)", "redis (>=3.0.0)", "rich (>=9.0.0)", "tzdata (>=2022.6)"]
all = ["backports.zoneinfo (>=0.2.1)", "black (>=19.10b0)", "click (>=7.0)", "django (>=3.2)", "dpcontracts (>=0.4)", "importlib-metadata (>=3.6)", "lark (>=0.10.1)", "libcst (>=0.3.16)", "numpy (>=1.9.0)", "pandas (>=1.0)", "pytest (>=4.6)", "python-dateutil (>=1.4)", "pytz (>=2014.1)", "redis (>=3.0.0)", "rich (>=9.0.0)", "tzdata (>=2022.6)"]
cli = ["black (>=19.10b0)", "click (>=7.0)", "rich (>=9.0.0)"]
codemods = ["libcst (>=0.3.16)"]
dateutil = ["python-dateutil (>=1.4)"]
django = ["django (>=3.2)"]
dpcontracts = ["dpcontracts (>=0.4)"]
ghostwriter = ["black (>=19.10b0)"]
lark = ["lark-parser (>=0.6.5)"]
lark = ["lark (>=0.10.1)"]
numpy = ["numpy (>=1.9.0)"]
pandas = ["pandas (>=1.0)"]
pytest = ["pytest (>=4.6)"]
@ -429,7 +429,7 @@ zoneinfo = ["backports.zoneinfo (>=0.2.1)", "tzdata (>=2022.6)"]
[[package]]
name = "identify"
version = "2.5.8"
version = "2.5.9"
description = "File identification library for Python"
category = "dev"
optional = false
@ -797,7 +797,7 @@ six = ">=1.5"
[[package]]
name = "python-gitlab"
version = "3.11.0"
version = "3.12.0"
description = "Interact with GitLab API"
category = "dev"
optional = false
@ -858,7 +858,7 @@ requests = ">=2.0.1,<3.0.0"
[[package]]
name = "selenium"
version = "4.6.0"
version = "4.6.1"
description = ""
category = "main"
optional = false
@ -981,11 +981,11 @@ python-versions = ">=2"
[[package]]
name = "urllib3"
version = "1.26.12"
version = "1.26.13"
description = "HTTP library with thread-safe connection pooling, file post, and more."
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4"
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
[package.dependencies]
PySocks = {version = ">=1.5.6,<1.5.7 || >1.5.7,<2.0", optional = true, markers = "extra == \"socks\""}
@ -997,7 +997,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"]
[[package]]
name = "virtualenv"
version = "20.16.7"
version = "20.17.0"
description = "Virtual Python Environment builder"
category = "dev"
optional = false
@ -1271,8 +1271,8 @@ django-anymail = [
{file = "django_anymail-8.6-py3-none-any.whl", hash = "sha256:49d83d7c16316ca86a624097496881d59b7d71b16bf1c5211cffa5b19ef98d0c"},
]
django-bootstrap5 = [
{file = "django-bootstrap5-22.1.tar.gz", hash = "sha256:70b51f020ef95a64780a0b5d5fdb1fade6e7b5e26c53355cc4f3648eca239cab"},
{file = "django_bootstrap5-22.1-py3-none-any.whl", hash = "sha256:cf3f257abf750f19e47eddc106066ddb182576185494965d1408eddcb3a7380b"},
{file = "django-bootstrap5-22.2.tar.gz", hash = "sha256:e944f5ced342e0e16cde77e1ddacb4b9fd5bce4cc190df2f7da0b8e18a24c9cb"},
{file = "django_bootstrap5-22.2-py3-none-any.whl", hash = "sha256:5d677bbfb94207c1a034d63a5f39d95ce287ef509e0b31dfb4d233cc81f93bcc"},
]
django-browser-reload = [
{file = "django-browser-reload-1.6.0.tar.gz", hash = "sha256:9ca69c71796f53868bdc7421f120d147f7a64faa0d5d8c06970ba3f8061af63c"},
@ -1307,8 +1307,8 @@ django-registration = [
{file = "django_registration-3.3-py3-none-any.whl", hash = "sha256:dfa176f594fb465c93495caa55686be723a15829769511383e25172d2efbd0e6"},
]
exceptiongroup = [
{file = "exceptiongroup-1.0.2-py3-none-any.whl", hash = "sha256:c22f11ec6a10d2b453871c5c5fe887436c4d1961324ce9090f2ca6ddc4180c27"},
{file = "exceptiongroup-1.0.2.tar.gz", hash = "sha256:a31cd183c3dea02e617aab5153588d5f7258a77b51f0ef41b3815ae8a0d0f695"},
{file = "exceptiongroup-1.0.4-py3-none-any.whl", hash = "sha256:542adf9dea4055530d6e1279602fa5cb11dab2395fa650b8674eaec35fc4a828"},
{file = "exceptiongroup-1.0.4.tar.gz", hash = "sha256:bd14967b79cd9bdb54d97323216f8fdf533e278df937aa2a90089e7d6e06e5ec"},
]
filelock = [
{file = "filelock-3.8.0-py3-none-any.whl", hash = "sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4"},
@ -1389,12 +1389,12 @@ h11 = [
{file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},
]
hypothesis = [
{file = "hypothesis-6.57.1-py3-none-any.whl", hash = "sha256:91c22db726ffd68f2658e273af111a6fcae2e53fa430580862e8522686b5c071"},
{file = "hypothesis-6.57.1.tar.gz", hash = "sha256:1d8ed5136f368e343f39172b06f68aa7fd1312cf643c332ab18a75d56789fa90"},
{file = "hypothesis-6.58.1-py3-none-any.whl", hash = "sha256:8738b9b38c2b2c214d965b07f29312047b970541d848cb97d2a58f79fd61fbe6"},
{file = "hypothesis-6.58.1.tar.gz", hash = "sha256:b5747497b2b352335e4dc51f1b113cfc90c49ffd174f2036f173edf8799e123a"},
]
identify = [
{file = "identify-2.5.8-py2.py3-none-any.whl", hash = "sha256:48b7925fe122720088aeb7a6c34f17b27e706b72c61070f27fe3789094233440"},
{file = "identify-2.5.8.tar.gz", hash = "sha256:7a214a10313b9489a0d61467db2856ae8d0b8306fc923e03a9effa53d8aedc58"},
{file = "identify-2.5.9-py2.py3-none-any.whl", hash = "sha256:a390fb696e164dbddb047a0db26e57972ae52fbd037ae68797e5ae2f4492485d"},
{file = "identify-2.5.9.tar.gz", hash = "sha256:906036344ca769539610436e40a684e170c3648b552194980bb7b617a8daeb9f"},
]
idna = [
{file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"},
@ -1584,8 +1584,8 @@ python-dateutil = [
{file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"},
]
python-gitlab = [
{file = "python-gitlab-3.11.0.tar.gz", hash = "sha256:db9472b6ae4fba968b409dc32faee20dd65089065daa93e08d21b796a65d6578"},
{file = "python_gitlab-3.11.0-py3-none-any.whl", hash = "sha256:9f91d7d3967067a8fba46f23e8176bc1d006d3d26abc9f8f1f8d2d84da1d45d8"},
{file = "python-gitlab-3.12.0.tar.gz", hash = "sha256:567390c2b93690dae62ed9738bf9f221fa45c01378fdf896089dbf7c8a134fbd"},
{file = "python_gitlab-3.12.0-py3-none-any.whl", hash = "sha256:a5eb36b49783fda34563376674d5251dbbdbd1abd23b287dadf82f67d861b2c1"},
]
pyxdg = [
{file = "pyxdg-0.28-py2.py3-none-any.whl", hash = "sha256:bdaf595999a0178ecea4052b7f4195569c1ff4d344567bccdc12dfdf02d545ab"},
@ -1635,7 +1635,7 @@ requests-toolbelt = [
{file = "requests_toolbelt-0.10.1-py2.py3-none-any.whl", hash = "sha256:18565aa58116d9951ac39baa288d3adb5b3ff975c4f25eee78555d89e8f247f7"},
]
selenium = [
{file = "selenium-4.6.0-py3-none-any.whl", hash = "sha256:3f1999875ef487ae676a254e7293a68041f1f1ec76be81402d8a1cd5a481bf3b"},
{file = "selenium-4.6.1-py3-none-any.whl", hash = "sha256:2384829279d41c7f5b338ce87453cc4e120099b6c093318207376c19f5d2c254"},
]
six = [
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
@ -1682,12 +1682,12 @@ tzdata = [
{file = "tzdata-2022.6.tar.gz", hash = "sha256:91f11db4503385928c15598c98573e3af07e7229181bee5375bd30f1695ddcae"},
]
urllib3 = [
{file = "urllib3-1.26.12-py2.py3-none-any.whl", hash = "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997"},
{file = "urllib3-1.26.12.tar.gz", hash = "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"},
{file = "urllib3-1.26.13-py2.py3-none-any.whl", hash = "sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc"},
{file = "urllib3-1.26.13.tar.gz", hash = "sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8"},
]
virtualenv = [
{file = "virtualenv-20.16.7-py3-none-any.whl", hash = "sha256:efd66b00386fdb7dbe4822d172303f40cd05e50e01740b19ea42425cbe653e29"},
{file = "virtualenv-20.16.7.tar.gz", hash = "sha256:8691e3ff9387f743e00f6bb20f70121f5e4f596cae754531f2b3b3a1b1ac696e"},
{file = "virtualenv-20.17.0-py3-none-any.whl", hash = "sha256:40a7e06a98728fd5769e1af6fd1a706005b4bb7e16176a272ed4292473180389"},
{file = "virtualenv-20.17.0.tar.gz", hash = "sha256:7d6a8d55b2f73b617f684ee40fd85740f062e1f2e379412cb1879c7136f05902"},
]
wcwidth = [
{file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"},

View File

@ -12,7 +12,9 @@
</p>
{% if party %}
<p>
Groupe : {{ party }}. Joueurs : {% for other in party.characters.all %}<a href="{% url "character:view" pk=other.pk %}?party={{ party.pk }}">{{ other }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
Groupe : <a href="{{ party.get_absolute_url }}">{{ party }}</a>
&bullet;
Joueurs : {% for other in party.characters.all %}<a href="{% url "character:view" pk=other.pk %}?party={{ party.pk }}">{{ other }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
</p>
{% endif %}
{% if character|managed_by:user %}

View File

@ -125,7 +125,7 @@ def character_health_change(request, pk: int):
character.health_remaining = value
character.save(update_fields=["health_remaining"])
response = HttpResponse(value)
return trigger_client_event(response, "refresh_health_bar", {})
return trigger_client_event(response, "refresh_health_bar")
@login_required
@ -140,7 +140,7 @@ def character_mana_change(request, pk: int):
character.mana_remaining = value
character.save(update_fields=["mana_remaining"])
response = HttpResponse(value)
return trigger_client_event(response, "refresh_mana_bar", {})
return trigger_client_event(response, "refresh_mana_bar")
@login_required
@ -166,7 +166,7 @@ def character_defense_misc_change(request, pk: int):
character.defense_misc = value
character.save(update_fields=["defense_misc"])
response = HttpResponse(value)
return trigger_client_event(response, "update_defense", {})
return trigger_client_event(response, "update_defense")
@login_required
@ -178,7 +178,7 @@ def character_shield_change(request, pk: int):
character.shield = value
character.save(update_fields=["shield"])
response = HttpResponse(value)
return trigger_client_event(response, "update_defense", {})
return trigger_client_event(response, "update_defense")
@login_required
@ -190,7 +190,7 @@ def character_armor_change(request, pk: int):
character.armor = value
character.save(update_fields=["armor"])
response = HttpResponse(value)
return trigger_client_event(response, "update_defense", {})
return trigger_client_event(response, "update_defense")
@login_required
@ -202,7 +202,7 @@ def character_initiative_misc_change(request, pk: int):
character.initiative_misc = value
character.save(update_fields=["initiative_misc"])
response = HttpResponse(value)
return trigger_client_event(response, "update_initiative", {})
return trigger_client_event(response, "update_initiative")
@login_required
@ -394,7 +394,7 @@ def remove_state(request, pk: int, state_pk: int):
response = render(
request, "character/snippets/character_details/states.html", context
)
return trigger_client_event(response, "refresh_tooltips", {})
return trigger_client_event(response, "refresh_tooltips", after="swap")
@login_required
@ -408,7 +408,7 @@ def add_state(request, pk: int, state_pk: int):
response = render(
request, "character/snippets/character_details/states.html", context
)
return trigger_client_event(response, "refresh_tooltips", {})
return trigger_client_event(response, "refresh_tooltips", after="swap")
@login_required

View File

@ -56,10 +56,8 @@
let tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
addEventListener("refresh_tooltips", function (event) {
tooltipList.forEach(tooltip => tooltip.dispose());
setTimeout(() => {
tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
}, 50);
tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
});
</script>
</body>