From 9dd0dd4f76e1349967fbbb80de257cbb52694a6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 23:01:13 +0000 Subject: [PATCH 01/14] Bump reportlab from 3.6.6 to 3.6.7 Bumps [reportlab](http://www.reportlab.com/) from 3.6.6 to 3.6.7. --- updated-dependencies: - dependency-name: reportlab dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e15d2df03..180642a2e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ easy-thumbnails~=2.8 icalendar==4.0.9 invoke~=1.6 pillow~=9.0 -reportlab==3.6.6 +reportlab==3.6.7 requests==2.27.1 # AWS From 4c5fdb5152a2546100f3a21b76cf887dd02842ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Feb 2022 23:00:41 +0000 Subject: [PATCH 02/14] Bump coverage from 6.3.1 to 6.3.2 Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.3.1 to 6.3.2. - [Release notes](https://github.com/nedbat/coveragepy/releases) - [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst) - [Commits](https://github.com/nedbat/coveragepy/compare/6.3.1...6.3.2) --- updated-dependencies: - dependency-name: coverage dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 6fc776b14..1248e9815 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -12,7 +12,7 @@ wheel==0.37.1 pymongo==4.0.1 # Development packages -coverage==6.3.1 +coverage==6.3.2 django-debug-toolbar==3.2.4 tblib==1.7.0 isort==5.10.1 From cef820b2d0948e29fbcc66c94b49c0d69779ca12 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 24 Feb 2022 06:52:06 +0000 Subject: [PATCH 03/14] Translated using Weblate (German) Currently translated at 98.9% (760 of 768 strings) Translation: wger Workout Manager/Web App Translate-URL: https://hosted.weblate.org/projects/wger/web/de/ --- wger/locale/de/LC_MESSAGES/django.po | 30 +++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/wger/locale/de/LC_MESSAGES/django.po b/wger/locale/de/LC_MESSAGES/django.po index ea2c0ef5d..335471f44 100644 --- a/wger/locale/de/LC_MESSAGES/django.po +++ b/wger/locale/de/LC_MESSAGES/django.po @@ -12,15 +12,15 @@ msgstr "" "Project-Id-Version: wger Workout Manager\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-15 14:51+0100\n" -"PO-Revision-Date: 2021-09-19 02:37+0000\n" -"Last-Translator: J. Lavoie \n" +"PO-Revision-Date: 2022-02-25 20:58+0000\n" +"Last-Translator: Roland Geider \n" "Language-Team: German \n" "Language: de\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 4.9-dev\n" +"X-Generator: Weblate 4.11.1-dev\n" #: config/models/gym_config.py:46 gym/templates/gym/list.html:50 msgid "Default gym" @@ -1603,11 +1603,11 @@ msgstr "Der Benutzer {0} hat die Übung „{1}“ eingereicht." #: exercises/models/image.py:59 msgid "Line" -msgstr "" +msgstr "Linie" #: exercises/models/image.py:60 msgid "3D" -msgstr "" +msgstr "3D" #: exercises/models/image.py:61 msgid "Low-poly" @@ -1615,7 +1615,7 @@ msgstr "" #: exercises/models/image.py:62 msgid "Photo" -msgstr "" +msgstr "Foto" #: exercises/models/image.py:63 #, fuzzy @@ -1666,11 +1666,11 @@ msgstr "Auf latein, z.B. „Pectoralis major“" #: exercises/models/video.py:41 msgid "Maximum file size is 100MB." -msgstr "" +msgstr "Die maximale Dateigröße beträgt 100 MB." #: exercises/models/video.py:44 exercises/models/video.py:48 msgid "File type is not supported" -msgstr "" +msgstr "Dateityp wird nicht unterstützt" #: exercises/models/video.py:57 #, fuzzy @@ -1686,11 +1686,11 @@ msgstr "Hauptbild" #: exercises/models/video.py:94 msgid "Video" -msgstr "" +msgstr "Video" #: exercises/models/video.py:101 msgid "Size" -msgstr "" +msgstr "Größe" #: exercises/models/video.py:108 manager/models/schedule_step.py:56 msgid "Duration" @@ -1698,7 +1698,7 @@ msgstr "Dauer" #: exercises/models/video.py:117 msgid "Width" -msgstr "" +msgstr "Breite" #: exercises/models/video.py:124 #, fuzzy @@ -1714,7 +1714,7 @@ msgstr "Quellcode" #: exercises/models/video.py:139 msgid "Codec, long name" -msgstr "" +msgstr "Codec, langer Name" #: exercises/templates/equipment/admin-overview.html:4 msgid "Equipment list" @@ -1906,7 +1906,7 @@ msgstr "Neues Bild hinzufügen" #: exercises/templates/exercise/view.html:148 msgid "Videos" -msgstr "" +msgstr "Videos" #: exercises/templates/exercise/view.html:187 exercises/views/videos.py:94 #, fuzzy @@ -3179,7 +3179,7 @@ msgstr "Dies wird ebenfalls alle Gewichtslogs für diesen Tag löschen." #: measurements/models/measurement.py:69 msgid "Value" -msgstr "" +msgstr "Wert" #: nutrition/forms.py:122 msgid "Calculate" @@ -3307,6 +3307,8 @@ msgid "" "Give meals a textual description / name such as \"Breakfast\" or \"after " "workout\"" msgstr "" +"Mahlzeiten eine Textbeschreibung / Name wie \"Frühstück oder\" \"nach dem " +"Training\" geben" #: nutrition/models/plan.py:71 msgid "" From 25fcfe57e4876faced3e3ed94b1d86b018340b22 Mon Sep 17 00:00:00 2001 From: Jing Date: Thu, 24 Feb 2022 20:10:37 +0000 Subject: [PATCH 04/14] Translated using Weblate (Chinese (Simplified)) Currently translated at 73.0% (561 of 768 strings) Translation: wger Workout Manager/Web App Translate-URL: https://hosted.weblate.org/projects/wger/web/zh_Hans/ --- wger/locale/zh_CN/LC_MESSAGES/django.po | 42 ++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/wger/locale/zh_CN/LC_MESSAGES/django.po b/wger/locale/zh_CN/LC_MESSAGES/django.po index ca7ec1044..bc520ea94 100644 --- a/wger/locale/zh_CN/LC_MESSAGES/django.po +++ b/wger/locale/zh_CN/LC_MESSAGES/django.po @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: wger Workout Manager\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-15 14:51+0100\n" -"PO-Revision-Date: 2022-02-18 02:56+0000\n" -"Last-Translator: sr-c \n" +"PO-Revision-Date: 2022-02-25 20:58+0000\n" +"Last-Translator: Jing \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -24,7 +24,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.11-dev\n" +"X-Generator: Weblate 4.11.1-dev\n" #: config/models/gym_config.py:46 gym/templates/gym/list.html:50 msgid "Default gym" @@ -1381,7 +1381,7 @@ msgstr "" #: core/templates/user/overview.html:487 #, python-format msgid "Admin login is only available for users in %(gym_name)s" -msgstr "" +msgstr "管理员登陆权限只对%(gym_name)s的用户开放" #: core/templates/user/overview.html:491 msgid "Log in as this user" @@ -1532,7 +1532,7 @@ msgstr "类别" #: exercises/models/base.py:58 msgid "Primary muscles" -msgstr "" +msgstr "主要训练肌肉" #: exercises/models/base.py:64 exercises/templates/equipment/overview.html:71 #: exercises/templates/exercise/overview.html:76 @@ -1543,17 +1543,17 @@ msgstr "次要肌肉" #: exercises/models/base.py:79 msgid "Variations" -msgstr "" +msgstr "变体" #: exercises/models/category.py:37 msgid "Exercise Categories" -msgstr "" +msgstr "训练类别" #: exercises/models/comment.py:34 exercises/models/image.py:75 #: exercises/models/video.py:82 manager/forms.py:165 manager/helpers.py:89 #: manager/models/log.py:51 msgid "Exercise" -msgstr "" +msgstr "训练" #: exercises/models/comment.py:41 msgid "A comment about how to correctly do this exercise." @@ -1570,20 +1570,20 @@ msgstr "健身项目被成功添加到通用数据库中" #: exercises/models/exercise.py:265 msgid "New user submitted exercise" -msgstr "" +msgstr "新用户提交锻炼动作" #: exercises/models/exercise.py:267 #, python-brace-format msgid "The user {0} submitted a new exercise \"{1}\"." -msgstr "" +msgstr "用户{0}提交了一次新训练“{1}”." #: exercises/models/image.py:59 msgid "Line" -msgstr "" +msgstr "线条" #: exercises/models/image.py:60 msgid "3D" -msgstr "" +msgstr "3D" #: exercises/models/image.py:61 msgid "Low-poly" @@ -1591,7 +1591,7 @@ msgstr "" #: exercises/models/image.py:62 msgid "Photo" -msgstr "" +msgstr "照片" #: exercises/models/image.py:63 msgid "Other" @@ -1641,7 +1641,7 @@ msgstr "" #: exercises/models/video.py:44 exercises/models/video.py:48 msgid "File type is not supported" -msgstr "" +msgstr "不支持文件类型" #: exercises/models/video.py:57 msgid "File is not a valid video" @@ -1653,19 +1653,19 @@ msgstr "主视频" #: exercises/models/video.py:94 msgid "Video" -msgstr "" +msgstr "视频" #: exercises/models/video.py:101 msgid "Size" -msgstr "" +msgstr "大小" #: exercises/models/video.py:108 manager/models/schedule_step.py:56 msgid "Duration" -msgstr "" +msgstr "时长" #: exercises/models/video.py:117 msgid "Width" -msgstr "" +msgstr "宽度" #: exercises/models/video.py:124 msgid "Height" @@ -1747,7 +1747,7 @@ msgstr "谢谢你的贡献让网站越来越好." #: nutrition/templates/ingredient/email_new.tpl:9 #, python-format msgid "The %(site)s team" -msgstr "" +msgstr "%(site)s团队" #: exercises/templates/exercise/form.html:4 msgid "Submitting an exercise" @@ -1858,7 +1858,7 @@ msgstr "新增图片" #: exercises/templates/exercise/view.html:148 msgid "Videos" -msgstr "" +msgstr "视频" #: exercises/templates/exercise/view.html:187 exercises/views/videos.py:94 msgid "Add new video" @@ -1887,7 +1887,7 @@ msgstr "体重日志" #: exercises/templates/exercise/view.html:306 msgid "Exercise Variations" -msgstr "" +msgstr "动作变体" #: exercises/templates/exercise/view.html:327 msgid "Submit a correction" From 9a6e8aadd8c52f695e33c349ad8b65473ab9f165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Sun, 27 Feb 2022 18:22:26 +0000 Subject: [PATCH 05/14] Translated using Weblate (Turkish) Currently translated at 100.0% (768 of 768 strings) Translation: wger Workout Manager/Web App Translate-URL: https://hosted.weblate.org/projects/wger/web/tr/ --- wger/locale/tr/LC_MESSAGES/django.po | 92 ++++++++++++---------------- 1 file changed, 40 insertions(+), 52 deletions(-) diff --git a/wger/locale/tr/LC_MESSAGES/django.po b/wger/locale/tr/LC_MESSAGES/django.po index caa3763cb..2c2a95d0d 100644 --- a/wger/locale/tr/LC_MESSAGES/django.po +++ b/wger/locale/tr/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: wger Workout Manager\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-15 14:51+0100\n" -"PO-Revision-Date: 2021-08-27 19:38+0000\n" +"PO-Revision-Date: 2022-02-27 22:05+0000\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.8.1-dev\n" +"X-Generator: Weblate 4.11.1-dev\n" #: config/models/gym_config.py:46 gym/templates/gym/list.html:50 msgid "Default gym" @@ -382,7 +382,7 @@ msgstr "Metrik (kilogram)" #: core/models/profile.py:78 msgid "Imperial (pound)" -msgstr "İmparatorluk (paund)" +msgstr "İngiliz (paunt)" #: core/models/profile.py:111 msgid "Show exercise comments" @@ -1598,25 +1598,23 @@ msgstr "{0} kullanıcısı yeni bir \"{1}\" alıştırması gönderdi." #: exercises/models/image.py:59 msgid "Line" -msgstr "" +msgstr "Çizgi" #: exercises/models/image.py:60 msgid "3D" -msgstr "" +msgstr "3B" #: exercises/models/image.py:61 msgid "Low-poly" -msgstr "" +msgstr "Düşük poli" #: exercises/models/image.py:62 msgid "Photo" -msgstr "" +msgstr "Fotoğraf" #: exercises/models/image.py:63 -#, fuzzy -#| msgid "Others" msgid "Other" -msgstr "Diğerleri" +msgstr "Diğer" #: exercises/models/image.py:81 gallery/models/image.py:56 msgid "Image" @@ -1642,7 +1640,7 @@ msgstr "" #: exercises/models/image.py:100 msgid "The art style of your image" -msgstr "" +msgstr "Resminizin sanat tarzı" #: exercises/models/image.py:185 msgid "New user submitted image" @@ -1660,31 +1658,27 @@ msgstr "Latince, ör. \"Büyük pektoralis\"" #: exercises/models/video.py:41 msgid "Maximum file size is 100MB." -msgstr "" +msgstr "Azami dosya boyutu 100MB'dir." #: exercises/models/video.py:44 exercises/models/video.py:48 msgid "File type is not supported" -msgstr "" +msgstr "Dosya türü desteklenmiyor" #: exercises/models/video.py:57 -#, fuzzy -#| msgid "%(birthdate)s is not a valid birthdate" msgid "File is not a valid video" -msgstr "%(birthdate)s geçerli bir doğum tarihi değil" +msgstr "Dosya geçerli bir video değil" #: exercises/models/video.py:88 -#, fuzzy -#| msgid "Main picture" msgid "Main video" -msgstr "Ana resim" +msgstr "Ana video" #: exercises/models/video.py:94 msgid "Video" -msgstr "" +msgstr "Video" #: exercises/models/video.py:101 msgid "Size" -msgstr "" +msgstr "Boyut" #: exercises/models/video.py:108 manager/models/schedule_step.py:56 msgid "Duration" @@ -1692,23 +1686,19 @@ msgstr "Süresi" #: exercises/models/video.py:117 msgid "Width" -msgstr "" +msgstr "Genişlik" #: exercises/models/video.py:124 -#, fuzzy -#| msgid "Weight" msgid "Height" -msgstr "Kilo" +msgstr "Yükseklik" #: exercises/models/video.py:131 -#, fuzzy -#| msgid "Code" msgid "Codec" -msgstr "Kod" +msgstr "Kodek" #: exercises/models/video.py:139 msgid "Codec, long name" -msgstr "" +msgstr "Kodek, uzun ad" #: exercises/templates/equipment/admin-overview.html:4 msgid "Equipment list" @@ -1809,10 +1799,10 @@ msgid "" "when you registered, you will get notified when the process is completed " "successfully." msgstr "" -"Formu gönderdikten sonra, yöneticiler bilgilendirilecektir.\n" -"İncelendikten sonra veritabanına eklenecektir. Bu olana kadar,\n" -"genel bakışta veya aramada görünmez. E-postanızı eklemeniz durumunda\n" -"kayıt olduğunuzda, işlem başarıyla tamamlandığında size haber verilecektir." +"Formu gönderdikten sonra yöneticiler bilgilendirilecektir.\n" +"İncelendikten sonra veri tabanına eklenecektir. Bu olana kadar,\n" +"genel bakışta veya aramada görünmeyecektir. Kayıt olduğunuzda e-postanızı\n" +"eklemeniz durumunda, işlem başarıyla tamamlandığında size haber verilecektir." #: exercises/templates/exercise/form_correct.html:4 msgid "Correcting an exercise" @@ -1867,9 +1857,8 @@ msgid "" "This user submitted exercise is pending a decision to be\n" " included in the database." msgstr "" -"Kullanıcı tarafından gönderilen bu alıştırma ile ilgili bir karar " -"bekleniyor\n" -" veritabanına dahil edilmiştir." +"Bu kullanıcı tarafından gönderilen egzersiz, veri tabanına\n" +" dahil edilmek için bir karar bekliyor." #: exercises/templates/exercise/view.html:53 msgid "Till then, it will not be shown in the overview or the search." @@ -1902,13 +1891,11 @@ msgstr "Yeni resim ekle" #: exercises/templates/exercise/view.html:148 msgid "Videos" -msgstr "" +msgstr "Videolar" #: exercises/templates/exercise/view.html:187 exercises/views/videos.py:94 -#, fuzzy -#| msgid "Add new image" msgid "Add new video" -msgstr "Yeni resim ekle" +msgstr "Yeni video ekle" #: exercises/templates/exercise/view.html:197 msgid "Images pending review" @@ -3172,7 +3159,7 @@ msgstr "Bu, o gün için tüm ağırlık günlüklerini de siler." #: measurements/models/measurement.py:69 msgid "Value" -msgstr "" +msgstr "Değer" #: nutrition/forms.py:122 msgid "Calculate" @@ -3301,6 +3288,8 @@ msgid "" "Give meals a textual description / name such as \"Breakfast\" or \"after " "workout\"" msgstr "" +"Yemeklere \"Kahvaltı\" veya \"antrenmandan sonra\" gibi metinsel bir " +"açıklama / ad verin" #: nutrition/models/plan.py:71 msgid "" @@ -3418,10 +3407,10 @@ msgid "" "when you registered, you will get notified when the process is completed " "sucessfully." msgstr "" -"Formu gönderdikten sonra, yöneticiler bilgilendirilecektir.\n" -"İncelendikten sonra veritabanına eklenecektir. Bu olana kadar,\n" -"genel bakışta veya aramada görünmez. E-postanızı eklemeniz durumunda\n" -"kayıt olduğunuzda, işlem başarıyla tamamlandığında size haber verilecektir." +"Formu gönderdikten sonra yöneticiler bilgilendirilecektir.\n" +"İncelendikten sonra veri tabanına eklenecektir. Bu olana kadar,\n" +"genel bakışta veya aramada görünmeyecektir. Kayıt olduğunuzda e-postanızı\n" +"eklemeniz durumunda, işlem başarıyla tamamlandığında size haber verilecektir." #: nutrition/templates/ingredient/overview.html:45 msgid "No ingredients." @@ -3447,10 +3436,9 @@ msgid "" "or\n" "the search." msgstr "" -"Kullanıcı tarafından gönderilen bu içerik, bir karar bekliyor\n" -"veritabanına dahil edilmiştir. O zamana kadar, genel bakışta gösterilmeyecek " -"veya\n" -"Araştırma." +"Bu kullanıcı tarafından gönderilen malzeme, veri tabanına\n" +"dahil edilmek için bir karar bekliyor. Bu olana kadar, genel bakışta veya\n" +"aramada görünmeyecektir." #: nutrition/templates/ingredient/view.html:71 #: nutrition/templates/log/detail.html:31 @@ -3573,7 +3561,7 @@ msgstr "Beslenme verileri" #: nutrition/templates/plan/view.html:221 #, python-format msgid "Based on the weight entry dated %(date)s (%(weight)s)" -msgstr "%(date)s (%(weight)s) tarihli ağırlık girdisine göre" +msgstr "%(date)s (%(weight)s) tarihli ağırlık girişine göre" #: nutrition/templates/plan/view.html:230 nutrition/views/plan.py:377 msgid "Total" @@ -3939,7 +3927,7 @@ msgstr "" #: software/templates/features.html:171 msgid "Exercise database" -msgstr "Egzersiz veritabanı" +msgstr "Egzersiz veri tabanı" #: software/templates/features.html:175 msgid "" @@ -3947,7 +3935,7 @@ msgid "" "can choose when creating a workout. You can view them by category and " "equipment used or muscles trained." msgstr "" -"Egzersiz veritabanı, bir egzersiz oluştururken aralarından seçim " +"Egzersiz veri tabanı, bir egzersiz oluştururken aralarından seçim " "yapabileceğiniz yüzden fazla egzersiz içerir. Bunları kategoriye ve " "kullanılan ekipmana veya çalıştırılan kaslara göre görüntüleyebilirsiniz." From fd034b45e52ee00a0cac28a93bb0621e65d5017d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 23:03:01 +0000 Subject: [PATCH 06/14] Bump docker/login-action from 1.13.0 to 1.14.1 Bumps [docker/login-action](https://github.com/docker/login-action) from 1.13.0 to 1.14.1. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v1.13.0...v1.14.1) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/docker-base.yml | 2 +- .github/workflows/docker.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-base.yml b/.github/workflows/docker-base.yml index 119d6bfbe..5c0f6c7a0 100644 --- a/.github/workflows/docker-base.yml +++ b/.github/workflows/docker-base.yml @@ -23,7 +23,7 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub - uses: docker/login-action@v1.13.0 + uses: docker/login-action@v1.14.1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b8712840d..20b899b3a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -19,7 +19,7 @@ jobs: uses: docker/setup-buildx-action@v1.6.0 - name: Login to DockerHub - uses: docker/login-action@v1.13.0 + uses: docker/login-action@v1.14.1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} From c4efe843cc4484ce41b8034243d1ef0c912e2d0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Mar 2022 23:03:04 +0000 Subject: [PATCH 07/14] Bump actions/checkout from 2.4.0 to 3 Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/docker-base.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/formatter.yml | 2 +- .github/workflows/linter.yml | 2 +- .github/workflows/pypi-publish.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4439fc7d6..0db1f3a02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: steps: - - uses: actions/checkout@v2.4.0 + - uses: actions/checkout@v3 - name: Cache dependencies uses: actions/cache@v2.1.7 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 912fc3000..73842c437 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/docker-base.yml b/.github/workflows/docker-base.yml index 119d6bfbe..1134ae912 100644 --- a/.github/workflows/docker-base.yml +++ b/.github/workflows/docker-base.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v1.2.0 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b8712840d..c6eae369e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v1.2.0 diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml index 3558f72da..b765b4733 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/formatter.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 - name: Get dependencies run: pip install yapf isort diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index eefd9b196..fd00540a2 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -44,7 +44,7 @@ jobs: # Checkout the code base # ########################## - name: Checkout Code - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v3 ################################ # Run Linter against code base # diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 7634aa734..819c16a46 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2.4.0 + - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v2 with: From 512c9cb5044700d6e83309915dfb120280935473 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Mar 2022 23:01:26 +0000 Subject: [PATCH 08/14] Bump reportlab from 3.6.7 to 3.6.8 Bumps [reportlab](http://www.reportlab.com/) from 3.6.7 to 3.6.8. --- updated-dependencies: - dependency-name: reportlab dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 180642a2e..d90aca64e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ easy-thumbnails~=2.8 icalendar==4.0.9 invoke~=1.6 pillow~=9.0 -reportlab==3.6.7 +reportlab==3.6.8 requests==2.27.1 # AWS From 3cc4e59aa53433be6657b0c91372ddb9ef258b19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 23:02:29 +0000 Subject: [PATCH 09/14] Bump pymongo from 4.0.1 to 4.0.2 Bumps [pymongo](https://github.com/mongodb/mongo-python-driver) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/mongodb/mongo-python-driver/releases) - [Changelog](https://github.com/mongodb/mongo-python-driver/blob/4.0.2/doc/changelog.rst) - [Commits](https://github.com/mongodb/mongo-python-driver/compare/4.0.1...4.0.2) --- updated-dependencies: - dependency-name: pymongo dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 1248e9815..b7b661119 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -9,7 +9,7 @@ wheel==0.37.1 # for ingredient import script from OFF -pymongo==4.0.1 +pymongo==4.0.2 # Development packages coverage==6.3.2 From f132d7276a387dbb1f75d05ad21ba74460b7bfe4 Mon Sep 17 00:00:00 2001 From: MARCO ACORTE Date: Wed, 9 Mar 2022 08:38:34 +0000 Subject: [PATCH 10/14] Translated using Weblate (Italian) Currently translated at 100.0% (768 of 768 strings) Translation: wger Workout Manager/Web App Translate-URL: https://hosted.weblate.org/projects/wger/web/it/ --- wger/locale/it/LC_MESSAGES/django.po | 157 ++++++++++++--------------- 1 file changed, 69 insertions(+), 88 deletions(-) diff --git a/wger/locale/it/LC_MESSAGES/django.po b/wger/locale/it/LC_MESSAGES/django.po index 73ac79227..43c88c01a 100644 --- a/wger/locale/it/LC_MESSAGES/django.po +++ b/wger/locale/it/LC_MESSAGES/django.po @@ -16,15 +16,15 @@ msgstr "" "Project-Id-Version: wger Workout Manager\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-02-15 14:51+0100\n" -"PO-Revision-Date: 2021-06-18 08:48+0000\n" -"Last-Translator: Roland Geider \n" +"PO-Revision-Date: 2022-03-10 08:59+0000\n" +"Last-Translator: MARCO ACORTE \n" "Language-Team: Italian \n" "Language: it\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 4.7\n" +"X-Generator: Weblate 4.12-dev\n" #: config/models/gym_config.py:46 gym/templates/gym/list.html:50 msgid "Default gym" @@ -808,7 +808,7 @@ msgstr "Trovato niente" #: core/templates/template_features.html:118 #: core/templates/template_no_context.html:88 msgid "Imprint" -msgstr "" +msgstr "Impressum" #: core/templates/misc/fragments/shariff_modal.html:6 msgid "Share this page" @@ -857,23 +857,19 @@ msgstr "Calendario" #: core/templates/navigation.html:44 gallery/templates/images/overview.html:6 msgid "Gallery" -msgstr "" +msgstr "Galleria" #: core/templates/navigation.html:48 -#, fuzzy -#| msgid "Workout complete!" msgid "Workout templates" -msgstr "Allenamento completo!" +msgstr "Modelli di allenamento" #: core/templates/navigation.html:53 manager/views/workout.py:101 -#, fuzzy -#| msgid "Your schedules" msgid "Your templates" -msgstr "Le tue programmazioni" +msgstr "I tuoi modelli" #: core/templates/navigation.html:59 manager/views/workout.py:115 msgid "Public templates" -msgstr "" +msgstr "Modelli pubblici" #: core/templates/navigation.html:64 msgctxt "as in sorted by category" @@ -1615,25 +1611,23 @@ msgstr "L'utente {0} ha inserito un nuovo esercizio «{1}»." #: exercises/models/image.py:59 msgid "Line" -msgstr "" +msgstr "Linea" #: exercises/models/image.py:60 msgid "3D" -msgstr "" +msgstr "3D" #: exercises/models/image.py:61 msgid "Low-poly" -msgstr "" +msgstr "Basso numero di poligoni" #: exercises/models/image.py:62 msgid "Photo" -msgstr "" +msgstr "Foto" #: exercises/models/image.py:63 -#, fuzzy -#| msgid "Others" msgid "Other" -msgstr "Altri" +msgstr "Altro" #: exercises/models/image.py:81 gallery/models/image.py:56 msgid "Image" @@ -1659,7 +1653,7 @@ msgstr "" #: exercises/models/image.py:100 msgid "The art style of your image" -msgstr "" +msgstr "Lo stile artistico della tua immagine" #: exercises/models/image.py:185 msgid "New user submitted image" @@ -1676,31 +1670,27 @@ msgstr "In latino es. «Pectoralis major»" #: exercises/models/video.py:41 msgid "Maximum file size is 100MB." -msgstr "" +msgstr "La dimensione massima del file è 100 MB." #: exercises/models/video.py:44 exercises/models/video.py:48 msgid "File type is not supported" -msgstr "" +msgstr "Il tipo di file non è supportato" #: exercises/models/video.py:57 -#, fuzzy -#| msgid "%(birthdate)s is not a valid birthdate" msgid "File is not a valid video" -msgstr "%(birthdate)s non è un compleanno valido" +msgstr "Il file non è un video valido" #: exercises/models/video.py:88 -#, fuzzy -#| msgid "Main picture" msgid "Main video" -msgstr "Immagine principale" +msgstr "Video principale" #: exercises/models/video.py:94 msgid "Video" -msgstr "" +msgstr "Video" #: exercises/models/video.py:101 msgid "Size" -msgstr "" +msgstr "Dimensione" #: exercises/models/video.py:108 manager/models/schedule_step.py:56 msgid "Duration" @@ -1708,23 +1698,19 @@ msgstr "Durata" #: exercises/models/video.py:117 msgid "Width" -msgstr "" +msgstr "Larghezza" #: exercises/models/video.py:124 -#, fuzzy -#| msgid "Weight" msgid "Height" -msgstr "Peso" +msgstr "Altezza" #: exercises/models/video.py:131 -#, fuzzy -#| msgid "Code" msgid "Codec" -msgstr "Codice" +msgstr "Codec" #: exercises/models/video.py:139 msgid "Codec, long name" -msgstr "" +msgstr "Codec, nome completo" #: exercises/templates/equipment/admin-overview.html:4 msgid "Equipment list" @@ -1810,7 +1796,9 @@ msgstr "Inserendo un esercizio" msgid "" "Thank you for submitting an exercise. This is much\n" "appreciated!" -msgstr "Grazie per aver inserito un esercizio. Lo apprezziamo davvero!" +msgstr "" +"Grazie per aver inserito un esercizio.\n" +"Lo apprezziamo davvero!" #: exercises/templates/exercise/form.html:8 msgid "" @@ -1916,13 +1904,11 @@ msgstr "Aggiungi nuova immagine" #: exercises/templates/exercise/view.html:148 msgid "Videos" -msgstr "" +msgstr "Video" #: exercises/templates/exercise/view.html:187 exercises/views/videos.py:94 -#, fuzzy -#| msgid "Add new image" msgid "Add new video" -msgstr "Aggiungi nuova immagine" +msgstr "Aggiungi nuovo video" #: exercises/templates/exercise/view.html:197 msgid "Images pending review" @@ -2029,10 +2015,8 @@ msgid "Delete?" msgstr "Elimina?" #: gallery/templates/images/overview.html:62 -#, fuzzy -#| msgid "Add new image" msgid "Add image" -msgstr "Aggiungi nuova immagine" +msgstr "Aggiungi immagine" #: gym/forms.py:59 gym/templates/gym/member_list.html:44 msgid "Trainer" @@ -2478,10 +2462,8 @@ msgid "Kilometers" msgstr "Chilometri" #: i18n.tpl:35 -#, fuzzy -#| msgid "Reps" msgid "Max Reps" -msgstr "Ripetizioni" +msgstr "Numero massimo di ripetizioni" #: i18n.tpl:36 msgid "Miles" @@ -2558,10 +2540,8 @@ msgid "Correction" msgstr "Correzione" #: manager/forms.py:89 manager/models/workout.py:59 -#, fuzzy -#| msgid "Make a copy of this workout" msgid "The name of the workout" -msgstr "Fai una copia di questo allenamento" +msgstr "Nome dell'allenamento" #: manager/forms.py:93 manager/models/workout.py:66 msgid "" @@ -2723,28 +2703,30 @@ msgstr "Data di creazione" #: manager/models/workout.py:72 manager/templates/workout/template_view.html:11 #: manager/templates/workout/template_view.html:19 -#, fuzzy -#| msgid "Workout complete!" msgid "Workout template" -msgstr "Allenamento completo!" +msgstr "Modello di allenamento" #: manager/models/workout.py:74 msgid "" "Marking a workout as a template will freeze it and allow you to make copies " "of it" msgstr "" +"Contrassegnare un allenamento come modello lo bloccherà e ti consentirà di " +"farne delle copie" #: manager/models/workout.py:81 msgid "Public template" -msgstr "" +msgstr "Modello pubblico" #: manager/models/workout.py:82 msgid "A public template is available to other users" -msgstr "" +msgstr "Un modello pubblico è disponibile per altri utenti" #: manager/models/workout.py:114 msgid "You must mark this workout as a template before declaring it public" msgstr "" +"Devi contrassegnare questo allenamento come modello prima di dichiararlo " +"pubblico" #: manager/templates/calendar/day.html:9 manager/templates/calendar/day.html:31 msgid "Workout log" @@ -3076,16 +3058,12 @@ msgstr "" "sono ignorati qui." #: manager/templates/workout/overview.html:25 -#, fuzzy -#| msgid "No schedules found." msgid "No templates found." -msgstr "Nessuna programmazione trovata." +msgstr "Nessun modello trovato." #: manager/templates/workout/template_view.html:53 -#, fuzzy -#| msgid "Make a copy of this workout" msgid "Mark as workout" -msgstr "Fai una copia di questo allenamento" +msgstr "Contrassegna come allenamento" #: manager/templates/workout/template_view.html:65 #: manager/templates/workout/view.html:97 @@ -3101,10 +3079,8 @@ msgstr "" "sull'allenamento." #: manager/templates/workout/template_view.html:89 -#, fuzzy -#| msgid "Share this page" msgid "Use this template" -msgstr "Condividi questa pagina" +msgstr "Usa questo modello" #: manager/templates/workout/view.html:72 msgid "Add training day" @@ -3144,7 +3120,7 @@ msgstr "Modifica allenamento" #: manager/templates/workout/view.html:225 manager/views/workout.py:300 msgid "Mark as template" -msgstr "" +msgstr "Contrassegna come modello" #: manager/views/day.py:109 msgid "Add workout day" @@ -3196,7 +3172,7 @@ msgstr "Questo cancellerà anche tutti i log del peso per questo giorno." #: measurements/models/measurement.py:69 msgid "Value" -msgstr "" +msgstr "Valore" #: nutrition/forms.py:122 msgid "Calculate" @@ -3326,6 +3302,8 @@ msgid "" "Give meals a textual description / name such as \"Breakfast\" or \"after " "workout\"" msgstr "" +"Dai ai pasti una descrizione testuale/nome come \"Colazione\" o \"Dopo l'" +"allenamento\"" #: nutrition/models/plan.py:71 msgid "" @@ -3592,7 +3570,7 @@ msgstr "Aggiungi la pianificazione" #: nutrition/templates/plan/view.html:208 msgid "Add a new meal" -msgstr "Aggiungi un nuovo pasto." +msgstr "Aggiungi un nuovo pasto" #: nutrition/templates/plan/view.html:218 nutrition/views/plan.py:369 msgid "Nutritional data" @@ -3628,19 +3606,15 @@ msgid "Goal" msgstr "Obiettivo" #: nutrition/templates/plan/view.html:384 -#, fuzzy -#| msgid "" -#| "You have selected that this nutritional plan has a\n" -#| " goal amount of calories. Use the calculator or enter the value " -#| "yourself." msgid "" "You have selected that this nutritional plan has a\n" " goal amount of calories. Use the calculator or enter the value\n" " yourself." msgstr "" "Hai selezionato che questo piano nutrizionale ha un\n" -"     obbiettivo sulla quantità di calorie. Usa la calcolatrice o inserisci " -"il valore tu stesso." +" obbiettivo sulla quantità di calorie. Usa la calcolatrice o " +"inserisci il valore\n" +" tu stesso." #: nutrition/templates/plan/view.html:394 msgid "" @@ -3680,7 +3654,7 @@ msgstr "" #: nutrition/templates/rate/form.html:37 msgid "Your basic metabolic rate is: " -msgstr "Il tuo metabolismo basale è:" +msgstr "Il tuo metabolismo basale è: " #: nutrition/templates/rate/form.html:47 msgid "Physical activities" @@ -3699,7 +3673,7 @@ msgstr "" #: nutrition/templates/rate/form.html:59 msgid "Factor for daily activities: " -msgstr "Fattore per le attività quotidiane:" +msgstr "Fattore per le attività quotidiane: " #: nutrition/templates/rate/form.html:67 msgid "" @@ -3795,44 +3769,51 @@ msgid "" "Thank you for using wger! wger is a collaborative open source project, made " "by fitness enthusiasts from around the world." msgstr "" +"Grazie per aver usato wger! wger è un progetto collaborativo open source, " +"realizzato da appassionati di fitness di tutto il mondo." #: software/templates/about_us.html:18 msgid "Source code" -msgstr "" +msgstr "Codice sorgente" #: software/templates/about_us.html:20 msgid "Get the source code of this application and its server on github" msgstr "" +"Ottieni il codice sorgente di questa applicazione e del suo server su GitHub" #: software/templates/about_us.html:25 msgid "Have a problem or idea?" -msgstr "" +msgstr "Hai un problema o un'idea?" #: software/templates/about_us.html:27 msgid "" "Get in touch if something didn't behave as expected or if there is a feature " "that you feel is missing." msgstr "" +"Contattaci se qualcosa non ha funzionato come previsto o se c'è una " +"funzionalità che ritieni mancante." #: software/templates/about_us.html:32 msgid "Say hi!" -msgstr "" +msgstr "Dì ciao!" #: software/templates/about_us.html:34 msgid "If you want to chat with us, hop on the Discord server and get in touch" msgstr "" +"Se vuoi chattare con noi, raggiungici sul server Discord e mettiti in " +"contatto" #: software/templates/about_us.html:39 -#, fuzzy -#| msgid "Translate" msgid "Translation" -msgstr "Traduci" +msgstr "Traduzione" #: software/templates/about_us.html:41 msgid "" "This application is translated on weblate. If you also want to help, click " "the link and start translating" msgstr "" +"Questa applicazione è tradotta su weblate. Se vuoi aiutare anche tu, clicca " +"sul link e inizia a tradurre" #: software/templates/about_us.html:50 msgid "Our goal" @@ -3856,7 +3837,7 @@ msgid "" "your exercises and workouts. " msgstr "" "wger Workout Manager è un'applicazione web gratuita e open source che " -"gestisce i tuoi esercizi e allenamenti." +"gestisce i tuoi esercizi e allenamenti. " #: software/templates/features.html:24 msgid "Welcome to wger" @@ -4174,7 +4155,7 @@ msgid "" "you want." msgstr "" "È possibile correggere l'elenco qui e inviarlo di nuovo tutte le volte\n" -"che vuoi" +"che vuoi." #: weight/templates/import_csv_preview.html:85 msgid "Re-Submit" @@ -4191,11 +4172,11 @@ msgstr "Importa da foglio di calcolo" #: weight/views.py:104 #, python-format msgid "Edit weight entry for the %s" -msgstr "Modifica l'inserimento di peso per %s " +msgstr "Modifica l'inserimento di peso per %s" #: weight/views.py:123 msgid "Successfully deleted." -msgstr "Cancellato con successo" +msgstr "Cancellato con successo." #: weight/views.py:127 #, python-format From 879a54f46a4be1f9c1fbd68e751fa2fa73309136 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 17 Feb 2022 22:13:45 +0100 Subject: [PATCH 11/14] Backport exercise aliases from feature/exercise-crowdsourcing This is not exposed or shown anywhere, but we can save the data to the database in preparation for when it is --- .../migrations/0016_exercisealias.py | 22 +++++++ wger/exercises/models/__init__.py | 1 + wger/exercises/models/exercise_alias.py | 61 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 wger/exercises/migrations/0016_exercisealias.py create mode 100644 wger/exercises/models/exercise_alias.py diff --git a/wger/exercises/migrations/0016_exercisealias.py b/wger/exercises/migrations/0016_exercisealias.py new file mode 100644 index 000000000..c065f2ad5 --- /dev/null +++ b/wger/exercises/migrations/0016_exercisealias.py @@ -0,0 +1,22 @@ +# Generated by Django 3.2.10 on 2022-02-17 21:05 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('exercises', '0015_exercise_videos'), + ] + + operations = [ + migrations.CreateModel( + name='Alias', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('alias', models.CharField(max_length=200, verbose_name='Alias for an exercise')), + ('exercise', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercises.exercise', verbose_name='Exercise')), + ], + ), + ] diff --git a/wger/exercises/models/__init__.py b/wger/exercises/models/__init__.py index af78f086c..c26f43fa6 100644 --- a/wger/exercises/models/__init__.py +++ b/wger/exercises/models/__init__.py @@ -24,3 +24,4 @@ from .image import ExerciseImage from .muscle import Muscle from .variation import Variation from .video import ExerciseVideo +from .exercise_alias import Alias diff --git a/wger/exercises/models/exercise_alias.py b/wger/exercises/models/exercise_alias.py new file mode 100644 index 000000000..85938dfc5 --- /dev/null +++ b/wger/exercises/models/exercise_alias.py @@ -0,0 +1,61 @@ +# This file is part of wger Workout Manager . +# Copyright (C) 2013 - 2021 wger Team +# +# wger Workout Manager is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# wger Workout Manager is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Django +from django.db import models +from django.utils.translation import gettext_lazy as _ + +# wger +from wger.utils.cache import reset_workout_canonical_form + +# Local +from .exercise import Exercise + + +class Alias(models.Model): + """ + Model for an exercise (name)alias + """ + exercise = models.ForeignKey( + Exercise, + verbose_name=_('Exercise'), + on_delete=models.CASCADE + ) + alias = models.CharField( + max_length=200, + verbose_name=_('Alias for an exercise'), + ) + + def __str__(self): + """ + Return a more human-readable representation + """ + return self.alias + + def delete(self, *args, **kwargs): + """ + Reset cached workouts + """ + for setting in self.exercise.setting_set.all(): + reset_workout_canonical_form(setting.set.exerciseday.training.pk) + + super(Alias, self).delete(*args, **kwargs) + + def get_owner_object(self): + """ + Comment has no owner information + """ + return False From 58d740119426309daf228218e99a153813fc019b Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 18 Feb 2022 14:14:32 +0100 Subject: [PATCH 12/14] Formatting --- wger/exercises/migrations/0016_exercisealias.py | 16 ++++++++++++++-- wger/exercises/models/__init__.py | 2 +- wger/exercises/models/exercise_alias.py | 6 +----- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/wger/exercises/migrations/0016_exercisealias.py b/wger/exercises/migrations/0016_exercisealias.py index c065f2ad5..7d87d47ba 100644 --- a/wger/exercises/migrations/0016_exercisealias.py +++ b/wger/exercises/migrations/0016_exercisealias.py @@ -14,9 +14,21 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Alias', fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ( + 'id', + models.AutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name='ID' + ) + ), ('alias', models.CharField(max_length=200, verbose_name='Alias for an exercise')), - ('exercise', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercises.exercise', verbose_name='Exercise')), + ( + 'exercise', + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + to='exercises.exercise', + verbose_name='Exercise' + ) + ), ], ), ] diff --git a/wger/exercises/models/__init__.py b/wger/exercises/models/__init__.py index c26f43fa6..1a325dd99 100644 --- a/wger/exercises/models/__init__.py +++ b/wger/exercises/models/__init__.py @@ -20,8 +20,8 @@ from .category import ExerciseCategory from .comment import ExerciseComment from .equipment import Equipment from .exercise import Exercise +from .exercise_alias import Alias from .image import ExerciseImage from .muscle import Muscle from .variation import Variation from .video import ExerciseVideo -from .exercise_alias import Alias diff --git a/wger/exercises/models/exercise_alias.py b/wger/exercises/models/exercise_alias.py index 85938dfc5..43b7979d2 100644 --- a/wger/exercises/models/exercise_alias.py +++ b/wger/exercises/models/exercise_alias.py @@ -29,11 +29,7 @@ class Alias(models.Model): """ Model for an exercise (name)alias """ - exercise = models.ForeignKey( - Exercise, - verbose_name=_('Exercise'), - on_delete=models.CASCADE - ) + exercise = models.ForeignKey(Exercise, verbose_name=_('Exercise'), on_delete=models.CASCADE) alias = models.CharField( max_length=200, verbose_name=_('Alias for an exercise'), From f88e017b840c81b8d4ace1ef127ebebb61a7ffbe Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 18 Feb 2022 23:00:59 +0100 Subject: [PATCH 13/14] Commit one off scripts for exercise data cleanup --- .../management/commands/exercise-cleanup.py | 128 ++++++++++ .../commands/read-exercise-cleanup.py | 220 ++++++++++++++++++ 2 files changed, 348 insertions(+) create mode 100755 wger/exercises/management/commands/exercise-cleanup.py create mode 100644 wger/exercises/management/commands/read-exercise-cleanup.py diff --git a/wger/exercises/management/commands/exercise-cleanup.py b/wger/exercises/management/commands/exercise-cleanup.py new file mode 100755 index 000000000..3b1ec6ec6 --- /dev/null +++ b/wger/exercises/management/commands/exercise-cleanup.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 *-* + +# This file is part of wger Workout Manager. +# +# wger Workout Manager is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# wger Workout Manager is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License + +# Standard Library +import csv +import os +import pprint + +# Django +from django.conf import settings +from django.core.exceptions import ( + ImproperlyConfigured, + ValidationError, +) +from django.core.files import File +from django.core.files.temp import NamedTemporaryFile +from django.core.management.base import ( + BaseCommand, + CommandError, +) +from django.core.validators import URLValidator + +# Third Party +import requests +from requests.utils import default_user_agent + +# wger +from wger import get_version +from wger.core.models import Language +from wger.exercises.models import ( + Exercise, + ExerciseBase, + ExerciseImage, +) + + +class Command(BaseCommand): + """ + ONE OFF SCRIPT! + + This script reads out the exercise database and writes it to a CSV file, + so that mass corrections can be done. The file can be read in with + read-exercises-cleanup.py + """ + + def handle(self, **options): + out = [] + + languages = Language.objects.all() + for base in ExerciseBase.objects.accepted(): + + data = { + 'base': { + 'uuid': base.uuid, + 'category': base.category.name, + 'equipment': ','.join([e.name for e in base.equipment.all()]), + 'variations': base.variations.id if base.variations else '' + } + } + + for language in languages: + exercise_data = { + 'uuid': '', + 'name': '', + 'description': '', + 'aliases': '', + 'license': '', + 'author': '' + } + + exercise = Exercise.objects.filter(exercise_base=base, language=language).first() + if exercise: + exercise_data['uuid'] = exercise.uuid + exercise_data['name'] = exercise.name + exercise_data['description'] = exercise.description + exercise_data['license'] = exercise.license.short_name + exercise_data['author'] = exercise.license_author + + data[language.short_name] = exercise_data + out.append(data) + + # pprint.pprint(out) + with open('exercise_cleanup.csv', 'w', newline='') as csvfile: + file_writer = csv.writer(csvfile, ) + + header = ['base:uuid', 'base:category', 'base:equipment', 'base:variations'] + for language in languages: + header += [ + f'{language.short_name}:uuid', + f'{language.short_name}:name', + f'{language.short_name}:description', + f'{language.short_name}:license', + f'{language.short_name}:author', + ] + + file_writer.writerow(header) + + for entry in out: + data = [ + entry['base']['uuid'], + entry['base']['category'], + entry['base']['equipment'], + entry['base']['variations'], + ] + for language in languages: + data += [ + entry[language.short_name]['uuid'], + entry[language.short_name]['name'], + entry[language.short_name]['description'], + '', # Alias field is still empty for all + entry[language.short_name]['license'], + entry[language.short_name]['author'], + ] + + file_writer.writerow(data) diff --git a/wger/exercises/management/commands/read-exercise-cleanup.py b/wger/exercises/management/commands/read-exercise-cleanup.py new file mode 100644 index 000000000..6dd99c437 --- /dev/null +++ b/wger/exercises/management/commands/read-exercise-cleanup.py @@ -0,0 +1,220 @@ +# -*- coding: utf-8 *-* + +# This file is part of wger Workout Manager. +# +# wger Workout Manager is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# wger Workout Manager is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License + +# Standard Library +import csv +import pathlib + +# Django +from django.core.files import File +from django.core.management.base import BaseCommand + +# wger +from utils.constants import DEFAULT_LICENSE_ID +from wger.core.models import ( + Language, + License, +) +from wger.exercises.models import ( + Alias, + Equipment, + Exercise, + ExerciseBase, + ExerciseCategory, + ExerciseVideo, + Variation, +) + + +class Command(BaseCommand): + """ + ONE OFF SCRIPT! + + This script reads back into the database corrections made to a CSV generated with + exercise-cleanup.py + """ + + help = 'Update the exercise database based on the exercise cleanup spreadsheet' + + def handle(self, **options): + csv_file = open('exercise_cleanup.csv', 'r', newline='') + file_reader = csv.DictReader(csv_file) + + UUID_NEW = 'NEW' + + # Controls whether we create new bases or exercises if they have the UUID 'NEW' + SKIP_CREATE_ENTRIES_ON_NEW = False + + VIDEO_AUTHOR = 'Goulart' + + VIDEO_PATH = pathlib.Path('videos-tmp') + VIDEO_EXTENSION = '.webm' + + # + # Sanity check + # + available_languages = [ + 'en', 'de', 'fr', 'it', 'es', 'nl', 'pt', 'ru', 'cs', 'uk', 'tr', 'sv', 'bg' + ] + columns = ['uuid', 'name', 'description', 'aliases', 'license', 'author'] + + for language in available_languages: + for column in columns: + name = '{0}:{1}'.format(language, column) + assert (name in file_reader.fieldnames + ), '{0} not in {1}'.format(name, file_reader.fieldnames) + + language_objs = [ + Language.objects.get(short_name=language) for language in available_languages + ] + + default_license = License.objects.get(pk=DEFAULT_LICENSE_ID) + + # + # Process the exercises + # + rows = [f for f in file_reader] + for row in rows: + new_exercise = False + base_uuid = row['base:uuid'] + base_equipment = row['base:equipment'] + base_category = row['base:category'] + base_variation_id = row['base:variation'] + base_video = row['base:video'] + + self.stdout.write(f'\n\n*** Processing base-UUID {base_uuid}\n') + self.stdout.write('-------------------------------------------------------------\n') + + # + # Load and update the base data + # + if not base_uuid: + self.stdout.write(' No base uuid, skipping') + continue + + if SKIP_CREATE_ENTRIES_ON_NEW and base_uuid == UUID_NEW: + self.stdout.write(f' Skipping creating new base...\n') + continue + base = ExerciseBase.objects.get(uuid=base_uuid + ) if base_uuid != UUID_NEW else ExerciseBase() + + # Update the base data + base.category = ExerciseCategory.objects.get(name=base_category) + base_equipment_list = [] + if base_equipment: + base_equipment_list = [ + Equipment.objects.get(name=e.strip()) for e in base_equipment.split(',') + ] + base.equipment.set(base_equipment_list) + + # Variations + if base_variation_id: + # First element from get_or_create is the object, the second whether + # it was created or updated + variation = Variation.objects.get_or_create(id=base_variation_id)[0] + base.variations = variation + + base.save() + + # Save the video + if base_video and not ExerciseVideo.objects.filter(exercise_base=base).exists(): + path = VIDEO_PATH / pathlib.Path(base_video + VIDEO_EXTENSION) + with path.open('rb') as video_file: + video = ExerciseVideo() + video.exercise_base = base + video.license = default_license + video.license_author = VIDEO_AUTHOR + video.video.save( + path.name, + File(video_file), + ) + video.save() + self.stdout.write(f'Saving video {video.video}\n') + + # + # Process the translations and create new exercises if necessary + # + for language in language_objs: + language_short = language.short_name + exercise_uuid = row[f'{language_short}:uuid'] + exercise_name = row[f'{language_short}:name'] + exercise_description = row[f'{language_short}:description'] + exercise_license = row[f'{language_short}:license'] + exercise_author = row[f'{language_short}:author'] + exercise_aliases = row[f'{language_short}:aliases'] + + # Load exercise + if exercise_uuid: + self.stdout.write(f'{language_short}: exercise uuid: {exercise_uuid}\n') + + if SKIP_CREATE_ENTRIES_ON_NEW and exercise_uuid == UUID_NEW: + self.stdout.write(f' Skipping creating new exercise...\n') + continue + try: + exercise = Exercise.objects.get( + uuid=exercise_uuid + ) if (exercise_uuid and exercise_uuid != UUID_NEW) else Exercise() + except Exercise.DoesNotExist: + self.stdout.write( + self.style. + WARNING(f' Exercise isn not known locally: {exercise_uuid}!\n') + ) + continue + + exercise.exercise_base = base + exercise.language = language + + # Set the nane and description, if there is any + if exercise_name: + exercise.name = exercise_name + exercise.name_original = exercise_name + exercise.description = exercise_description + else: + continue + + # Set the license + if exercise_license: + try: + exercise_license = License.objects.get(short_name=exercise_license) + except License.DoesNotExist: + self.stdout.write( + self.style. + WARNING(f' License does not exist: {exercise_license}!!!\n') + ) + exercise_license = default_license + else: + exercise_license = default_license + exercise.license = exercise_license + exercise.license_author = exercise_author + + if not exercise.id: + new_exercise = True + + exercise.status = Exercise.STATUS_ACCEPTED + exercise.save() + + # Set the aliases + if exercise_aliases: + Alias.objects.filter(exercise=exercise).delete() + for a in exercise_aliases.split('/'): + Alias(exercise=exercise, alias=a.strip()).save() + + if new_exercise: + self.stdout.write( + self.style. + SUCCESS(f' New exercise saved, ID: {exercise.id}, {exercise.name}\n') + ) + csv_file.close() From 93af3041677f9c1e98f66bc11f0b7bae645761e4 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 10 Mar 2022 12:53:30 +0100 Subject: [PATCH 14/14] Set compressed root in docker settings file --- extras/docker/development/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extras/docker/development/settings.py b/extras/docker/development/settings.py index 9338fbf94..04859e43d 100644 --- a/extras/docker/development/settings.py +++ b/extras/docker/development/settings.py @@ -101,3 +101,6 @@ if os.environ.get("DJANGO_CACHE_BACKEND"): } } } + +# Folder for compressed CSS and JS files +COMPRESS_ROOT = STATIC_ROOT