Skip to content

Commit

Permalink
Merge branch 'master' into feature/flexible-routines
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Dec 6, 2024
2 parents 67b6396 + adbfd85 commit f1b3661
Show file tree
Hide file tree
Showing 12 changed files with 296 additions and 323 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Developers
* Jonathan La Field - https://github.com/JLaField
* Kevin Moy - https://github.com/kmoy1
* Taylor Fuller - https://github.com/taylor-fuller
* eyJhb - https://github.com/eyJhb


Translators
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Django==4.2.16
bleach[css]~=6.1
celery[redis]==5.4.0
crispy-bootstrap5==2024.2
crispy-bootstrap5==2024.10
django-activity-stream==2.0.0
django-axes[ipware]==7.0.0
django-bootstrap-breadcrumbs2==1.0.0 # fork of django-bootstrap-breadcrumbs, we might need to migrate away completely
Expand All @@ -23,20 +23,20 @@ drf-spectacular[sidecar]==0.27.2
easy-thumbnails==2.10
flower==2.0.1
fontawesomefree~=6.6.0
icalendar==6.0.1
icalendar==6.1.0
invoke==2.2.0
openfoodfacts==2.2.0
pillow==10.4.0
reportlab==4.2.5
requests==2.32.3
tqdm==4.66.5
tqdm==4.67.1
tzdata==2024.2

# AWS
#boto3

# REST API
django-cors-headers==4.5.0
django-cors-headers==4.6.0
django-filter==24.3
djangorestframework==3.15.2
djangorestframework-simplejwt[crypto]==5.3.1
Expand Down
6 changes: 3 additions & 3 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-r requirements.txt

# Building/installing
wheel==0.45.0
wheel==0.45.1

# for ingredient import script from OFF
pymongo==4.10.1
Expand All @@ -16,8 +16,8 @@ faker==26.0.0

# Development packages
django-extensions~=3.2
coverage==7.6.3
coverage==7.6.7
django-debug-toolbar==4.4.5
isort==5.13.2
ruff==0.7.4
ruff==0.8.2
tblib==3.0.0
24 changes: 5 additions & 19 deletions wger/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
Expand All @@ -14,32 +12,20 @@
#
# You should have received a copy of the GNU Affero General Public License

# Standard Library
import os
import sys

# Third Party
from invoke import run
# wger
from wger.tasks import make_program


"""
This simple wrapper script is used as a console entry point in the packaged
version of the application. It simply redirects all arguments to the invoke
command, which does all the work.
version of the application. It takes all the tasks from tasks.py, and runs
invoke, which does all the work.
"""

invoke_cmd = 'invoke '


def main():
# Change the working directory so that invoke can find the tasks file
os.chdir(os.path.dirname(os.path.abspath(__file__)))

args = sys.argv[1:]
if len(args):
run(invoke_cmd + ' '.join(args), pty=True)
else:
run(invoke_cmd + '--list')
make_program().run()


if __name__ == '__main__':
Expand Down
6 changes: 6 additions & 0 deletions wger/gallery/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class Meta:
blank=True,
)

def __str__(self):
"""
Return a more human-readable representation
"""
return f'Gallery image #{self.pk}'

def get_owner_object(self):
"""
Returns the object that has owner information
Expand Down
20 changes: 15 additions & 5 deletions wger/gallery/templates/images/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,33 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{ image.date }}</h5>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<button type="button" class="close" data-bs-dismiss="modal"
aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<a href="{{ image.image.url }}">
<img src="{{ image.image.url }}" class="img-fluid">
<img src="{{ image.image.url }}" class="img-fluid" alt="">
</a>
{% if image.description %}
<p> {{ image.description }}</p>
{% endif %}

</div>
<div class="modal-footer">
<a href="{% url 'gallery:images:delete' image.id %}"
class="btn btn-primary">
{% url 'gallery:images:delete' image.id as url %}
<a
href="{{ url }}"
class="btn btn-primary"
hx-get="{{ url }}"
hx-target="#ajax-info-content"
data-bs-toggle="modal"
data-bs-target="#wger-ajax-info"
>
<span class="{% fa_class 'trash' %}"></span>
</a>

<a href="{% url 'gallery:images:edit' image.id %}" class="btn btn-primary">
<span class="{% fa_class 'edit' %}"></span>
</a>
Expand All @@ -47,7 +56,8 @@ <h5 class="modal-title" id="exampleModalLabel">{{ image.date }}</h5>
<div class="col-sm-6 col-lg-4 mb-4">
<div class="card">
<a href="#" data-bs-toggle="modal" data-bs-target="#modalImage{{ image.id }}">
<img class="card-img-top" src="{{ image.image.url }}" alt="{{ image.description }}">
<img class="card-img-top" src="{{ image.image.url }}"
alt="{{ image.description }}">
</a>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions wger/gallery/views/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ImageAddView(WgerFormMixin, CreateView):
model = Image
form_class = ImageForm
title = _('Add')
template_name = 'form_content.html'

def get_initial(self):
"""
Expand Down Expand Up @@ -92,6 +93,7 @@ class ImageUpdateView(WgerFormMixin, LoginRequiredMixin, UpdateView):

model = Image
form_class = ImageForm
template_name = 'form_content.html'

def get_context_data(self, **kwargs):
context = super(ImageUpdateView, self).get_context_data(**kwargs)
Expand Down
45 changes: 15 additions & 30 deletions wger/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ msgstr ""
"Project-Id-Version: wger Workout Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-14 19:23+0100\n"
"PO-Revision-Date: 2024-07-23 11:09+0000\n"
"PO-Revision-Date: 2024-11-27 21:00+0000\n"
"Last-Translator: gallegonovato <[email protected]>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/wger/web/es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.7-dev\n"
"X-Generator: Weblate 5.9-dev\n"

#: config/models/gym_config.py:46 gym/templates/gym/list.html:56
msgid "Default gym"
Expand Down Expand Up @@ -883,10 +883,8 @@ msgid "next"
msgstr "próximo"

#: core/templates/tags/render_day.html:44
#, fuzzy
#| msgid "Placeholder image for exercise"
msgid "Placeholder image for translation"
msgstr "Marcador de imagen para ejercicio"
msgstr "Imagen de marcador de posición para traducción"

#: core/templates/template.html:123 manager/templates/calendar/month.html:138
#: manager/templates/schedule/view.html:215
Expand Down Expand Up @@ -2417,10 +2415,8 @@ msgid "No schedules found."
msgstr "No se han encontrado programas."

#: manager/templates/schedule/overview.html:28
#, fuzzy
#| msgid "Add one now."
msgid "Add one now"
msgstr "Añadir ahora."
msgstr "Añadir uno ahora"

#: manager/templates/schedule/overview.html:36
msgid ""
Expand All @@ -2431,13 +2427,6 @@ msgstr ""
" sucesión."

#: manager/templates/schedule/overview.html:39
#, fuzzy
#| msgid ""
#| "You can indicate how long you want to do each workout\n"
#| " before jumping to the next. It is also possible to create a loop, "
#| "so you\n"
#| " always do the same workouts in succession, e.g. A > B > C > A > B "
#| "> C and so on."
msgid ""
"You can indicate how long you want to do each workout\n"
" before jumping to the next. It is also possible to create a loop, so "
Expand All @@ -2446,11 +2435,12 @@ msgid ""
"C and so\n"
" on."
msgstr ""
"Puedes indicar cuánto tiempo quieres hacer cada rutina \n"
" antes de saltar a la siguiente. También puedes crear un "
"bucle, para \n"
" poder hacer siempre las mismas rutinas en sucesión, p.ej. "
"A > B > C > A > B > C, etc."
"Puedes indicar cuánto tiempo quieres hacer cada entrenamiento\n"
" antes de pasar al siguiente. También es posible crear un bucle, de "
"modo que\n"
" los mismos ejercicios sucesivamente, por ejemplo, A > B > C > A > B "
"> C y así sucesivamente.\n"
" en."

#: manager/templates/schedule/overview.html:44
msgid ""
Expand Down Expand Up @@ -2532,13 +2522,6 @@ msgstr "Expora este programa como archivo de calendario."

#: manager/templates/schedule/view.html:202
#: manager/templates/workout/view.html:76
#, fuzzy
#| msgid ""
#| "You can then import the file it into your calendar\n"
#| " application for example google calendar, outlook "
#| "or iCal. This will create\n"
#| " an appointment for each training day with the "
#| "appropriate exercises."
msgid ""
"You can then import the file it into your calendar\n"
" application for example google calendar, outlook or "
Expand All @@ -2547,9 +2530,11 @@ msgid ""
"appropriate\n"
" exercises."
msgstr ""
"Podrás importar el archivo en tu aplicación de calendario, como por ejemplo\n"
"Google Calendar, Outlook o iCal. Esto creará una entrada para cada día\n"
"de entrenamiento con los respectivos ejercicios."
"A continuación, puede importar el archivo en su calendario\n"
" por ejemplo google calendar, outlook o iCal. Esto "
"creará\n"
" una cita para cada día de entrenamiento con los\n"
" ejercicios."

#: manager/templates/schedule/view.html:225
#: manager/templates/schedule/view.html:268
Expand Down
55 changes: 20 additions & 35 deletions wger/locale/uk/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ msgstr ""
"Project-Id-Version: wger Workout Manager\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-14 19:23+0100\n"
"PO-Revision-Date: 2024-08-26 12:09+0000\n"
"Last-Translator: kvinto <[email protected]>\n"
"PO-Revision-Date: 2024-12-02 18:00+0000\n"
"Last-Translator: Максим Горпиніч <[email protected]>\n"
"Language-Team: Ukrainian <https://hosted.weblate.org/projects/wger/web/uk/>\n"
"Language: uk\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != "
"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % "
"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || "
"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
"X-Generator: Weblate 5.7.1-dev\n"
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 "
"? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > "
"14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % "
"100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
"X-Generator: Weblate 5.9-dev\n"

#: config/models/gym_config.py:46 gym/templates/gym/list.html:56
msgid "Default gym"
Expand Down Expand Up @@ -871,10 +871,8 @@ msgid "next"
msgstr "вперед"

#: core/templates/tags/render_day.html:44
#, fuzzy
#| msgid "Placeholder image for exercise"
msgid "Placeholder image for translation"
msgstr "Заповнювач зображення для вправи"
msgstr "Зображення-заповнювач для перекладу"

#: core/templates/template.html:123 manager/templates/calendar/month.html:138
#: manager/templates/schedule/view.html:215
Expand Down Expand Up @@ -2399,10 +2397,8 @@ msgid "No schedules found."
msgstr "Програм не знайдено."

#: manager/templates/schedule/overview.html:28
#, fuzzy
#| msgid "Add one now."
msgid "Add one now"
msgstr "Додати зараз."
msgstr "Додайте зараз"

#: manager/templates/schedule/overview.html:36
msgid ""
Expand All @@ -2413,13 +2409,6 @@ msgstr ""
"по порядку."

#: manager/templates/schedule/overview.html:39
#, fuzzy
#| msgid ""
#| "You can indicate how long you want to do each workout\n"
#| " before jumping to the next. It is also possible to create a loop, "
#| "so you\n"
#| " always do the same workouts in succession, e.g. A > B > C > A > B "
#| "> C and so on."
msgid ""
"You can indicate how long you want to do each workout\n"
" before jumping to the next. It is also possible to create a loop, so "
Expand All @@ -2428,11 +2417,12 @@ msgid ""
"C and so\n"
" on."
msgstr ""
"Ви можете вказати тривалість кожного тренування,\n"
" перед тим як перейти до наступного. Також можна створити цикл, для "
"того,\n"
" щоб виконувати однакові тренування поспіль, наприклад A> B> C> A> B> "
"C і т.д."
"Ви можете вказати, як довго ви хочете виконувати кожне тренування \n"
" перш ніж перейти до наступного. Також є можливість створити петлю, "
"щоб ви \n"
" завжди виконуйте ті самі тренування поспіль, напр. A > B > C > A > B "
"> C тощо \n"
" на."

#: manager/templates/schedule/overview.html:44
msgid ""
Expand Down Expand Up @@ -2521,13 +2511,6 @@ msgstr "Експортувати цю програму в файл календ

#: manager/templates/schedule/view.html:202
#: manager/templates/workout/view.html:76
#, fuzzy
#| msgid ""
#| "You can then import the file it into your calendar\n"
#| " application for example google calendar, outlook "
#| "or iCal. This will create\n"
#| " an appointment for each training day with the "
#| "appropriate exercises."
msgid ""
"You can then import the file it into your calendar\n"
" application for example google calendar, outlook or "
Expand All @@ -2536,9 +2519,11 @@ msgid ""
"appropriate\n"
" exercises."
msgstr ""
"Цей файл можна потім імпортувати в календар застосунку, наприклад\n"
"google календар, outlook або iCal. Це дозволить створити розклад на\n"
"кожен тренувальний день з відповідними вправами."
"Потім ви можете імпортувати файл у свій календар \n"
" програму, наприклад календар Google, Outlook або "
"iCal. Це створить \n"
" запис на кожен навчальний день із відповідним \n"
" вправи."

#: manager/templates/schedule/view.html:225
#: manager/templates/schedule/view.html:268
Expand Down
Loading

0 comments on commit f1b3661

Please sign in to comment.